Skip to content

feat(shortcuts): add configurable shortcut to show Files sidebar#884

Open
roberto-fernandino wants to merge 8 commits into
crynta:mainfrom
roberto-fernandino:feat/files-sidebar-shortcut
Open

feat(shortcuts): add configurable shortcut to show Files sidebar#884
roberto-fernandino wants to merge 8 commits into
crynta:mainfrom
roberto-fernandino:feat/files-sidebar-shortcut

Conversation

@roberto-fernandino

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

Copy link
Copy Markdown
Contributor

Summary

  • Adds a new keyboard shortcut ⌘⇧G (Cmd+Shift+G, configurable) that switches the sidebar to the Files/explorer view
  • Pairs naturally with ⌘G (source control) so you can toggle between them without touching the mouse
  • Exposed as "Show Files sidebar" in the command palette
  • Fully customizable in Settings → Shortcuts like all other shortcuts

Motivation

After pressing ⌘G to open Source Control, there was no keyboard shortcut to switch back to the Files sidebar — users were forced to click with the mouse.

How it works

Uses cycleSidebarView("explorer") — the same pattern pane.source uses for source-control:

  • If sidebar is collapsed → expands it and shows Files
  • If sidebar already shows Files → collapses it
  • If sidebar shows Source Control → switches to Files

Three files changed:

  • src/modules/shortcuts/shortcuts.ts — adds "sidebar.files" shortcut id + entry
  • src/modules/command-palette/commands.ts — adds context field + command palette item
  • src/app/App.tsx — wires up the handler

Test plan

  • Open source control with ⌘G, then press ⌘⇧G — should switch back to Files
  • Press ⌘⇧G when sidebar is collapsed — should expand and show Files
  • Open command palette and search "Show Files" — should appear and work
  • Go to Settings → Shortcuts and verify "Show Files sidebar" is listed and rebindable

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added keyboard shortcuts for toggling the AI mini window and opening the files explorer.
    • Updated the command palette to include a Terminals group and a command to toggle the files explorer.
  • Bug Fixes
    • Shortcut-based tab selection is now correctly scoped to the active space, selecting the intended tab.
    • Improved AI chat mini toggle behavior and tooltip messaging.
  • Tests
    • Added coverage for space-scoped tab selection.
  • Chores
    • Updated the project’s package manager version.

Roberto and others added 7 commits June 26, 2026 13:07
feat(tabs): select tabs by index within active space
…dow-shortcut

feat(shortcuts): add ai toggle mini shortcut
…nd-palette

feat: terminals in command-palette
Adds a new keyboard shortcut (Cmd+Shift+G by default) that switches the
sidebar to the Files/explorer view. Pairs naturally with Cmd+G (source
control) so the user can toggle between them without touching the mouse.

The shortcut uses cycleSidebarView("explorer") — same pattern as pane.source
uses for source-control — and is fully configurable in Settings > Shortcuts.
Also exposed as "Show Files sidebar" in the command palette.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 27, 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: 2933cb5d-0f40-4023-b2be-7b07caa71c38

📥 Commits

Reviewing files that changed from the base of the PR and between 81e752f and 188f7a7.

📒 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 PR bumps the pnpm packageManager version and updates space-scoped tab selection, AI and explorer shortcut wiring, and terminal-tab command-palette items.

Changes

Navigation and command palette controls

Layer / File(s) Summary
Space-scoped tab selection
src/modules/tabs/lib/useTabs.ts, src/modules/tabs/lib/pickTabBySpaceIndex.test.ts, src/app/App.tsx
selectByIndex now accepts an optional spaceId, the tab helper filters by space before indexing, and the app shortcut passes the active space into tab selection; tests cover per-space indexing.
AI and explorer controls
src/modules/shortcuts/shortcuts.ts, src/modules/command-palette/commands.ts, src/modules/ai/components/AiStatusBarControls.tsx, src/app/App.tsx
Shortcut IDs and command-palette context add ai.toggleMini and sidebar.files; App wires the mini chat toggle, explorer cycling, and the new command-palette explorer action, and the AI status-bar button changes its title and disabled state.
Terminal tab commands
src/modules/command-palette/commands.ts, src/app/App.tsx
The command palette adds a Terminals group, accepts terminal tabs and switchTab, and generates tab-switching items that activate by id.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows Conventional Commits and accurately summarizes the new Files sidebar shortcut feature.
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` is missing
`activeSpaceId`, so the `"tab.selectByIndex"` handler can keep using a stale
space after switching spaces. Update the dependency list for the
`shortcutHandlers` memo (and any related memoized shortcut setup around the same
block) to include `activeSpaceId`, so `selectByIndex` always resolves against
the current space. Verify the Cmd+1..9 path uses the latest `activeSpaceId`
rather than a previously captured value.

In `@src/modules/ai/components/AiStatusBarControls.tsx`:
- Around line 173-174: The mini-chat status bar control in
AiStatusBarControls.tsx is only opening the window because its onClick handler
always points to openMini, even though the title now reflects an open/close
toggle. Update the click behavior in the status bar button so it actually
toggles the mini chat state by calling the appropriate open/close handler based
on miniOpen, and keep the title in sync with that same state logic.
🪄 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: ed812ecc-d7ec-4486-977e-8aaecf0bcf30

📥 Commits

Reviewing files that changed from the base of the PR and between bba1b5f and 81e752f.

📒 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