Repository navigation
fix(sidebar): double-click rename opens on new-style and compact cards - #46816
Conversation
Double-click rename never opened on new-style and compact cards with hover details: the template swapped the details hover for a bare title when renaming began, and a sleeping card's first click woke it and dropped the dim wrapper. Both remounted the title and ended the rename. The details hover now stays and is held shut while renaming, and the dim wrapper stays mounted with its attribute toggled.
Visible-card PR refresh measures the card surface's first child, and a display:contents wrapper has no box, so new-style cards dropped out of it. Sleeping cards already render this block wrapper, so awake cards now match.
A rename started from the keyboard while the details hover was open only masked it, so it reopened when the rename ended. Starting a rename now closes the hover at the card controller; the hover only refuses to reopen meanwhile.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
ELI5
On the new and compact workspace card styles, double-clicking a workspace's name in the sidebar did nothing: the rename box flashed and vanished, and whatever you typed went nowhere. Now the rename box opens and stays open, as it does on classic cards.
What Changed
DetailsHoverwhenever the card has hover details. A newclosedprop (renaming) keeps the hover card from opening, instead of dropping the wrapper.Why
Element identity in React depends on where a component sits in the tree. Any wrapper added or dropped around the title when renaming starts, or when the workspace wakes, ends the edit. Keeping the title's position stable fixes it for every way a rename starts (double-click, context menu, shortcut) without special-casing focus. The dead
WorktreeCardParentContent(no importers) still has the old pattern. It's left alone.Linked Issue
Found while fixing inline rename saves (#46766). No issue filed.
Visual Proof
New-style card, double-click the title, then type
renamed:Sidebar screenshots in the classic, new and compact styles, plus an opened hovercard, look the same as on
main.Testing
tests/e2e/workspaces/sidebar/card-title-rename.spec.tsdrives a hidden Electron build on macOS with new-style cards:pnpm check:changedpassed.Performance
None worth noting. New-style cards get one wrapper
div. While renaming, the details hover stays mounted instead of unmounting and remounting. There's no work per keystroke.Risk
Low. The riskiest part is the always-mounted dim wrapper. Other code measures the card surface's first child (visible-card PR refresh), so it has to stay a real block box. It is one, the same as sleeping cards already used. Only the built-in card template uses
DetailsHover. A plain revert restores the old behaviour.Level: Low
AI Disclosure
Review
Codex plus a Claude reviewer, four rounds.
display: contentsdim wrapper broke visible-card PR refresh measurement. It's now a block box.vars.hoverDetailsonly changes with card style or placement. The guard added for it was dropped.Agent skill upstream boundary
Notes
Classic cards without a compact line have no hover details, so they never hit this. The hovercard's own title rename keeps its own editing state and wasn't affected.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)