Welp, technically better?

This commit is contained in:
2026-02-23 23:21:17 +00:00
parent f34cbfd23b
commit f40894577d
3 changed files with 13 additions and 6 deletions
+4 -1
View File
@@ -48,7 +48,10 @@ func NewMainController(logger *slog.Logger) *MainController {
}
mc.EvBus.On(ui.RedrawEv{}, func(e any) {
mc.App.QueueUpdateDraw(func() {})
rev := e.(ui.RedrawEv)
if rev.Fn != nil {
mc.App.QueueUpdateDraw(e.(ui.RedrawEv).Fn)
}
})
mc.EvBus.On(ui.ChangeFocusEv{}, func(e any) {
+3 -1
View File
@@ -21,7 +21,9 @@ type PrintLogEv struct {
Log string
}
type RedrawEv struct{}
type RedrawEv struct {
Fn func()
}
type ChangeFocusEv struct {
Target tview.Primitive
+6 -4
View File
@@ -67,9 +67,11 @@ func streamingWindow(bus *events.Bus, doc *dom.DOM) {
bus.Emit(ui.StartStreamingReqEv{})
bus.On(ui.StreamDataEv{}, func(e any) {
sd := e.(ui.StreamDataEv)
box.SetText(sd.Str)
bus.Emit(ui.ForceRedraw{})
bus.Emit(ui.RedrawEv{
Fn: func() {
sd := e.(ui.StreamDataEv)
box.SetText(sd.Str)
},
})
})
}