Repository navigation
Tab opening ranking - #23435
Tab opening ranking#23435
Conversation
- Distinguish literal filename matches from fuzzy matches - Prioritize search for short tokens (1-2 Latin characters) - Sort literal matches naturally instead of by fuzzy score - Reserve search option even when literal matches fill results
There was a problem hiding this comment.
ℹ️ No critical issues. The ranking logic is coherent and thoroughly tested. One process gap and one consistency nit below.
Reviewed changes
- New
literal-basenamematch kind —findExistingFileMatchesnow adds case-insensitive contiguous basename substring matches (lowerFilename.includes(query)), ordered by naturalcompareFileNamesorder, between exact matches and fuzzy matches. - Skip fuzzy ranking when literal matches fill the window —
preferFilenamesgates the literal scan; if exact + literal already reaches the limit,rankQuickOpenFilesis never called (asserted by tests). - Classifier re-ranking —
exactExistingFilesis tightened toexact-path || exact-basename; the host-url / path-error / new-file-intent / whitespace branches now consume allexistingFiles; a new short-token branch (/^[\p{Script=Latin}\p{Nd}]{1,2}$/u) puts search ahead of files; the general branch reserves a search slot ahead of fuzzy matches. - Net behavior — web search is promoted above fuzzy path matches (e.g.
btnclassifies assearchon Enter), while literal/extended filename matches still lead search.
ℹ️ The user-facing before/after and rationale are missing
The PR description is the bare template: no ELI5, no before/after, no mechanism, no "why". This is a subjective ranking change — Enter on btn/abbreviations now runs a web search where it previously opened the top fuzzy file — and a reviewer has no stated intent to judge it against. The repository template requires a user-facing before/after (with screenshots or a video for behavior changes) and the reasoning over the alternatives considered.
Technical details
# Add the ranking rationale and before/after
## Affected sites
- PR #23435 body — `## ELI5`, `## What Changed`, `## Why`, `## Visual Proof`, `## Testing` are all empty.
- `src/renderer/src/components/tab-bar/tab-create-entry-classifier.ts:253-272` — the branches that move search ahead of files.
## Required outcome
- State the before/after as the user experiences it for at least: a literal filename match (`button`), a fuzzy abbreviation (`btn`), and a phrase (`release notes`).
- State why search-first for non-literal tokens is preferred over the previous fuzzy-first ordering, and which alternatives were rejected.
## Open questions for the human
- Is Enter-on-abbreviation intentionally now a search, or is the visible list ordering (search first, fuzzy below) meant to differ from the Enter default?ℹ️ Nitpicks
- The classifier normalizes text to NFC only to test the short-token regex (
tab-create-entry-classifier.ts:263), whilefindExistingFileMatchesandprepareQuickOpenFilecompare code units without normalization. An accented query therefore matches an NFD filename (common on macOS) as neither exact nor literal, even though the NFC call signals that normalization matters here. Not introduced by this PR, but the two now disagree and it's worth a deliberate decision.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 📝 WalkthroughWalkthroughThe file matcher now identifies literal filename-substring matches and combines them with exact and fuzzy matches. The classifier updates how it orders search, file, and new-file options. Tests cover result ordering, short queries, and submission while file listings are loading. Estimated code review effort Priority: ⬇️ Low Merge Risk: 🔵 Low · up to Some matching files are missing from tab-opening choices when another file matches exactly. Users can refine the query, but the missing choices should be restored. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Retain literal matches after an exact match. · tab-create-entry-classifier.ts:223-237
src/renderer/src/components/tab-bar/tab-create-entry-classifier.ts:223-237
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winRetain literal matches after an exact match.
When
existingFilescontains anexact-basenameresult and aliteral-basenameresult, this branch returns only the exact result plus search or host actions. The literal file is missing from the tab actions even whenactionLimithas spare slots, so the user cannot open it from the tab picker.Suggested fix
const exactExistingFiles = existingFiles.filter( (file) => file.matchKind === 'exact-path' || file.matchKind === 'exact-basename' ) + const literalExistingFiles = existingFiles.filter( + (file) => file.matchKind === 'literal-basename' + ) if (exactExistingFiles.length > 0) { const options: TabEntryActionClassification[] = [...exactExistingFiles] if (hostUrl?.kind === 'host-url') { options.push(hostUrl) } else if (!hostUrl && newFile) { options.push(search) } + options.push(...literalExistingFiles) return toOptions(options, actionLimit)
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: f4d0425f-8b86-4f94-991d-f1d0c4010e1d
📒 Files selected for processing (7)
src/renderer/src/components/tab-bar/TabBarCreateEntry.search.test.tsxsrc/renderer/src/components/tab-bar/tab-create-entry-classifier.test.tssrc/renderer/src/components/tab-bar/tab-create-entry-classifier.tssrc/renderer/src/components/tab-bar/tab-create-entry-file-matches.test.tssrc/renderer/src/components/tab-bar/tab-create-entry-file-matches.tssrc/renderer/src/components/tab-bar/tab-create-entry-history-placement.test.tssrc/renderer/src/components/tab-bar/tab-create-entry-search-ranking.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
|
@coderabbitai Fixing. Will be in the next commit |
|
Tip For best results, initiate chat on the files or code changes.
You are interacting with an AI system. |
Ensure literal-basename file matches appear in tab creation suggestions as fallback options when exact-basename matches exist, improving file discovery for users.

ELI5
What Changed
Why
Linked Issue
Fixes #
Visual Proof
Testing
AI Disclosure
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)