Skip to content

Improve Quick Open matching, file locations and recent history - #25371

Merged
nwparker merged 22 commits into
mainfrom
nwparker/quick-open-discovery-history
Oct 6, 2026
Merged

nwparker merged 22 commits into
mainfrom
nwparker/quick-open-discovery-history

Conversation

@nwparker

@nwparker nwparker commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 41 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3488 $\color{#cf222e}{\Huge{\mathbf{−}}}$​260 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3228
Prod 65 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1977 $\color{#cf222e}{\Huge{\mathbf{−}}}$​403 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1574

ELI5

Part 3 of 3; stacks on #25370 after #25369.

Quick Open matches multi-part and separator queries, opens at the requested location, and ranks successfully opened recent files. Linked Explorer folders refresh when their in-project targets change.

What Changed

Uses one prepared/streamed matcher, preserves numeric-colon filenames, and records history after successful loading. Ordinary results appear before optional recent-file validation. Complete inventories avoid another scan; other validation waits 200 ms, cancels when the query changes and reuses settled eligibility.

Preserves existing punctuation queries and inherited ignore preferences on older hosts. Checks discovery version 2 separately from newer matching/candidate support, reports the actual delegated SSH capability, and avoids reusing an unfiltered inventory after discovery settings change.

Reuses bounded Explorer refresh and stale-cache handling for cached linked folders. Remote link expansion retains its historical behavior; Quick Open traversal has its own opt-in setting. Windows directory-link fixtures use junctions.

Why

Shared matching keeps host and client results consistent. Publishing search results first prevents history validation from delaying typing; host-owned cancellation prevents abandoned scans from queuing. Existing Explorer caches and refresh scheduling repair linked views without introducing another watcher or cache.

Linked Issue

Fixes #9895. Fixes #19853. Fixes #11366. Fixes #17356. Fixes #16423.

Visual Proof

The same .env api query previously returned no files; it now finds the API environment file. The before image uses the original matcher in the same fixture. Exact caret, successful-load history and discovery settings were separately asserted.

Before: no match

Before: no match

After: matching API file

After: matching API file

Testing

  • Automated regressions added and verified.
  • Hidden rendered-app and real host checks completed.

Combined-stack verification passed 88 suites (888 tests, one existing skip), full typecheck and changed-code quality checks. Seven hidden macOS Electron checks passed: linked-folder mutation/retargeting, four Markdown navigation flows, large paired-runtime search and Quick Open rendered results. Two hidden Linux Electron checks passed on the final head. Native Windows corrected discovery and compatibility/history suites passed eight files / 78 tests.

Real production SSH handlers/clients passed nine current/older version pairings, including punctuation queries, inherited ignore compatibility and a complete 23,000-file inventory. Independent measurements used 100 recent candidates: search p95 was 50.9 ms baseline / 52.5 ms with validation; with 100 ms added transport delay, 150.9 / 149.9 ms. New searches superseded validation in all 27 samples. These measure provider latency, not renderer paint.

Two hidden native Windows Electron checks also passed on final head e44c29d019e0: linked-folder refresh through retargeting and Quick Open rendered filename/path results.

All tests/apps used ORCA_BACKGROUND_LAUNCH=1. Fresh hosted CI on the rewritten heads is queued; merge remains gated on required checks.

Review

A fresh independent reviewer rated the final combined source e44c29d019e0 low risk, with no unresolved concrete blocker after adversarial review, compatibility repairs, real SSH latency checks and native WSL cleanup evidence. Their focused stable-source rerun passed 20 suites / 155 tests. Counts above overlap and are not summed.

The final production TypeScript is 58 net lines smaller than the previous candidate; additional tests preserve the behavior that the simplification must keep.

Agent skill upstream boundary

  • Not applicable.

Notes

Older hosts retain their existing query behavior or a truthfully truncated compatibility page. New opt-in traversal and recent validation require their respective capabilities. The local dialog inventory remains a snapshot until reopening. Explorer links outside the project remain denied. The nine-pairing harness uses production handlers and framing with test routing; it is not every installed-runtime upgrade combination.

Checklist

  • User-facing before/after, mechanism and approach explained
  • Existing before/after visual proof preserved
  • Independent correctness, ownership and performance review
  • Cross-platform, folder, SSH and mixed-version behavior checked
  • Local typecheck, affected tests, fresh app/CLI build and changed-code gates
  • Fresh required hosted CI complete

@pullfrog pullfrog Bot left a comment

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.

Important

The new separator matching has a trailing-separator false positive that contradicts this PR's own test contract, and the version-probe change silently downgrades query search for SSH relays that still report version 1.

Reviewed changes

  • Shared multi-term matcher — query terms now AND-match across whitespace, -/_/space are equivalent, and camelCase/acronym boundaries bridge a typed separator; QUICK_OPEN_SEARCH_VERSION is now 3.
  • Location-aware opening — trailing :line[:col] parsing that preserves literal colon filenames, plus authorized pasted absolute/Windows/UNC/WSL paths resolved on the owning host.
  • Recent-file history — per-owner/workspace localStorage history (100 files, 64 scopes) ranked ahead of ordinary results and validated by one bounded candidate scan on the host.
  • Listing-option plumbing — includeIgnored/followSymlinks/candidatePaths threaded through local IPC, relay, SSH provider, and paired runtime, with a new followSymlinkedDirectories setting.
  • Selection revocation — generation guards cancel a pending open on dismissal/reopen, owner, root, or workspace change.

ℹ️ An SSH relay reporting quickOpenSearchVersion: 1 now loses relay-side query search

probeSshQuickOpenSearchCapability moved from === 1 to >= QUICK_OPEN_SEARCH_VERSION (now 3). Every relay deployed before this build advertises version 1, so until it is redeployed a query is no longer sent to the relay and is instead ranked client-side over a 32/33-path cap — matches outside those paths become unreachable. The paired-runtime surface added a complete-inventory fallback for the same version-1 case; the SSH surface did not, and no test covers it.

Technical details
# SSH version-1 peer query search downgraded

## Affected sites
- `src/main/providers/ssh-filesystem-provider-capabilities.ts:54-56` — predicate changed `=== 1` to `>= QUICK_OPEN_SEARCH_VERSION` (3).
- `src/main/ipc/filesystem/filesystem-search-handlers.ts:55-74` — a v1 relay now enters the legacy branch (`QUICK_OPEN_SSH_LEGACY_RESULT_LIMIT` = 33) and ranks client-side instead of forwarding `searchQuery`.
- `src/main/runtime/runtime-file-commands-search-remote-quick-open-file-paths.ts:25-45` — same, via `QUICK_OPEN_LEGACY_REMOTE_RESULT_LIMIT` = 32.
- `src/shared/quick-open-path-search.ts:8` — `QUICK_OPEN_SEARCH_VERSION = 3`.

## Required outcome
- Confirm whether a version-1 relay is expected to fall back to the 32/33-path cap for ordinary query search, or whether the intended behavior is to keep relay-side query search for peers that already advertised the query-aware path (bumping the version only for the new `candidatePaths`/`includeIgnored`/`followSymlinks` semantics).
- If the downgrade is intended, the 32/33 cap (vs. the complete-inventory fallback used on the paired-runtime path) should be covered by a test so the asymmetry is deliberate.

## Open questions for the human
- Are v1 relays a real support target, or do they always get redeployed on the next reconnect (narrowing the window to a single connection)?

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

Comment thread src/shared/quick-open-path-search.ts Resolved
@nwparker
nwparker force-pushed the nwparker/quick-open-discovery-history branch from ebbd972 to 57f935f Compare October 5, 2026 04:18
@nwparker
nwparker force-pushed the nwparker/file-search-cancellation branch from 13a87ff to c05f4e1 Compare October 5, 2026 04:18

@pullfrog pullfrog Bot left a comment

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.

✅ No new issues found.

Reviewed changes

  • Trailing-separator false positive removed — dropped the ti === -1 && qi === query.length - 1 disjunct from fuzzyMatchIndexedFile and the corresponding fallback from matchQuickOpenSeparatorAlternatives; abc-→abc.ts, bar-→foo-bar.ts, and product_→productdetail.ts now assert no match, while real boundaries (abc-→abc-file.ts, product_→ProductDetail.ts, http-→HTTPServer.ts) still match.
  • SSH v1 relay query search restored — probeSshQuickOpenSearchCapability now accepts a minimumVersion; the search handler passes 1 for a plain query, 2 for listing options, and 3 for candidatePaths, so a v1 relay keeps relay-side query search instead of silently falling back to the 32/33-path cap. Covered across versions 1–4.
  • Recent-candidate validation reworked — a shared, cancellable EligibleRecentRequest replaces the previous ref-of-result cache: load/dispose, a useQuickOpenRecentCache effect keyed on enabled + eligibility, and waitForQuickOpenRecentValidation gating the main listing so a pending validation precedes the latest host query. Results fail open on error and drop deleted candidates from the ordinary listing.
  • Fresh legacy snapshot for recents — refreshSettled forces a new files.list when validating candidates, closing the reopened-palette gap where an inventory-cached deleted file could be offered.
  • Relay candidate dispatch — candidatePaths validation and normalization moved into relay fs.listFiles (they were on search); new dispatch unit + integration tests cover late candidates beyond the capped inventory and ignore policy.
  • SFTP abort threading — abort signals now reach SFTP readdir and the symlink stat, with a regression proving a cancelled silent stat closes its directory handle; dead readDirViaSftp removed.
  • Literal-suffix selection — openQuickOpenFile keeps a literal name:line filename as selected when a partial query matches that suffix, so it does not jump to a line in a differently-named file.

I traced the recent-validation cache/pending/cancel lifecycle against workspace/owner/root/query changes and found no stale-apply, leaked scan, or candidate-membership defect.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@nwparker
nwparker force-pushed the nwparker/quick-open-discovery-history branch from 57f935f to da285f1 Compare October 5, 2026 04:41
@nwparker
nwparker force-pushed the nwparker/file-search-cancellation branch from c05f4e1 to 252a6df Compare October 5, 2026 04:41

@pullfrog pullfrog Bot left a comment

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.

✅ No new issues found.

Reviewed changes

Since the prior pullfrog review at 57f935f, the branch was rebased onto the current base (a pure rebase — a6cbd0e ≡ ea1797b, 1297c7d ≡ 57f935f, 46857fd ≡ c86e405, all with identical diffs) and gained two commits:

  • Localized Quick Open eligibility errors — mergeQuickOpenRecentCandidates now builds its failure message with translate('quickOpen.recentValidationFailed', …) while still interpolating the backend error, with the new en.json entry added.
  • Localized the symlink settings search aliases — the four followSymlinkedDirectories keywords are now produced by translateSearchKeyword, retaining the English aliases while indexing localized variants, plus en.json entries and an en/ko regression test.
  • Render-phase test callback removed — the Quick Open file-list test harness records each render into a states array instead of invoking an onState callback during render (test-only).

Both prior quick-open-path-search.ts review threads are resolved, and nothing in the delta re-opens them. I traced the localized string to its only consumer (QuickOpen.tsx renders recentError verbatim; nothing parses it), so localizing the wrapper is safe.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@nwparker
nwparker force-pushed the nwparker/file-search-cancellation branch from 252a6df to d36f171 Compare October 5, 2026 05:48
@nwparker
nwparker force-pushed the nwparker/quick-open-discovery-history branch from da285f1 to b17cb28 Compare October 5, 2026 05:48

@pullfrog pullfrog Bot left a comment

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.

✅ No new issues found.

Reviewed changes

Since the prior pullfrog review at da285f1193, the branch gained exactly one commit — b17cb28b ("Validate file inventory with bundled search and runtime preferences"), a test-only CI repair with no production behavior change:

  • Real-process relay tests configured with the bundled search executable — filesystem-quick-open-options.integration.test.ts now sets configureRelayBundledRipgrep(bundledRipgrepCommand()) in beforeEach and resets it to undefined in afterEach.
  • Runtime symlink-override regression — a new it.each in orca-runtime-files-mobile-explorer-reads.test.ts asserts options.followSymlinks wins over store.getSettings().followSymlinkedDirectories, matching the production expression options.followSymlinks ?? store.getSettings().followSymlinkedDirectories ?? false.
  • Test harness default settings — orca-runtime-files-test-harness.ts adds a getSettings mock returning { followSymlinkedDirectories: false }.
  • Worktree-selector expectations updated — both readDir assertions in worktree-selector-resolution.spec.ts now include the empty options object {} threaded through by the listing-option change.

The delta is confined to test files and fixtures; the new regression can fail (it would fail if the override were ignored), and the production override precedence it pins was previously reviewed. No new concerns.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@nwparker
nwparker force-pushed the nwparker/file-search-cancellation branch from d36f171 to 94ae722 Compare October 5, 2026 08:02
@nwparker
nwparker force-pushed the nwparker/quick-open-discovery-history branch 2 times, most recently from 119ed89 to 4836c82 Compare October 5, 2026 09:01
@nwparker
nwparker force-pushed the nwparker/file-search-cancellation branch 2 times, most recently from fad7480 to e639b82 Compare October 6, 2026 04:06
@nwparker
nwparker force-pushed the nwparker/quick-open-discovery-history branch 2 times, most recently from 4152e3b to e44c29d Compare October 6, 2026 04:12
@nwparker
nwparker force-pushed the nwparker/file-search-cancellation branch from e639b82 to a6d5c5d Compare October 6, 2026 04:12
@nwparker
nwparker force-pushed the nwparker/quick-open-discovery-history branch from e44c29d to 5e9c48c Compare October 6, 2026 04:48
@nwparker
nwparker changed the base branch from nwparker/file-search-cancellation to main October 6, 2026 04:48
@nwparker
nwparker force-pushed the nwparker/quick-open-discovery-history branch from 5e9c48c to d7ea3b9 Compare October 6, 2026 04:52
@coderabbitai

coderabbitai Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

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

Labels

None yet

Projects

None yet

1 participant