From 821f2d652148a70e2ef54db07da8cacc489b7e15 Mon Sep 17 00:00:00 2001 From: Aslan Dukaev Date: Sun, 11 Jan 2026 13:10:23 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20=D1=83=D0=BB=D1=83=D1=87=D1=88=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D1=83=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=84=D0=BE=D0=BA=D1=83=D1=81=D0=BE=D0=BC=20?= =?UTF-8?q?=D0=BC=D0=B5=D0=B6=D0=B4=D1=83=20=D0=BF=D0=B0=D0=BD=D0=B5=D0=BB?= =?UTF-8?q?=D1=8F=D0=BC=D0=B8=20=D0=B2=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB?= =?UTF-8?q?=D0=B8=20V2UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/dive/cli/internal/ui/v2/app/model.go | 47 +++++++++++++++--------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/cmd/dive/cli/internal/ui/v2/app/model.go b/cmd/dive/cli/internal/ui/v2/app/model.go index c8db624..4fde6e2 100644 --- a/cmd/dive/cli/internal/ui/v2/app/model.go +++ b/cmd/dive/cli/internal/ui/v2/app/model.go @@ -289,23 +289,35 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { newPane, cmd := m.layersPane.Update(msg) m.layersPane = newPane.(LayersPane) cmds = append(cmds, cmd) - m.activePane = PaneLayer + if m.activePane != PaneLayer { + m.activePane = PaneLayer + m.updateFocus() + } } else if y >= layersEndY && y < detailsEndY { // Details pane (read-only, no mouse handling) - m.activePane = PaneDetails + if m.activePane != PaneDetails { + m.activePane = PaneDetails + m.updateFocus() + } } else { // Image pane newPane, cmd := m.imagePane.Update(msg) m.imagePane = newPane.(ImagePane) cmds = append(cmds, cmd) - m.activePane = PaneImage + if m.activePane != PaneImage { + m.activePane = PaneImage + m.updateFocus() + } } } else if inRightCol { // Tree pane newPane, cmd := m.treePane.Update(msg) m.treePane = newPane.(TreePane) cmds = append(cmds, cmd) - m.activePane = PaneTree + if m.activePane != PaneTree { + m.activePane = PaneTree + m.updateFocus() + } } case tea.WindowSizeMsg: @@ -336,27 +348,26 @@ func (m *Model) togglePane() { m.activePane = PaneLayer } - // Update focus state based on new active pane + m.updateFocus() +} + +func (m *Model) updateFocus() { + // Update focus state based on current active pane + // Blur all panes first + m.layersPane.Blur() + m.detailsPane.Blur() + m.imagePane.Blur() + m.treePane.Blur() + + // Focus only the active pane switch m.activePane { case PaneLayer: m.layersPane.Focus() - m.detailsPane.Blur() - m.imagePane.Blur() - m.treePane.Blur() case PaneDetails: - m.layersPane.Blur() - m.detailsPane.Focus() // Show focus visually, but no keyboard handling - m.imagePane.Blur() - m.treePane.Blur() + m.detailsPane.Focus() // Show focus visually case PaneImage: - m.layersPane.Blur() - m.detailsPane.Blur() m.imagePane.Focus() - m.treePane.Blur() case PaneTree: - m.layersPane.Blur() - m.detailsPane.Blur() - m.imagePane.Blur() m.treePane.Focus() } }