Skip to content
Source
Sign inSign up
pingdotgg/t3code

Add project file picker #3985

Closedjakeleventhal(GitHub profile, opens in a new tab)wants to merge 9 commits intomain fromrefs/pull/3985/headopened View on GitHub

Summary

Screenshot 2026-07-15 at 12 29 32 AM Screenshot 2026-07-15 at 12 29 35 AM
  • add a centered project file picker opened with Cmd/Ctrl+P
  • use the server-backed workspace index for full-project fuzzy search, including ordered skipped-character matches
  • highlight matched characters in file names and paths
  • open selected files through the same scoped right-panel action used by the Files sidebar
  • register and document the configurable filePicker.toggle keybinding

Implementation

The picker reuses the existing command palette primitives and workspace search endpoint. Server result ordering is preserved, while the client matcher is intentionally limited to a linear pass that computes highlight positions and filters non-file entries.

Validation

  • pnpm exec vp test apps/web/src/components/files/ProjectFilePicker.logic.test.ts apps/web/src/components/CommandPalette.logic.test.ts apps/web/src/keybindings.test.ts packages/contracts/src/keybindings.test.ts apps/server/src/keybindings.test.ts (81 tests)
  • pnpm exec vp check
  • pnpm exec vp run typecheck
  • independent branch review found no actionable findings or publication blockers

Note

Add project file picker triggered by mod+p keybinding

  • Adds a new ProjectFilePicker component that lets users search and open project files via a fuzzy-matched dialog with highlighted results.
  • mod+p opens the file picker; mod+k opens the command palette. Both are managed by a new reduceCommandPaletteUiState reducer in CommandPalette.logic.ts with command and files modes.
  • Client-side fuzzy matching and result highlighting are handled by ProjectFilePicker.logic.ts; server-side search is extended with an optional kind filter (file | directory) to constrain results.
  • useProjectPathSearch generalizes the existing composer path search hook to support variable limits and kind filtering; useComposerPathSearch delegates to it unchanged.
  • filePicker.toggle is added to STATIC_KEYBINDING_COMMANDS and documented in keybindings.md.
📊 Macroscope summarized 276a18d. 1 file reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted

🗂️ Filtered Issues

No issues evaluated.


Note

Medium Risk Touches workspace search/index behavior and a new global shortcut; removing OpenAddProjectCommandPaletteProvider from CommandPalette may break sidebar/draft “add project” unless the provider is wired elsewhere.

Overview Adds a project file picker opened with mod+p (filePicker.toggle), alongside the existing command palette on mod+k. The shared command dialog now tracks a command vs files mode and renders ProjectFilePicker in files mode, with UI state centralized in reduceCommandPaletteUiState.

ProjectFilePicker searches the active project workspace (index listing when the query is empty; debounced server search when not), applies client-side file-only fuzzy matching with highlighted name/path matches, and opens the selection via the same right-panel file action as the Files sidebar.

Server/API: project search accepts optional kind: 'file' | 'directory'; WorkspaceSearchIndex routes to fileSearch / directorySearch / mixedSearch so file-only queries are limited before truncation. Query normalization uses shared normalizeSearchQuery (including stripping leading @./).

useProjectPathSearch generalizes composer path search (configurable limit + kind); useComposerPathSearch delegates to it. Keybindings and docs register filePicker.toggle.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 276a18ddfe9f8fc170f2ba0b780db40bfdbf53c1. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 2893e19d-6398-43e5-ad95-1ff1e6b31cbc

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      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.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs human review

      1 blocking correctness issue found. This PR introduces a new file picker feature with new UI components and keybindings. Additionally, unresolved review comments identify a critical bug: removing OpenAddProjectCommandPaletteProvider will crash authenticated routes that depend on that context.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. 💡 Codex Review

      Here are some automated review suggestions for this pull request.

      Reviewed commit: 72f5b0e988

      ℹ️ About Codex in GitHub

      Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

      • Open a pull request for review
      • Mark a draft as ready
      • Comment "@codex review".

      If Codex has suggestions, it will comment; otherwise it will react with 👍.

      Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

    5. 💡 Codex Review

      Here are some automated review suggestions for this pull request.

      Reviewed commit: 0765a5faad

      ℹ️ About Codex in GitHub

      Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

      • Open a pull request for review
      • Mark a draft as ready
      • Comment "@codex review".

      If Codex has suggestions, it will comment; otherwise it will react with 👍.

      Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

      @@ -35,3 +35,4 @@
      3535 { key: "mod+-", command: "preview.zoomOut", when: "previewFocus" },
      3636 { key: "mod+0", command: "preview.resetZoom", when: "previewFocus" },
      3737 { key: "mod+k", command: "commandPalette.toggle", when: "!terminalFocus" },
      38+ { key: "mod+p", command: "filePicker.toggle", when: "!terminalFocus" },

      P2 Badge Preserve existing mod+p bindings

      When an existing keybindings config already uses mod+p globally (or with another broader when clause), startup still treats this new default as non-conflicting because the sync check only skips rules with the exact same shortcut and raw when string, then appends the missing default. Since resolveShortcutCommand scans later rules first, the appended filePicker.toggle rule will silently steal those users' mod+p shortcut outside terminal focus. Please avoid backfilling this default when an existing rule can overlap the same shortcut context, or choose an unassigned default.

      Useful? React with 👍 / 👎.

    6. @@ -399,15 +369,14 @@
      399369 terminalOpen,
      400370 },
      401371 });
      402- if (command !== "commandPalette.toggle") {
      403- return;
      404- }
      372+ if (command !== "commandPalette.toggle" && command !== "filePicker.toggle") return;
      405373 event.preventDefault();
      406374 event.stopPropagation();
      407- toggleOpen();
      375+ if (command === "filePicker.toggle") toggleFiles();
      376+ else toggleCommand();
      408377 };
      409378 window.addEventListener("keydown", onKeyDown);
      410379 return () => window.removeEventListener("keydown", onKeyDown);
      411- }, [keybindings, terminalOpen, toggleOpen]);
      380+ }, [keybindings, terminalOpen, toggleCommand, toggleFiles]);
      412381
      413382 return (
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🔴 Critical components/CommandPalette.tsx:382

      The CommandPalette component no longer renders OpenAddProjectCommandPaletteProvider, but its children (which include AppSidebarLayout and route Outlet) still consume the OpenAddProjectCommandPalette context via useOpenAddProjectCommandPalette(). That hook throws when the context value is absent, so authenticated app-shell routes crash during render instead of displaying the UI. Consider re-wrapping children in OpenAddProjectCommandPaletteProvider (passing openAddProject) before rendering CommandDialog.

      🤖 Copy this AI Prompt to have your agent fix this:
      In file @apps/web/src/components/CommandPalette.tsx around line 382:
      
      The `CommandPalette` component no longer renders `OpenAddProjectCommandPaletteProvider`, but its `children` (which include `AppSidebarLayout` and route `Outlet`) still consume the `OpenAddProjectCommandPalette` context via `useOpenAddProjectCommandPalette()`. That hook throws when the context value is absent, so authenticated app-shell routes crash during render instead of displaying the UI. Consider re-wrapping `children` in `OpenAddProjectCommandPaletteProvider` (passing `openAddProject`) before rendering `CommandDialog`.
    7. Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot).

      Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 276a18ddfe9f8fc170f2ba0b780db40bfdbf53c1. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -418,9 +383,12 @@
      418- <CommandPaletteDialog
      419- open={state.open}
      420- openIntent={state.openIntent}
      421- setOpen={setOpen}
      422- clearOpenIntent={clearOpenIntent}
      423- />
      424- </CommandDialog>
      425- </ComposerHandleContext>
      426- </OpenAddProjectCommandPaletteProvider>
      383+ <ComposerHandleContext value={composerHandleRef}>
      384+ <CommandDialog open={state.open} onOpenChange={setOpen}>
      385+ {children}
      386+ <CommandPaletteDialog
      387+ mode={state.mode}
      388+ open={state.open}
      389+ openIntent={state.openIntent}
      390+ setOpen={setOpen}
      391+ clearOpenIntent={clearOpenIntent}
      392+ />
      393+ </CommandDialog>
      394+ </ComposerHandleContext>

      Add-project provider removal crashes shell

      High Severity

      Removing OpenAddProjectCommandPaletteProvider causes useOpenAddProjectCommandPalette to access a null context. This leads to crashes in the authenticated app shell when components like Sidebar or DraftHeroHeadline mount, and breaks external 'Add project' entry points.

      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 276a18ddfe9f8fc170f2ba0b780db40bfdbf53c1. Configure [here](https://www.cursor.com/dashboard/bugbot).
    8. 💡 Codex Review

      Here are some automated review suggestions for this pull request.

      Reviewed commit: 276a18ddfe

      ℹ️ About Codex in GitHub

      Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

      • Open a pull request for review
      • Mark a draft as ready
      • Comment "@codex review".

      If Codex has suggestions, it will comment; otherwise it will react with 👍.

      Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

      @@ -409,18 +378,7 @@
      409378 window.addEventListener("keydown", onKeyDown);
      410379 return () => window.removeEventListener("keydown", onKeyDown);
      411- }, [keybindings, terminalOpen, toggleOpen]);
      380+ }, [keybindings, terminalOpen, toggleCommand, toggleFiles]);
      412381
      413382 return (
      414- <OpenAddProjectCommandPaletteProvider openAddProject={openAddProject}>
      415- <ComposerHandleContext value={composerHandleRef}>
      416- <CommandDialog open={state.open} onOpenChange={setOpen}>
      417- {children}
      418- <CommandPaletteDialog
      419- open={state.open}
      420- openIntent={state.openIntent}
      421- setOpen={setOpen}
      422- clearOpenIntent={clearOpenIntent}
      423- />
      424- </CommandDialog>
      425- </ComposerHandleContext>
      426- </OpenAddProjectCommandPaletteProvider>
      383+ <ComposerHandleContext value={composerHandleRef}>
      384+ <CommandDialog open={state.open} onOpenChange={setOpen}>

      P1 Badge Restore the add-project context provider

      Wrapping children directly in ComposerHandleContext removes the only OpenAddProjectCommandPaletteProvider, while Sidebar, DraftHeroHeadline, and NoProjectsHero still call useOpenAddProjectCommandPalette(). That hook now receives the context's null default and throws during normal authenticated app rendering, preventing the web shell from loading; retain the provider around this subtree or migrate all consumers in the same change. The required integrated web verification for this user-visible change should cover this render path.

      AGENTS.md reference: AGENTS.md:L10-L14

      Useful? React with 👍 / 👎.

Sign in to join this conversation.