Repository navigation
fix(tab-bar): render tab close shortcut as text, not key caps - #10248
Conversation
The Close tab tooltip rendered its Cmd+W shortcut with ShortcutKeyCombo key-cap chips. On the light tooltip surface (bg-foreground) those filled grey caps read as heavy, low-contrast boxes that clash with how every other tooltip shows its shortcut as plain text, e.g. "Toggle sidebar (Cmd B)". Switch both tab close tooltips (EditorFileTabCloseButton and SortableTab) to the same plain-text convention via useOptionalShortcutLabel, rendering "Close tab (Cmd W)" and falling back to just "Close tab" when the action is unbound. Reuses the existing translation keys, so no catalog churn. Co-authored-by: Orca <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughClose-tab tooltips in the editor file tab and sortable tab components now use 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thanks @franklinjavier , glad you also appreciate the change, haha |
Details make perfection, and perfection is not a detail. Do you know that quote? Haha Btw, you guys are doing an awesome tool |
…ai#10248) Co-authored-by: Orca <[email protected]>
Summary
The Close tab tooltip rendered its
⌘Wshortcut usingShortcutKeyCombokey‑cap chips. Because the tooltip surface is light (bg-foreground), those filled grey caps read as heavy, low‑contrast boxes — and they're inconsistent with every other tooltip in the app, which shows its shortcut as plain text (e.g.Toggle sidebar (⌘B),New workspace (⌘N)).This switches both tab close tooltips to that same plain‑text convention via
useOptionalShortcutLabel:EditorFileTabCloseButton— editor / simulator tabsSortableTab— terminal / agent / browser tabsThe tooltip now reads
Close tab (⌘W), falling back to justClose tabwhen the action is unbound. No new copy or translation keys: it reuses the existingClose tabcatalog entries, and the shortcut itself is a formatted keybinding (not translated — same as the chips were). Now‑unusedShortcutKeyCombo/useShortcutKeyDetailsimports were removed.TabBarQuickCommandsMenuintentionally keeps its key caps — it renders on a dark command‑palette surface where the chips are appropriate.Screenshots
Before → After (rendered from the components' exact markup + Orca dark‑mode tokens + the Geist app font):
macOS shown; Windows/Linux render
Close tab (Ctrl+W).Testing
pnpm lint— oxlint, formatting (oxfmt, via pre‑commit), andverify:localization-catalogall pass for this change.verify:skill-bundle-manifest("Released snapshot history changed for orca-cli at revision 9"); it reproduces identically on untouchedmainand does not involve any file in this PR.pnpm typecheck— passes cleanly.pnpm test— affected tab‑bar suites pass (SortableTab.rename-shortcut,EditorFileTab,EditorFileTabContextMenu). Full suite: 3567 files / 36654 tests passed.src/relay/agent-exec-handler.test.ts(codex spawn expectations) — that file and its source are byte‑identical tomainand fail the same there.pnpm build— not run; this is a copy‑only change in two renderer components with no build‑affecting surface.useOptionalShortcutLabeland exercise these components; this is a label‑rendering swap that introduces no new branch beyond the existing unbound‑shortcut fallback, so no new tests were warranted.AI Review Report
Self‑review focused on correctness, scope, and cross‑platform behavior:
useOptionalShortcutLabel('tab.close')→formatKeybindingList, which yields⌘Won macOS andCtrl+Won Windows/Linux. The parenthetical form reads correctly on all three. No paths, shell, or Electron‑specific surfaces are touched.useOptionalShortcutLabelreturnsnullwhen the action is unbound, so the tooltip degrades to plainClose tab— no dangling().aria-label("Close tab …"), and E2E hook (data-tab-close-button) are unchanged; only the tooltip's shortcut presentation changed.TabBarQuickCommandsMenu(dark palette surface) is deliberately left as‑is. Removed the now‑unused imports.Security Audit
No input handling, command execution, path handling, auth, secrets, dependency, or IPC changes. This is a purely presentational change in two renderer components; the only new runtime value is a formatted keybinding string already used throughout the app. No new dependencies. Nothing to flag.
Notes
Close tab (⌘W); Windows/Linux showClose tab (Ctrl+W).pr-assets-cmd-w-tab-close-tooltipbranch — safe to delete after merge.main.Made with Orca 🐋