fix(ui): sequence state-sensitive command flows and bump tview
This commit is contained in:
parent
5f6d0296c3
commit
99e9481a72
5 changed files with 7 additions and 10 deletions
2
go.mod
2
go.mod
|
|
@ -11,7 +11,7 @@ require (
|
|||
github.com/alecthomas/chroma/v2 v2.23.1
|
||||
github.com/andybalholm/brotli v1.2.1
|
||||
github.com/ayn2op/clipboard v0.0.0-20260308203959-c5ad7df3fc97
|
||||
github.com/ayn2op/tview v0.0.0-20260420160540-112aca6def81
|
||||
github.com/ayn2op/tview v0.0.0-20260420233216-e6ed1e0a9300
|
||||
github.com/deckarep/gosx-notifier v0.0.0-20180201035817-e127226297fb
|
||||
github.com/diamondburned/arikawa/v3 v3.6.1-0.20260311205148-176ad9b9440f
|
||||
github.com/diamondburned/ningen/v3 v3.0.1-0.20260306213430-5a08d3a709b4
|
||||
|
|
|
|||
4
go.sum
4
go.sum
|
|
@ -14,8 +14,8 @@ github.com/andybalholm/brotli v1.2.1 h1:R+f5xP285VArJDRgowrfb9DqL18yVK0gKAW/F+eT
|
|||
github.com/andybalholm/brotli v1.2.1/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
|
||||
github.com/ayn2op/clipboard v0.0.0-20260308203959-c5ad7df3fc97 h1:WujETUV+v0DEJyZgjeLzQvihWyL80c0Tg4qf0dDo+Io=
|
||||
github.com/ayn2op/clipboard v0.0.0-20260308203959-c5ad7df3fc97/go.mod h1:3kFnpNCa3dF6WryzOMCDao7PfZ7DTCh+pievlfuwV80=
|
||||
github.com/ayn2op/tview v0.0.0-20260420160540-112aca6def81 h1:I1rz8MKjFynyEfocUidca5DgxexayCdrT9Vch/76JW4=
|
||||
github.com/ayn2op/tview v0.0.0-20260420160540-112aca6def81/go.mod h1:K4qMjKIPIYbOM7aP7dXFRdTrAtVbpWPPT8Q93+DBfKI=
|
||||
github.com/ayn2op/tview v0.0.0-20260420233216-e6ed1e0a9300 h1:NgyEvrOHIZIRddzWNgPNaMYOHe6m4QLjiMznstdzhUo=
|
||||
github.com/ayn2op/tview v0.0.0-20260420233216-e6ed1e0a9300/go.mod h1:K4qMjKIPIYbOM7aP7dXFRdTrAtVbpWPPT8Q93+DBfKI=
|
||||
github.com/clipperhouse/displaywidth v0.11.0 h1:lBc6kY44VFw+TDx4I8opi/EtL9m20WSEFgwIwO+UVM8=
|
||||
github.com/clipperhouse/displaywidth v0.11.0/go.mod h1:bkrFNkf81G8HyVqmKGxsPufD3JhNl3dSqnGhOoSD/o0=
|
||||
github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk=
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ func (mi *messageInput) Update(msg tview.Msg) tview.Cmd {
|
|||
}
|
||||
|
||||
// Apply key edits first, then recompute autocomplete through Msg/Cmd.
|
||||
return tview.Batch(handler(msg), mi.tabSuggest())
|
||||
return tview.Sequence(handler(msg), mi.tabSuggest())
|
||||
}
|
||||
}
|
||||
return handler(msg)
|
||||
|
|
|
|||
|
|
@ -312,10 +312,7 @@ func (m *Model) Update(msg tview.Msg) tview.Cmd {
|
|||
m.messageInput.SetPlaceholder(tview.NewLine(tview.NewSegment(text, tcell.StyleDefault.Dim(true))))
|
||||
return focusCmd
|
||||
case QuitMsg:
|
||||
return tview.Batch(
|
||||
m.closeState(),
|
||||
tview.Quit(),
|
||||
)
|
||||
return m.closeState()
|
||||
case tview.ModalDoneMsg:
|
||||
if m.HasLayer(confirmModalLayerName) {
|
||||
m.RemoveLayer(confirmModalLayerName)
|
||||
|
|
@ -354,7 +351,7 @@ func (m *Model) Update(msg tview.Msg) tview.Cmd {
|
|||
return nil
|
||||
|
||||
case keybind.Matches(msg, m.cfg.Keybinds.Logout.Keybind):
|
||||
return tview.Batch(m.closeState(), m.logout())
|
||||
return tview.Sequence(m.closeState(), m.logout())
|
||||
}
|
||||
case tabSuggestMsg:
|
||||
// Member search completes in a command goroutine; resume suggestion
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ func (m *Model) Update(msg tview.Msg) tview.Cmd {
|
|||
if m.inner != nil {
|
||||
innerCmd = m.inner.Update(chat.QuitMsg{})
|
||||
}
|
||||
return tview.Batch(innerCmd, tview.Quit())
|
||||
return tview.Sequence(innerCmd, tview.Quit())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue