diff options
| author | adamdottv <[email protected]> | 2025-05-30 06:47:44 -0500 |
|---|---|---|
| committer | adamdottv <[email protected]> | 2025-05-30 06:47:44 -0500 |
| commit | 189d0e5fb2fc728c639952dd17fef1abdf251c18 (patch) | |
| tree | f214079acd5cae2b01d1638486b40462c4f51888 /internal/tui/components | |
| parent | b1b402faa7616a4dd976a2a79e57ae0334ab509b (diff) | |
| download | opencode-189d0e5fb2fc728c639952dd17fef1abdf251c18.tar.gz opencode-189d0e5fb2fc728c639952dd17fef1abdf251c18.zip | |
wip: refactoring tui
Diffstat (limited to 'internal/tui/components')
| -rw-r--r-- | internal/tui/components/chat/messages.go | 4 | ||||
| -rw-r--r-- | internal/tui/components/dialog/session.go | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/internal/tui/components/chat/messages.go b/internal/tui/components/chat/messages.go index 0dda7ae32..ae6f2a687 100644 --- a/internal/tui/components/chat/messages.go +++ b/internal/tui/components/chat/messages.go @@ -73,8 +73,8 @@ func (m *messagesCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { cmd := m.Reload() return m, cmd case state.SessionClearedMsg: - m.rendering = false - return m, nil + cmd := m.Reload() + return m, cmd case tea.KeyMsg: if key.Matches(msg, messageKeys.PageUp) || key.Matches(msg, messageKeys.PageDown) || key.Matches(msg, messageKeys.HalfPageUp) || key.Matches(msg, messageKeys.HalfPageDown) { diff --git a/internal/tui/components/dialog/session.go b/internal/tui/components/dialog/session.go index fd08a7db5..99aa41515 100644 --- a/internal/tui/components/dialog/session.go +++ b/internal/tui/components/dialog/session.go @@ -74,6 +74,9 @@ func (s *sessionDialogCmp) Init() tea.Cmd { func (s *sessionDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { + case tea.WindowSizeMsg: + s.width = msg.Width + s.height = msg.Height case tea.KeyMsg: switch { case key.Matches(msg, sessionKeys.Up) || key.Matches(msg, sessionKeys.K): @@ -98,9 +101,6 @@ func (s *sessionDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { case key.Matches(msg, sessionKeys.Escape): return s, util.CmdHandler(CloseSessionDialogMsg{}) } - case tea.WindowSizeMsg: - s.width = msg.Width - s.height = msg.Height } return s, nil } |
