Skip to content

Feat/terminals in command palette#883

Open
roberto-fernandino wants to merge 6 commits into
crynta:mainfrom
roberto-fernandino:feat/terminals-in-command-palette
Open

Feat/terminals in command palette#883
roberto-fernandino wants to merge 6 commits into
crynta:mainfrom
roberto-fernandino:feat/terminals-in-command-palette

Conversation

@roberto-fernandino

@roberto-fernandino roberto-fernandino commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

What

Adds a Terminals section to the command palette (Cmd+P) that lists all open terminal tabs in the current space by name, letting you switch to any terminal instantly without touching the mouse.

Why

The command palette already lets you switch spaces, open new tabs, and run commands — but there was no way to navigate to a specific open terminal tab by name. Power users with many terminals open had to click through the tab bar instead of staying keyboard-driven.

How

  • Added "Terminals" as a new group in COMMAND_GROUPS (between Spaces and Tabs)
  • Extended CommandPaletteActionContext with terminalTabs and switchTab
  • In createCommandItems, spread dynamic palette entries for each terminal tab in the active space — using customTitle ?? title as the display name and TerminalIcon as the icon; the currently active tab renders as disabled with a "Current tab" badge
  • In App.tsx, passed terminalTabs (filtered to kind === "terminal" in the current space) and switchTab: (id) => setActiveId(id) into the palette context

Testing

  • pnpm exec tsc --noEmit clean
  • Opened Cmd+P with multiple terminal tabs open — Terminals section appeared between Spaces and Tabs
  • Clicked a terminal entry — focus switched to that tab
  • Active terminal showed "Current tab" and was unclickable
  • Typing a partial tab name (e.g. cwd folder) filtered results correctly
  • Terminals section is empty / absent when no terminal tabs exist in the current space
  • Switching spaces updates the Terminals list to reflect the new space's tabs
  • (If UI) tested in pnpm tauri dev
  • Platforms tested: macOS

Screenshots / GIFs

Notes for reviewer

Only terminal tabs (kind === "terminal") in the active space are shown — cross-space terminals are intentionally excluded since switching to one would require a space switch first. If we later want cross-space terminal navigation, we can extend switchTab to also call switchSpace.

Summary by CodeRabbit

  • New Features

    • Added a keyboard shortcut to toggle the mini AI chat window.
    • Enhanced the command palette with actions to switch between terminal tabs.
    • Improved tab selection so index-based shortcuts can target tabs within the current space.
  • Bug Fixes

    • Updated the mini AI toggle control to show clearer open/close states and remain usable when already open.
    • Ensured tab selection by index remains consistent when a space is specified.
  • Chores

    • Updated the app’s pinned package manager version.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1d9dd489-f2e9-4395-8a60-9fdbac6296d0

📥 Commits

Reviewing files that changed from the base of the PR and between 2b644ff and 1cbc120.

📒 Files selected for processing (2)
  • src/app/App.tsx
  • src/modules/shortcuts/shortcuts.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/modules/shortcuts/shortcuts.ts
  • src/app/App.tsx

📝 Walkthrough

Walkthrough

The app adds a new ai.toggleMini shortcut and status-bar toggle text, introduces terminal-tab switch commands in the command palette, and makes tab index selection space-aware. packageManager is updated to pnpm 11.9.0.

Changes

Navigation and AI controls

Layer / File(s) Summary
Space-scoped tab selection
src/app/App.tsx, src/modules/tabs/lib/useTabs.ts, src/modules/tabs/lib/pickTabBySpaceIndex.test.ts
useTabs adds space-aware tab lookup, selectByIndex accepts an optional space id, and the app’s tab shortcut passes the active space id.
Terminal command entries
src/modules/command-palette/commands.ts, src/app/App.tsx
The command palette gets a Terminals group and per-terminal switch commands, and the app passes terminal tab data plus a switchTab callback into createCommandItems.
Mini AI toggle shortcut
src/modules/shortcuts/shortcuts.ts, src/app/App.tsx, src/modules/ai/components/AiStatusBarControls.tsx
A new ai.toggleMini shortcut is registered, App.tsx routes it to toggleMini or the models settings window, and the status-bar toggle button text changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title is related, but it does not follow Conventional Commits format required for the squash commit message. Rename it to a conventional commit like feat: add terminals to command palette.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.

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 coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/app/App.tsx`:
- Around line 643-647: The shortcutHandlers memo in App.tsx closes over
activeSpaceId inside tab.selectByIndex, but activeSpaceId is missing from the
dependency list, so Cmd/Ctrl+1..9 can keep using a stale space after switching.
Update the useMemo dependencies that build shortcutHandlers to include
activeSpaceId, and verify the handler map is rebuilt whenever the active space
changes to keep tab selection scoped correctly.

In `@src/modules/ai/components/AiStatusBarControls.tsx`:
- Around line 173-174: The mini-window control in AiStatusBarControls should
actually toggle state instead of always opening. Update the button wiring so the
click handler matches the dynamic title from miniOpen, using the same toggle
behavior as the ai.toggleMini shortcut in App, and ensure the handler switches
between open and close actions rather than calling openMini unconditionally.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 25938cc4-ec19-4168-9602-0a32434e828b

📥 Commits

Reviewing files that changed from the base of the PR and between bba1b5f and 2b644ff.

📒 Files selected for processing (7)
  • package.json
  • src/app/App.tsx
  • src/modules/ai/components/AiStatusBarControls.tsx
  • src/modules/command-palette/commands.ts
  • src/modules/shortcuts/shortcuts.ts
  • src/modules/tabs/lib/pickTabBySpaceIndex.test.ts
  • src/modules/tabs/lib/useTabs.ts

Comment thread src/app/App.tsx
Comment thread src/modules/ai/components/AiStatusBarControls.tsx
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.

1 participant