detached f05de9b

fix(ui): ensure activePaneID consistency and avoid redundant updates

commit
f05de9b38fbf4cebe102de9287977f7ce438a84a
author
brice · · 2025-12-22 07:57 UTC
parent
04b95bc
signature
unsigned
1 file · +6 -9
M internal/ui/coordinator/workspace.go +6 -9
@@ -1476,13 +1476,8 @@ func (c *WorkspaceCoordinator) onTitleBarClick(ctx context.Context, stackNode *e
14761476 // Update domain model
14771477 stackNode.ActiveStackIndex = clickedIndex
14781478
1479- // Update workspace active pane
1480- ws, wsView := c.getActiveWS()
1481- if ws != nil {
1482- ws.ActivePaneID = clickedPaneID
1483- }
1484-
1485- // Update workspace view
1479+ // Update workspace view (also updates domain model)
1480+ _, wsView := c.getActiveWS()
14861481 if wsView != nil {
14871482 if err := wsView.SetActivePaneID(clickedPaneID); err != nil {
14881483 log.Warn().Err(err).Msg("failed to set active pane in workspace view")
@@ -1665,8 +1660,10 @@ func (c *WorkspaceCoordinator) insertPopupStacked(ctx context.Context, input Ins
16651660
16661661 c.insertStackChild(stackNode, input.PopupPane)
16671662
1668- // Update workspace active pane
1669- ws.ActivePaneID = input.PopupPane.ID
1663+ if wsView == nil {
1664+ // No workspace view to update; keep domain model consistent.
1665+ ws.ActivePaneID = input.PopupPane.ID
1666+ }
16701667
16711668 if err := c.attachPopupPaneView(ctx, input, wsView, stackNode, log); err != nil {
16721669 return err
@@ -1476,13 +1476,8 @@ func (c *WorkspaceCoordinator) onTitleBarClick(ctx context.Context, stackNode *e
1476 // Update domain model1476 // Update domain model
1477 stackNode.ActiveStackIndex = clickedIndex1477 stackNode.ActiveStackIndex = clickedIndex
1478 1478
1479- // Update workspace active pane1479+ // Update workspace view (also updates domain model)
1480- ws, wsView := c.getActiveWS()1480+ _, wsView := c.getActiveWS()
1481- if ws != nil {
1482- ws.ActivePaneID = clickedPaneID
1483- }
1484-
1485- // Update workspace view
1486 if wsView != nil {1481 if wsView != nil {
1487 if err := wsView.SetActivePaneID(clickedPaneID); err != nil {1482 if err := wsView.SetActivePaneID(clickedPaneID); err != nil {
1488 log.Warn().Err(err).Msg("failed to set active pane in workspace view")1483 log.Warn().Err(err).Msg("failed to set active pane in workspace view")
@@ -1665,8 +1660,10 @@ func (c *WorkspaceCoordinator) insertPopupStacked(ctx context.Context, input Ins
1665 1660
1666 c.insertStackChild(stackNode, input.PopupPane)1661 c.insertStackChild(stackNode, input.PopupPane)
1667 1662
1668- // Update workspace active pane1663+ if wsView == nil {
1669- ws.ActivePaneID = input.PopupPane.ID1664+ // No workspace view to update; keep domain model consistent.
1665+ ws.ActivePaneID = input.PopupPane.ID
1666+ }
1670 1667
1671 if err := c.attachPopupPaneView(ctx, input, wsView, stackNode, log); err != nil {1668 if err := c.attachPopupPaneView(ctx, input, wsView, stackNode, log); err != nil {
1672 return err1669 return err

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