Conversation
Double-click a pane's sidebar row to edit its name: Enter saves, Escape cancels, an empty or unchanged name is discarded, and a click outside commits. The rename reuses the existing sessions:rename IPC, whose frontend handlers were already written but never rendered. Committing on blur (the pattern PanelTabStrip uses for tabs) does not work here: double-clicking also activates the pane, and activation pulls focus to the terminal, so the input committed itself one tick after mounting. Instead a capture-phase pointerdown listener commits on a real outside click, and the first programmatic blur reclaims focus once. Also fixes a pre-existing sessionStore bug this surfaced. A main repo session is held both in the sessions array and in activeMainRepoSession, but updateSession returned early after updating the active copy, so the sidebar kept rendering stale data for that pane. Both copies now update together, matching updateSessionGitStatus. Claude-Session: https://claude.ai/code/session_019yor34qu8TA9jTkkHtvu59
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Double-click a pane's row in the sidebar to rename it inline.
Entersaves,EscapecancelsThe rename reuses the existing
sessions:renameIPC. The frontend handlers forit were already written but never rendered, so this wires up the missing
interaction rather than adding a new path:
API.sessions.rename(frontend/src/utils/api.ts) ->window.electronAPI.sessions.rename(main/src/preload.ts) ->sessions:rename(main/src/ipc/session.ts)Why commit-on-blur does not work here
PanelTabStripcommits tab renames on blur, and that pattern was the obviousone to copy, but it fails for this row: double-clicking also activates the
pane, and activation pulls focus to the terminal. The input committed itself one
tick after mounting, before the user could type.
Instead the commit is driven by the user's pointer rather than by whichever
element grabs focus next:
pointerdownlistener commits on a real outside clickThe draft also seeds from the stored pane name rather than the row label, so a
pane displaying a PR title is still edited against its own name.
Drive-by fix: main repo sessions are stored twice
Building this surfaced a pre-existing
sessionStorebug.A repository's main repo session lives in two places: the
sessionsarray thatthe sidebar renders, and
activeMainRepoSessionthat the project view reads.updateSessionreturned early after updating the active copy, so the sidebarkept rendering stale data for that pane.
This is not specific to rename — any update to that pane (name, status, favorite,
git metadata) was affected. Both copies now move together, matching what
updateSessionGitStatusalready did.docs/STATE_MANAGEMENT.mdgains a section on the dual-storage trap so the nextwriter does not reintroduce it.
Tests
tests/sidebar-rename-pane.spec.ts, 4 cases, running against the existingelectronApiMock:Entercommits the new nameEscapecancels without calling the backendstore fix above)
All 4 pass. Frontend unit suite: 334/334. Typecheck and oxlint clean.