detached aff1999

fix: deactivate old pane border when keyboard overrides hover focus

commit
aff19992d14793b9004ee2128db2cc4034b88014
author
brice · · 2026-01-01 10:39 UTC
parent
f2d203b
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +20 -0
M internal/ui/component/workspace_view.go +12 -0
@@ -357,6 +357,18 @@ func (wv *WorkspaceView) FocusPane(paneID entity.PaneID) bool {
357357 return pv.GrabFocus()
358358 }
359359
360+// DeactivatePane removes the active visual indicator from a pane.
361+// This is used when keyboard navigation overrides mouse hover focus.
362+func (wv *WorkspaceView) DeactivatePane(paneID entity.PaneID) {
363+ wv.mu.RLock()
364+ pv, ok := wv.paneViews[paneID]
365+ wv.mu.RUnlock()
366+
367+ if ok && pv != nil {
368+ pv.SetActive(false)
369+ }
370+}
371+
360372 // SetWebViewWidget attaches a WebView widget to a specific pane.
361373 func (wv *WorkspaceView) SetWebViewWidget(paneID entity.PaneID, widget layout.Widget) error {
362374 wv.mu.RLock()
@@ -357,6 +357,18 @@ func (wv *WorkspaceView) FocusPane(paneID entity.PaneID) bool {
357 return pv.GrabFocus()357 return pv.GrabFocus()
358 }358 }
359 359
360+// DeactivatePane removes the active visual indicator from a pane.
361+// This is used when keyboard navigation overrides mouse hover focus.
362+func (wv *WorkspaceView) DeactivatePane(paneID entity.PaneID) {
363+ wv.mu.RLock()
364+ pv, ok := wv.paneViews[paneID]
365+ wv.mu.RUnlock()
366+
367+ if ok && pv != nil {
368+ pv.SetActive(false)
369+ }
370+}
371+
360 // SetWebViewWidget attaches a WebView widget to a specific pane.372 // SetWebViewWidget attaches a WebView widget to a specific pane.
361 func (wv *WorkspaceView) SetWebViewWidget(paneID entity.PaneID, widget layout.Widget) error {373 func (wv *WorkspaceView) SetWebViewWidget(paneID entity.PaneID, widget layout.Widget) error {
362 wv.mu.RLock()374 wv.mu.RLock()
M internal/ui/coordinator/workspace.go +8 -0
@@ -1141,6 +1141,9 @@ func (c *WorkspaceCoordinator) FocusPane(ctx context.Context, direction usecase.
11411141 return nil
11421142 }
11431143
1144+ // Save old active pane ID before navigation updates the domain model
1145+ oldActivePaneID := ws.ActivePaneID
1146+
11441147 // Use geometric navigation if focus manager is available
11451148 var newPane *entity.PaneNode
11461149 var err error
@@ -1169,6 +1172,11 @@ func (c *WorkspaceCoordinator) FocusPane(ctx context.Context, direction usecase.
11691172 wsView.CancelAllPendingHovers()
11701173 wsView.SuppressHover(component.KeyboardFocusSuppressDuration)
11711174
1175+ // Deactivate old pane explicitly (domain model already updated by NavigateGeometric)
1176+ if oldActivePaneID != "" && oldActivePaneID != newPane.Pane.ID {
1177+ wsView.DeactivatePane(oldActivePaneID)
1178+ }
1179+
11721180 // Update the workspace view's active pane
11731181 if err := wsView.SetActivePaneID(newPane.Pane.ID); err != nil {
11741182 log.Warn().Err(err).Msg("failed to update active pane in view")
@@ -1141,6 +1141,9 @@ func (c *WorkspaceCoordinator) FocusPane(ctx context.Context, direction usecase.
1141 return nil1141 return nil
1142 }1142 }
1143 1143
1144+ // Save old active pane ID before navigation updates the domain model
1145+ oldActivePaneID := ws.ActivePaneID
1146+
1144 // Use geometric navigation if focus manager is available1147 // Use geometric navigation if focus manager is available
1145 var newPane *entity.PaneNode1148 var newPane *entity.PaneNode
1146 var err error1149 var err error
@@ -1169,6 +1172,11 @@ func (c *WorkspaceCoordinator) FocusPane(ctx context.Context, direction usecase.
1169 wsView.CancelAllPendingHovers()1172 wsView.CancelAllPendingHovers()
1170 wsView.SuppressHover(component.KeyboardFocusSuppressDuration)1173 wsView.SuppressHover(component.KeyboardFocusSuppressDuration)
1171 1174
1175+ // Deactivate old pane explicitly (domain model already updated by NavigateGeometric)
1176+ if oldActivePaneID != "" && oldActivePaneID != newPane.Pane.ID {
1177+ wsView.DeactivatePane(oldActivePaneID)
1178+ }
1179+
1172 // Update the workspace view's active pane1180 // Update the workspace view's active pane
1173 if err := wsView.SetActivePaneID(newPane.Pane.ID); err != nil {1181 if err := wsView.SetActivePaneID(newPane.Pane.ID); err != nil {
1174 log.Warn().Err(err).Msg("failed to update active pane in view")1182 log.Warn().Err(err).Msg("failed to update active pane in view")

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close