Skip to content

Add Tab completion to Add Project path picker#2552

Open
aShanki wants to merge 1 commit intopingdotgg:mainfrom
aShanki:ashank/add-project-tab-completion
Open

Add Tab completion to Add Project path picker#2552
aShanki wants to merge 1 commit intopingdotgg:mainfrom
aShanki:ashank/add-project-tab-completion

Conversation

@aShanki
Copy link
Copy Markdown

@aShanki aShanki commented May 6, 2026

What changed

  • Adds Tab completion in the Add Project filesystem browse input.
  • Extracts the completion decision into resolveBrowseTabCompletion.
  • Adds unit coverage for single-match, common-prefix, and highlighted-entry completion.
  • Adds a browser scenario for typing a path and completing nested directories with Tab.
  • Fixes the Windows desktop dev/build wrapper by not launching process.execPath through shell mode, which broke on C:\Program Files\....

Fixes #2160.

Why

The Add Project path picker already provides directory suggestions, but pressing Tab moved focus out of the input. This makes keyboard-only path entry awkward compared with normal shell completion.

With this change, users can type paths like:

  • ~/Dev + Tab -> ~/Development/
  • ~/Development/co + Tab -> ~/Development/codex/

Validation

  • bun fmt
  • bun lint
  • bun typecheck
  • bun run build
  • bun run test src/components/CommandPalette.logic.test.ts
  • Manually verified in the desktop app on Windows

Note

Medium Risk
Moderate risk: changes keyboard handling in the command palette browse input and alters the server build CLI process spawning on Windows, which could affect navigation or build behavior across platforms.

Overview
Adds Tab completion to the command-palette “Add project → Local folder” path picker so Tab no longer shifts focus and instead completes the currently typed directory path.

Completion logic is factored into resolveBrowseTabCompletion (single match/selected entry enters the directory; multiple matches extend to a common prefix), with new unit tests and a browser scenario test covering nested completion. Separately removes Windows shell spawning for the server build CLI bundle step to avoid failures under paths like C:\\Program Files\\....

Reviewed by Cursor Bugbot for commit 31ad61b. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add Tab completion to the command palette path picker when adding a project

  • Pressing Tab while browsing for a local folder in the command palette now autocompletes the current path based on the highlighted entry, an exact match, or the common prefix of filtered results.
  • Logic is implemented in a new resolveBrowseTabCompletion function in CommandPalette.logic.ts, which returns a typed BrowseTabCompletion action (enterDirectory or replaceLeaf) consumed by CommandPalette.tsx.
  • Unit tests cover single-match, common-prefix, and highlighted-entry scenarios; a browser integration test verifies end-to-end Tab completion against stubbed filesystemBrowse responses.

Macroscope summarized 31ad61b.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

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

Run ID: f79d221d-7bb7-4f30-9246-f0330166ed4f

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels May 6, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 31ad61b. Configure here.

}

const firstEntry = input.filteredEntries[0];
return firstEntry ? { _tag: "enterDirectory", name: firstEntry.name } : null;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ambiguous Tab picks first directory

Medium Severity

resolveBrowseTabCompletion enters the first filtered directory when multiple matches have no longer common prefix and nothing is highlighted. In browse mode no item is auto-highlighted, so an ambiguous Tab can replace the user's path with an arbitrary directory instead of leaving it unchanged.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 31ad61b. Configure here.


function completeBrowsePathFromTab(): boolean {
if (!isBrowsing || relativePathNeedsActiveProject || isBrowsePending) {
return false;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pending Tab still blurs input

Medium Severity

completeBrowsePathFromTab returns false while browse results are loading, so handleKeyDown allows the browser’s default Tab behavior. On slower filesystem browse requests, pressing Tab after typing a path can move focus out of the input instead of keeping the path picker ready for completion.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 31ad61b. Configure here.

function handleKeyDown(event: KeyboardEvent<HTMLInputElement>): void {
if (event.key === "Tab" && completeBrowsePathFromTab()) {
event.preventDefault();
return;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shift Tab triggers completion

Low Severity

handleKeyDown treats Shift+Tab the same as plain Tab. When a completion is available, reverse tabbing mutates the browse path instead of moving focus backward, which breaks expected keyboard navigation in the dialog.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 31ad61b. Configure here.

@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented May 6, 2026

Approvability

Verdict: Needs human review

New feature adding Tab completion to the path picker with 3 unresolved review comments identifying bugs (ambiguous Tab behavior, pending state handling, Shift+Tab issue). These substantive issues warrant human review before merging.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: [KBD shortcut] Tab in add new project modal feels misaligned

1 participant