Skip to content

feat(desktop): add CMD+P quick open file command palette#1551

Merged
Kitenite merged 1 commit into
mainfrom
kitenite/cmd-p-fuzzy-search
Feb 17, 2026
Merged

feat(desktop): add CMD+P quick open file command palette#1551
Kitenite merged 1 commit into
mainfrom
kitenite/cmd-p-fuzzy-search

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Feb 17, 2026

Summary

  • Adds a VS Code-style CMD+P (Ctrl+Shift+P on Windows/Linux) command palette for fuzzy-searching and opening files in the current workspace worktree
  • Reuses existing useFileSearch hook (Fuse.js backend) and CommandDialog from @superset/ui
  • Selecting a file opens it via addFileViewerPane using relativePath, matching sidebar behavior

Test plan

  • Press CMD+P in a workspace — dialog opens
  • Type a filename — results appear with fuzzy matching and file icons
  • Arrow keys to navigate, Enter to select — file opens in a viewer pane
  • Escape to close — dialog closes, query resets
  • Press CMD+P again — dialog opens fresh (no stale query)
  • Verify Ctrl+Shift+P works on Linux/Windows

Summary by CodeRabbit

  • New Features
    • Introduced Command Palette for quickly searching and opening files within the workspace. Access it using Cmd+P (Mac) or Ctrl+P (Windows/Linux). Results display file icons and paths for easy identification.

Adds a VS Code-style CMD+P (Ctrl+Shift+P on Windows/Linux) command palette
for fuzzy-searching and opening files in the current workspace worktree.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 17, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR introduces a Command Palette feature enabling quick file search and navigation. It adds a new CommandPalette React component, a useCommandPalette hook managing state and integrating with file search and tabs store, binds the feature to a meta+p hotkey, and wires it into the workspace route.

Changes

Cohort / File(s) Summary
Command Palette Component & Hook
apps/desktop/src/renderer/screens/main/components/CommandPalette/CommandPalette.tsx, apps/desktop/src/renderer/screens/main/components/CommandPalette/useCommandPalette.ts, apps/desktop/src/renderer/screens/main/components/CommandPalette/index.ts
New CommandPalette React component rendering a search dialog with file results and file icon display. useCommandPalette hook manages open/query state, debounced file search, file selection (adding to tabs store), and toggle/close logic. Index exports both the component and hook.
Workspace Route Integration
apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/page.tsx
Integrates CommandPalette component and hook into the workspace page. Initializes palette with workspace context, binds QUICK_OPEN hotkey to toggle, and wires state and callbacks to the CommandPalette component.
Hotkeys Configuration
apps/desktop/src/shared/hotkeys.ts
Adds QUICK_OPEN hotkey definition (meta+p) with navigation category and quick-open file search description.

Sequence Diagram

sequenceDiagram
    actor User
    participant Hotkey as Hotkey System
    participant Hook as useCommandPalette
    participant Palette as CommandPalette UI
    participant FileSearch as FileSearch Hook
    participant TabsStore as Tabs Store
    
    User->>Hotkey: Press meta+p
    Hotkey->>Hook: toggle()
    Hook->>Palette: open = true
    
    User->>Palette: Type query
    Palette->>Hook: onQueryChange(query)
    Hook->>FileSearch: Search with query term
    FileSearch->>Hook: Return results
    Hook->>Palette: Update searchResults
    Palette->>Palette: Render file results
    
    User->>Palette: Select file
    Palette->>Hook: onSelectFile(relativePath)
    Hook->>TabsStore: Add viewer pane for file
    Hook->>Hook: Close palette (open = false)
    Hook->>Palette: open = false, query = ""
    Palette->>Palette: Close dialog
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested reviewers

  • CharlieHelps

Poem

🐰 whisker-twitch of glee
With meta and P, the palette takes flight,
Files leap to our paws in search-powered light!
Quick-open magic for dev-kind so fleet,
Another fine feature, the PR's complete! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kitenite/cmd-p-fuzzy-search

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 and usage tips.

@Kitenite Kitenite merged commit f4229c2 into main Feb 17, 2026
5 of 6 checks passed
@Kitenite Kitenite deleted the kitenite/cmd-p-fuzzy-search branch February 17, 2026 22:02
@github-actions
Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch
  • ⚠️ Electric Fly.io app
  • ⚠️ Streams Fly.io app

Thank you for your contribution! 🎉

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