Skip to content

fix(tab-bar): render tab close shortcut as text, not key caps - #10248

Merged
nwparker merged 1 commit into
mainfrom
nwparker/cmd-w-tab-close-tooltip-text
Jul 24, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/cmd-w-tab-close-tooltip-text

Conversation

@nwparker

@nwparker nwparker commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Close tab tooltip rendered its ⌘W shortcut using ShortcutKeyCombo key‑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 tabs
  • SortableTab — terminal / agent / browser tabs

The tooltip now reads Close tab (⌘W), falling back to just Close tab when the action is unbound. No new copy or translation keys: it reuses the existing Close tab catalog entries, and the shortcut itself is a formatted keybinding (not translated — same as the chips were). Now‑unused ShortcutKeyCombo / useShortcutKeyDetails imports were removed.

TabBarQuickCommandsMenu intentionally 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):

Close tab tooltip — before and after

macOS shown; Windows/Linux render Close tab (Ctrl+W).

Testing

  • pnpm lint — oxlint, formatting (oxfmt, via pre‑commit), and verify:localization-catalog all pass for this change. ⚠️ One pre‑existing, unrelated failure remains in verify:skill-bundle-manifest ("Released snapshot history changed for orca-cli at revision 9"); it reproduces identically on untouched main and 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. ⚠️ 2 pre‑existing, unrelated failures in src/relay/agent-exec-handler.test.ts (codex spawn expectations) — that file and its source are byte‑identical to main and fail the same there.
  • pnpm build — not run; this is a copy‑only change in two renderer components with no build‑affecting surface.
  • Added or updated high‑quality tests, or explained why not — existing tab‑bar tests already mock useOptionalShortcutLabel and 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:

  • Cross‑platform (macOS / Linux / Windows): the label comes from useOptionalShortcutLabel('tab.close') → formatKeybindingList, which yields ⌘W on macOS and Ctrl+W on Windows/Linux. The parenthetical form reads correctly on all three. No paths, shell, or Electron‑specific surfaces are touched.
  • Unbound shortcut: useOptionalShortcutLabel returns null when the action is unbound, so the tooltip degrades to plain Close tab — no dangling ().
  • No behavioral regressions: the close action, aria-label ("Close tab …"), and E2E hook (data-tab-close-button) are unchanged; only the tooltip's shortcut presentation changed.
  • Scope check: confirmed these are the only two close‑tab tooltips using key caps; 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

  • macOS shows Close tab (⌘W); Windows/Linux show Close tab (Ctrl+W).
  • Screenshots are hosted on the throwaway pr-assets-cmd-w-tab-close-tooltip branch — safe to delete after merge.
  • The pre‑existing lint/test failures noted above are unrelated to this PR and exist on main.

Made with Orca 🐋

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]>
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8f452e2a-a37b-4cc7-94d2-bb3ec3d861f0

📥 Commits

Reviewing files that changed from the base of the PR and between 43f6265 and 78edddd.

📒 Files selected for processing (2)
  • src/renderer/src/components/tab-bar/EditorFileTabCloseButton.tsx
  • src/renderer/src/components/tab-bar/SortableTab.tsx

📝 Walkthrough

Walkthrough

Close-tab tooltips in the editor file tab and sortable tab components now use useOptionalShortcutLabel('tab.close'). They display the translated close label alone or with the optional shortcut in parentheses, replacing the previous ShortcutKeyCombo rendering and related layout.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main UI change: tab close shortcuts are now rendered as text instead of key caps.
Description check ✅ Passed The description follows the required template and includes summary, screenshots, testing, AI review, security, and notes sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit 52cef48 into main Jul 24, 2026
2 checks passed
@nwparker
nwparker deleted the nwparker/cmd-w-tab-close-tooltip-text branch July 24, 2026 01:40
@nwparker

Copy link
Copy Markdown
Contributor Author

Thanks @franklinjavier , glad you also appreciate the change, haha

@franklinjavier

Copy link
Copy Markdown

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

enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants