From 45b2139f572240fa9c26893c6b4b5c7384d4d739 Mon Sep 17 00:00:00 2001 From: dorozco Date: Fri, 31 Oct 2025 14:46:01 -0500 Subject: [PATCH 1/2] fix right to show last focused on following mode --- internal/tui/views/trafficwatch/left_pane.go | 3 +++ internal/tui/views/trafficwatch/main_view.go | 15 ++++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/tui/views/trafficwatch/left_pane.go b/internal/tui/views/trafficwatch/left_pane.go index 3d57ccd..c476eee 100644 --- a/internal/tui/views/trafficwatch/left_pane.go +++ b/internal/tui/views/trafficwatch/left_pane.go @@ -177,6 +177,9 @@ func (l *LeftPane) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } var cmd tea.Cmd + if val, ok := msg.(tea.KeyMsg); ok && val.String() == "left" { + return l, nil + } l.paginator, cmd = l.paginator.Update(msg) return l, cmd } diff --git a/internal/tui/views/trafficwatch/main_view.go b/internal/tui/views/trafficwatch/main_view.go index 94da820..59294de 100644 --- a/internal/tui/views/trafficwatch/main_view.go +++ b/internal/tui/views/trafficwatch/main_view.go @@ -335,22 +335,19 @@ func (m *MainView) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } // Update focused pane - var cmd tea.Cmd if m.state == StateWithData { m.rightPane.SetFocused(m.focus == "right") - switch m.focus { - case "left": - _, cmd = m.leftPane.Update(msg) - case "right": - _, cmd = m.rightPane.Update(msg) - } + _, cmd := m.leftPane.Update(msg) + cmds = append(cmds, cmd) + + _, cmd = m.rightPane.Update(msg) } if m.state == StateLogs { - _, cmd = m.logsView.Update(msg) + _, cmd := m.logsView.Update(msg) + cmds = append(cmds, cmd) } - cmds = append(cmds, cmd) return m, tea.Batch(cmds...) } From 276549ba542f1f3eecde30b24083b8f68e17bfbb Mon Sep 17 00:00:00 2001 From: dorozco Date: Fri, 31 Oct 2025 14:59:51 -0500 Subject: [PATCH 2/2] fix pr comment --- internal/tui/views/trafficwatch/main_view.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/tui/views/trafficwatch/main_view.go b/internal/tui/views/trafficwatch/main_view.go index 59294de..b09d7ce 100644 --- a/internal/tui/views/trafficwatch/main_view.go +++ b/internal/tui/views/trafficwatch/main_view.go @@ -342,6 +342,7 @@ func (m *MainView) Update(msg tea.Msg) (tea.Model, tea.Cmd) { cmds = append(cmds, cmd) _, cmd = m.rightPane.Update(msg) + cmds = append(cmds, cmd) } if m.state == StateLogs {