Skip to content

feat: add top-bar file search with Cmd+P quick open#7

Merged
astyfx merged 1 commit intomainfrom
feat/paul/search
Mar 25, 2026
Merged

feat: add top-bar file search with Cmd+P quick open#7
astyfx merged 1 commit intomainfrom
feat/paul/search

Conversation

@paul-seo73
Copy link
Copy Markdown
Contributor

Summary

  • Add always-visible file search bar in the top bar center, replacing the old search icon button
  • Fuzzy file search with subsequence matching, token scoring, and ranked results
  • Cmd/Ctrl+P shortcut focuses the search input from anywhere, including inside editors
  • Remove unnecessary focusToken prop-drilling pattern in favor of direct DOM focus via data-file-search-input
  • Open editors section and workspace files section with active/open badges
  • Keyboard shortcut registered in the shortcuts drawer

Test plan

  • bun test passes (312 pass, 0 fail)
  • Verify Cmd+P opens and focuses the search bar from chat input, editor, and other contexts
  • Verify typing a query filters files with fuzzy matching
  • Verify selecting a file opens it in the editor
  • Verify Escape clears query first, then closes dropdown on second press
  • Verify clicking outside the dropdown closes it

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings March 25, 2026 02:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a VS Code–style “Quick Open” file search to the top bar, backed by new fuzzy-ranking utilities and a global Cmd/Ctrl+P shortcut that focuses the search input.

Changes:

  • Introduces TopBarFileSearch UI with open/workspace sections and ranked fuzzy matching results.
  • Adds file search scoring/ranking utilities + unit tests.
  • Registers Cmd/Ctrl+P global keybinding and documents the shortcut in the shortcuts drawer + docs/README.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/file-search-utils.test.ts Adds unit tests covering path splitting and ranking behavior.
src/components/ui/index.ts Re-exports InputGroup* components for shared UI use.
src/components/layout/file-search-utils.ts Implements scoring + ranking for fuzzy file search results.
src/components/layout/TopBarUtilityActions.tsx Removes the old search icon button (replaced by always-visible search).
src/components/layout/TopBarFileSearch.tsx Adds the new top-bar quick-open search UI and dropdown behavior.
src/components/layout/TopBar.tsx Centers the new search input in the top bar layout.
src/components/layout/KeyboardShortcutsDrawer.tsx Adds “Quick open file” shortcut entry and updates footer text.
src/components/layout/AppShell.tsx Adds global Cmd/Ctrl+P handler that focuses/selects the search input.
docs/ui/project-workspace-task-shell.md Documents the new always-visible quick-open search + shortcut.
README.md Mentions the new quick-open behavior in the feature list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +137 to +145
export function rankFileSearchResults(args: { files: string[]; query: string; limit?: number }) {
const normalizedQuery = args.query.trim().toLowerCase();
const results: RankedFileSearchResult[] = [];

for (const filePath of args.files) {
const score = getFileSearchScore({ filePath, query: normalizedQuery });
if (score === null) {
continue;
}
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

rankFileSearchResults still computes a score for every file and sorts the full result set even when limit is provided. For large workspaces this can cause noticeable input lag on each keystroke. Consider using limit to keep only the top N results during the scan (e.g., min-heap/partial selection) and only sort those, or short-circuit when the query is empty and you only need alphabetical browsing.

Copilot uses AI. Check for mistakes.
- The left project list is full-height and reaches the top edge of the app shell.
- The top bar now applies only to the main work area, not the left project list.
- The top bar shows the selected workspace path for the current workspace.
- The top bar exposes an always-visible quick-open file search input, and `Cmd/Ctrl+P` focuses it from anywhere outside text inputs.
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

This doc says Cmd/Ctrl+P focuses the quick-open input from anywhere outside text inputs, but the new Cmd/Ctrl+P handler in AppShell currently runs even when an input/textarea is focused. Please align the documentation with the implemented behavior (or update the shortcut handler if the intent is to ignore text inputs).

Suggested change
- The top bar exposes an always-visible quick-open file search input, and `Cmd/Ctrl+P` focuses it from anywhere outside text inputs.
- The top bar exposes an always-visible quick-open file search input, and `Cmd/Ctrl+P` focuses it from anywhere in the app.

Copilot uses AI. Check for mistakes.
<DrawerFooter className="border-t border-border/70 px-5 py-4 md:flex-row md:items-center md:justify-between md:px-6">
<p className="text-sm text-muted-foreground">
Task quick jump works on the active task list, and the guide shortcut is ignored while typing in inputs.
Task quick jump works on the active task list, and the quick open / guide shortcuts are ignored while typing in inputs.
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

The footer states that the “quick open” shortcut is ignored while typing in inputs, but the Cmd/Ctrl+P handler added in AppShell fires regardless of isEditableShortcutTarget(...) (unlike the Cmd+/ guide shortcut). Please update this copy to reflect actual behavior, or adjust the shortcut handler if it should be ignored in inputs.

Suggested change
Task quick jump works on the active task list, and the quick open / guide shortcuts are ignored while typing in inputs.
Task quick jump works on the active task list, and the guide shortcut is ignored while typing in inputs.

Copilot uses AI. Check for mistakes.
@astyfx astyfx merged commit 8f8f992 into main Mar 25, 2026
6 checks passed
@astyfx astyfx deleted the feat/paul/search branch March 25, 2026 06:00
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.

3 participants