orca icon indicating copy to clipboard operation
orca copied to clipboard

feat: floating workspace shortcuts and tab shortcut affordances

Open wolfiesch opened this issue 5 months ago • 5 comments

Summary

Adds keyboard-shortcut visibility and floating-workspace shortcut support across the tab bar and floating terminal. The original default-agent chip is one piece of a broader set of shortcut affordances in this branch.

1. Floating workspace shortcuts

  • New keybinding actions floatingWorkspace.maximize / floatingWorkspace.minimize.
  • A one-shot timestamped "open maximized" intent so the global shortcut can open the floating panel directly into maximized state.
  • App.tsx handles the maximize chord when the panel is closed; FloatingTerminalPanel handles maximize/minimize/rename plus digit-based visible-tab selection.
  • Under terminal-first, digit tab-selection is intentionally left to the focused terminal (covered by FloatingTerminalPanel.test.tsx), while panel chrome (rename/maximize/minimize) stays owned by the floating panel.

2. Shortcut UI affordances across tab surfaces

  • New useOptionalShortcutLabel hook returns null for unbound actions (no Unassigned placeholder), driving conditional shortcut chips.
  • New Tab + menu: the configured default agent row (settings.defaultTuiAgent) shows the tab.newAgent chip; no chip for null/Auto, 'blank', unbound, or non-default rows.
  • Tab/editor context menus and the "Open Markdown…" entry show shortcut chips only when bound.
  • Floating window controls show live shortcut hints in tooltips.

3. Tab close affordances + i18n

  • EditorFileTabCloseButton with tooltip + shortcut combo; filename tooltip remains on the focusable tab root so hover and keyboard focus both reveal it.
  • New Close tab locale keys translated for es, ja, ko, zh (plus en).

Before / After (default agent chip)

Before (default = Auto) After (default = Codex)

Review fixes addressed

  • A11y (Copilot): restored the filename tooltip trigger onto the focusable tab root (regression where it moved to a non-focusable <span>); updated tab-title-tooltip.test.tsx to assert the trigger on the root.
  • i18n (Copilot): translated the new Close tab strings for es/ja/ko/zh instead of leaving English.
  • Test guard (CodeRabbit): QuickLaunchButton.test.ts rowMarkup now asserts both indices are found before slicing.
  • Digit-selection (CodeRabbit): evaluated and intentionally not changed — terminal-first deliberately leaves digit tab-switching to the terminal, enforced by an existing test.

Cross-platform

  • macOS default binds tab.newAgent to ⌘⌥T; Linux/Windows remain unbound unless the user assigns a binding, in which case the assigned label appears.

Test Plan

  • [x] pnpm exec vitest run --config config/vitest.config.ts for QuickLaunchButton, tab-title-tooltip, EditorFileTab, EditorFileTabContextMenu, FloatingTerminalPanel — all pass
  • [x] pnpm run typecheck:web — exit 0
  • [x] pnpm exec oxlint <touched files> — exit 0
  • [x] Manual: set a concrete default agent, open the New Tab + menu, verify the chip appears only beside that agent row (see screenshots)

wolfiesch avatar Jun 22 '26 13:06 wolfiesch

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

Run ID: 8235a1ef-b060-4788-9f0b-af83544ec38d

📥 Commits

Reviewing files that changed from the base of the PR and between f691aeb584d6370d99d2476916c5572b9f3043ea and 8141bca97760a92e8ab2b47dfd6ec495c19bf9ac.

📒 Files selected for processing (4)
  • src/renderer/src/components/floating-terminal/FloatingTerminalPanel.test.tsx
  • src/renderer/src/components/floating-terminal/FloatingTerminalPanel.tsx
  • src/shared/keybindings.test.ts
  • src/shared/keybindings.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/shared/keybindings.test.ts
  • src/renderer/src/components/floating-terminal/FloatingTerminalPanel.tsx
  • src/renderer/src/components/floating-terminal/FloatingTerminalPanel.test.tsx

📝 Walkthrough

Walkthrough

This PR extends the floating workspace panel with keyboard shortcut support for maximize, minimize, tab rename, and digit-based visible-tab selection. It introduces two new keybinding actions (floatingWorkspace.maximize, floatingWorkspace.minimize), a one-shot timestamped intent mechanism so the panel can open directly into maximized state when triggered by the global shortcut, and a corresponding handler in App.tsx. FloatingTerminalPanel gains a floating-chrome shortcut matcher and action dispatcher for these new actions, alongside a visibleFloatingTabOrder filter for index-based tab switching. Separately, a new nullable useOptionalShortcutLabel hook drives conditional shortcut hints in tooltips and context menus across tab bar components including SortableTab, EditorFileTabCloseButton, SortableTabContextMenu, EditorFileTabContextMenu, TabBar, and QuickLaunchButton. English, Spanish, Japanese, Korean, and Chinese locales are updated with new "Close tab" translations.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately captures the main scope: floating workspace shortcuts and tab shortcut UI affordances are the core changes across multiple files.
Description check ✅ Passed The description covers all required template sections with substantial content: Summary explains the user-visible changes clearly, Screenshots are provided with before/after comparisons, Testing includes all required checks and test coverage, AI Review Report documents cross-platform considerations and fixes addressed, Security Audit and Notes sections are present with relevant details.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

coderabbitai[bot] avatar Jun 22 '26 14:06 coderabbitai[bot]

this is a great feature. will land it once you have it ready

AmethystLiang avatar Jun 22 '26 17:06 AmethystLiang

ty! I just marked it ready for review

wolfiesch avatar Jun 22 '26 22:06 wolfiesch

Addressed in 4a0ffbe07:

  • Fixed tooltip trigger a11y (back on focusable tab root + test asserts root)
  • Translated Close tab locales (es/ja/ko/zh)
  • Added rowMarkup guards
  • Updated title/body to full scope
  • Left terminal-first digit selection unchanged; CodeRabbit withdrew
  • No new actionable comments since ready (only docstring-coverage warning)

wolfiesch avatar Jun 22 '26 22:06 wolfiesch