Repository navigation
Improve cmd j ranking - #19005
Improve cmd j ranking#19005
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between 298571a and 2f2fda5af11aced9e494576e064338b08df05643. 📒 Files selected for processing (81)
🚧 Files skipped from review as they are similar to previous changes (60)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change introduces shared palette ranking, activity, and identity helpers. Search engines now return encoded host-qualified identities, secondary matches, alias matches, and activity ranks. Open-tab search supports field filtering and retained results during capping. Palette rows render additional matches for visual and assistive technology output. Activation paths validate worktree, unified-tab, and open-file ownership before state changes. Tests cover ranking, identity collisions, retention, rendering, activity, and activation behavior. Merge Risk: ⚪ Minimal · up to No concrete current-head correctness, security, data-integrity, or availability issue remains. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description includes the template headings but leaves the ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Review, Notes, and Checklist content incomplete. It does not explain the implementation, rationale, issue, validation steps, or visual impact. Resolution Complete the required sections. Add the ELI5 summary, detailed changes, rationale, linked issue number, visual proof or an exact N/A explanation, testing steps and platform coverage, review notes, applicable compatibility considerations, and checklist status. Full details: Docstring CoverageExplanation Docstring coverage is 7.07% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 99 functions across 50 files. (31 skipped: 31 over the file limit.) ✨ 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.
ℹ️ One minor cleanup — nothing blocking.
Reviewed changes
A large, careful rewrite of Cmd+J (and new-tab omnibox) ranking from a seven-key PaletteDocumentRank to a semantic-first scheme with activity bucketing, plus identity encoding to resolve cross-host collisions. Reviewed all 72 files (44 prod, 28 test) end to end.
- Semantic-first rank schema —
PaletteDocumentRankis nowdestination/recovery/wordMatch/coverage/strength/placement;match-document.tsbuilds per-token candidates with those metrics and delegates winner selection to the newpalette-assignment-ranking.ts(lexicographic maximin over metrics, per-field/per-evidence/recognized-identifier assignments ranked together). - Activity bucketing — new
palette-ranking.tsbuckets recency and threads aPaletteSearchContextthrough every engine so ties break onageBucket→placement→timestamp→position→identity. - Identity encoding —
encodePaletteIdentitylength-prefixes host/worktree/tab parts; activation paths now reject ambiguous child ids and pass{ worktreeId }toactivateTab. - Render-cap retention —
capPaletteSection/layoutMultiPrimaryPaletteSectionsgain aretainpredicate wired toselectedItemIdandpinnedOptionId. - Secondary-match badges — rows carry
secondaryMatches/typeAliasMatchesand render a+Nbadge/tooltip. - Host-scoped ownership —
isOpenFileOwnedByWorktreeand host-qualified agent-metadata joins stop snippet/activity borrowing across same-id worktrees.
The contract tests (cmd-j-ranking-contract.test.ts, palette-ranking.test.ts, the "Atlas reference fixture" in workspace-tab-palette-results.test.ts) pin the new ordering precisely, and the perf budgets were updated to account for the additional selection work.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: c5cc7086-70b8-4be8-82c2-765b53f8c2ad
📥 Commits
Reviewing files that changed from the base of the PR and between 64374d5 and 44114b9f08fa0fdc30a674e46e7818265404a6a8.
📒 Files selected for processing (72)
.gitignoresrc/renderer/src/components/WorktreeJumpPalette.linear-url.test.tsxsrc/renderer/src/components/WorktreeJumpPalette.recent-tabs.behavior.test.tsxsrc/renderer/src/components/WorktreeJumpPalette.recent-tabs.test.tsxsrc/renderer/src/components/WorktreeJumpPalette.test.tsxsrc/renderer/src/components/cmd-j/palette-section-render-cap.test.tssrc/renderer/src/components/cmd-j/palette-section-render-cap.tssrc/renderer/src/components/tab-bar/TabBarCreateEntry.tab-results.test.tsxsrc/renderer/src/components/tab-bar/TabBarCreateEntry.tsxsrc/renderer/src/components/tab-bar/TabBarCreateEntryRow.tsxsrc/renderer/src/components/tab-bar/open-tab-search.test.tssrc/renderer/src/components/tab-bar/open-tab-search.tssrc/renderer/src/components/tab-bar/use-open-tab-search.tssrc/renderer/src/components/tab-bar/use-tab-create-entry-search-results.tssrc/renderer/src/components/use-worktree-jump-palette-controller.tssrc/renderer/src/components/use-worktree-jump-palette-open-tabs.tssrc/renderer/src/components/use-worktree-jump-palette-sections.tssrc/renderer/src/components/use-worktree-jump-palette-worktrees.tssrc/renderer/src/components/worktree-jump-palette-browser-simulator-rows.tsxsrc/renderer/src/components/worktree-jump-palette-interleaved-sections.test.tsxsrc/renderer/src/components/worktree-jump-palette-open-tab-items.tssrc/renderer/src/components/worktree-jump-palette-primitives.tsxsrc/renderer/src/components/worktree-jump-palette-workspace-tab-row.tsxsrc/renderer/src/components/worktree-jump-palette-worktree-row.tsxsrc/renderer/src/hooks/use-palette-search-evaluation-context.test.tssrc/renderer/src/hooks/use-palette-search-evaluation-context.tssrc/renderer/src/lib/browser-page-palette-activation.test.tssrc/renderer/src/lib/browser-page-palette-activation.tssrc/renderer/src/lib/browser-palette-page-entries.test.tssrc/renderer/src/lib/browser-palette-page-entries.tssrc/renderer/src/lib/browser-palette-search.tssrc/renderer/src/lib/browser-workspace-tab-activation.tssrc/renderer/src/lib/cmd-j-host-qualified-candidate-ownership.test.tssrc/renderer/src/lib/cmd-j-section-leadership.test.tssrc/renderer/src/lib/cmd-j-section-leadership.tssrc/renderer/src/lib/file-preview.test.tssrc/renderer/src/lib/palette-match/cmd-j-ranking-contract.test.tssrc/renderer/src/lib/palette-match/indexed-field.tssrc/renderer/src/lib/palette-match/match-document.tssrc/renderer/src/lib/palette-match/match-field-allocation.test.tssrc/renderer/src/lib/palette-match/palette-assignment-ranking.tssrc/renderer/src/lib/palette-match/palette-document.tssrc/renderer/src/lib/palette-match/palette-match-budget.tssrc/renderer/src/lib/palette-match/palette-match-core.test.tssrc/renderer/src/lib/palette-match/palette-match-performance.test.tssrc/renderer/src/lib/palette-match/palette-match-rendering.tssrc/renderer/src/lib/palette-match/palette-query.tssrc/renderer/src/lib/palette-match/palette-ranking.test.tssrc/renderer/src/lib/palette-match/palette-ranking.tssrc/renderer/src/lib/palette-match/tab-document.tssrc/renderer/src/lib/palette-match/tab-match.tssrc/renderer/src/lib/simulator-palette-active-tab.tssrc/renderer/src/lib/simulator-palette-search.test.tssrc/renderer/src/lib/simulator-palette-search.tssrc/renderer/src/lib/simulator-tab-palette-activation.test.tssrc/renderer/src/lib/simulator-tab-palette-activation.tssrc/renderer/src/lib/unified-tab-host-ownership.tssrc/renderer/src/lib/workspace-tab-agent-metadata.test.tssrc/renderer/src/lib/workspace-tab-agent-metadata.tssrc/renderer/src/lib/workspace-tab-agent-snippet-match.tssrc/renderer/src/lib/workspace-tab-palette-activation.store.test.tssrc/renderer/src/lib/workspace-tab-palette-activation.test.tssrc/renderer/src/lib/workspace-tab-palette-activation.tssrc/renderer/src/lib/workspace-tab-palette-entry-builder.tssrc/renderer/src/lib/workspace-tab-palette-results.test.tssrc/renderer/src/lib/workspace-tab-palette-results.tssrc/renderer/src/lib/workspace-tab-palette-search.test.tssrc/renderer/src/lib/worktree-palette-document.tssrc/renderer/src/lib/worktree-palette-multi-keyword.test.tssrc/renderer/src/lib/worktree-palette-search.test.tssrc/renderer/src/lib/worktree-palette-search.tssrc/renderer/src/lib/worktree-palette-task-url-result.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed the two commits pushed since the prior Pullfrog review (44114b9f0): the stable-identity ranking optimization and the hostless-tab ambiguity rejection.
- Dropped the dangling
.gitignoreexception — removed!docs/reference/cmd-j-ranking.md, resolving the stale reference to the deleted design doc. - Optimized candidate selection —
match-document.tsnow carries the fullPaletteIndexedFieldon eachFieldHitand uses a precomputedproofIdentity;candidateMetricKeybecame a numeric mixed-radix encoding instead of a string join, eliminatingfindIndexlookups. - Rejected hostless tabs/files on ambiguous worktree IDs —
workspace-tab-palette-activation.tsandbrowser-workspace-tab-activation.tsnow computefindAmbiguousWorktreeIdsand refuse hostless tabs/files when a worktree ID collides across hosts. - Fixed the
+Nbadge accessibility — the secondary-match badge is nowaria-hidden/tabIndex=-1with ansr-onlyspan, so extra matches read through the row's accessible name rather than a stray tab stop.
ℹ️ Simulator activation path still passes an empty ambiguity set
simulator-tab-palette-activation.ts still calls isUnifiedTabOwnedByWorktree(tab, worktree, new Set()) while the two sibling activation paths updated in this delta now compute findAmbiguousWorktreeIds. In principle a hostless (legacy) simulator tab whose worktree ID exists on multiple hosts would still be attributed instead of rejected there.
This is consistency/defense-in-depth rather than a live bug: both callers (open-tab-search-entries.ts and use-worktree-jump-palette-open-tabs.ts) build simulator entries through buildSearchableSimulatorTabs, which already filters hostless tabs by the ambiguous-worktree-id set, so the unguarded path is not reachable with such a tab today.
Technical details
# Simulator activation hostless ambiguity
## Affected sites
- src/renderer/src/lib/simulator-tab-palette-activation.ts:35 — passes `new Set()` to `isUnifiedTabOwnedByWorktree`
## Required outcome
- None required; informational. For symmetry with the other two activation paths, pass `findAmbiguousWorktreeIds(getIndexedAllWorktrees(state.worktreesByRepo))` here, mirroring `browser-workspace-tab-activation.ts`.DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ One minor observation — no blocking issues.
Reviewed changes
Re-reviewed the single commit pushed since the prior Pullfrog review (4de7f5aaf): 4b2c5c0a adds token-count tiebreakers to PaletteDocumentRank and precomputes palette identities.
- Token-count tiebreakers —
PaletteDocumentRankgainscontainerOnlyTokenCountandrecoveryTokenCount, folded intocomparePaletteSemanticRankso fewer container-only or recovered tokens wins an equal-severity tie; the per-document winner selection moved to a newcomparePaletteProofRankthat excludes those aggregates. - Multi-candidate token proofs —
TokenCandidates.visibleis now aTokenCandidate[]covering every matching visible field, deduped by a mixed-radixcandidateMetricKeyviasummarizeCandidates, instead of a single best candidate. - Precomputed identities — each engine's
baseResultnow computespaletteIdentityonce rather than re-encoding it in the sort comparator;searchOpenTabCandidates/capOpenTabSearchCandidateswere split out ofsearchOpenTabsso the hook can cap a memoized candidate list. - Hostless ambiguity closes the loop —
simulator-tab-palette-activationnow computesfindAmbiguousWorktreeIds(resolving the prior informational note), andhasOpenFileExecutionHostEvidenceextends ownership checks to files with explicit host evidence even on an unambiguous worktree ID. - Narrowed evaluation snapshots —
useWorktreeJumpPaletteControlleranduseOpenTabSearchnow key the activity clock on query/visibility rather than every store slice, so the clock no longer churns on store updates.
The rank/leadership test helpers were updated for the two new rank fields, and the recoveryTokenCount tiebreak plus several hostless-rejection tests pin the new behavior.
ℹ️ Nitpicks
comparePaletteDocumentRankis no longer called from production code — cross-entity ordering goes throughcomparePaletteSemanticRank(insidecomparePaletteEntityRanks) and winner selection throughcomparePaletteProofRank.cmd-j-ranking-contract.test.tsandpalette-match-core.test.tsstill assert ordering viacomparePaletteDocumentRank, whoseRANK_KEYSplacesplacementimmediately afterstrength, unlike production where it falls below the age bucket. Consider switching those tests tocomparePaletteSemanticRank(or droppingcomparePaletteDocumentRankif it's now redundant).
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/renderer/src/lib/workspace-tab-palette-activation.ts (1)
83-85: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winSelect the target-owned
OpenFileinstead of rejecting duplicate IDs.When
state.openFilescontains multiple records forresult.entityId, this guard returnsmissing-filebefore ownership selection, even when one record belongs toresult.worktreeId. Mirror the entry builder: select the matching worktree record using the sameisOpenFileOwnedByWorktreepredicate, then validate that record. Add a test with duplicate IDs and one valid target owner.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: ff0f6818-8a97-488f-b277-2e88a5b2bd5a
📥 Commits
Reviewing files that changed from the base of the PR and between 4de7f5aaf0d2fb8e5b26629d8d1d604dc2daa7c8 and 4b2c5c0a81b481dcf06bdf60247d171d9991c0d3.
📒 Files selected for processing (25)
src/renderer/src/components/cmd-j/palette-section-render-cap.tssrc/renderer/src/components/tab-bar/open-tab-search.tssrc/renderer/src/components/tab-bar/use-open-tab-search.tssrc/renderer/src/components/use-worktree-jump-palette-controller.tssrc/renderer/src/components/use-worktree-jump-palette-sections.tssrc/renderer/src/lib/browser-palette-search.tssrc/renderer/src/lib/browser-workspace-tab-activation.test.tssrc/renderer/src/lib/browser-workspace-tab-activation.tssrc/renderer/src/lib/cmd-j-section-leadership.test.tssrc/renderer/src/lib/palette-match/match-document.tssrc/renderer/src/lib/palette-match/palette-assignment-ranking.tssrc/renderer/src/lib/palette-match/palette-document.tssrc/renderer/src/lib/palette-match/palette-match-performance.test.tssrc/renderer/src/lib/palette-match/palette-ranking.test.tssrc/renderer/src/lib/palette-match/tab-match.tssrc/renderer/src/lib/simulator-palette-search.tssrc/renderer/src/lib/simulator-tab-palette-activation.test.tssrc/renderer/src/lib/simulator-tab-palette-activation.tssrc/renderer/src/lib/unified-tab-host-ownership.tssrc/renderer/src/lib/workspace-tab-palette-activation.test.tssrc/renderer/src/lib/workspace-tab-palette-activation.tssrc/renderer/src/lib/workspace-tab-palette-entry-builder.tssrc/renderer/src/lib/workspace-tab-palette-results.test.tssrc/renderer/src/lib/workspace-tab-palette-results.tssrc/renderer/src/lib/workspace-tab-palette-search.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.
e493c33 to
2f2fda5
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
ℹ️ No critical issues — one minor accessibility observation inline.
Reviewed changes
Re-reviewed the single commit pushed since the prior Pullfrog review (2f2fda5af1, "Centralize palette identity and unify host ownership resolution").
- Centralized palette identity —
paletteIdentityis now computed once per engine'sbaseResult(type prefixes unified tobrowser-page/workspace-tab/simulator-tab) and consumed directly as the item/open-tab id, replacing the ad-hocencodePaletteIdentitycalls scattered across consumers. - Unified host-ownership resolution — new
getPaletteOwnershipWorktreeIdsfolds folder workspaces (viafolderWorkspaceKey) into the ambiguity set, and every entry-builder and activation path now derivesfindAmbiguousWorktreeIdsfrom it. - Added duplicate-id filtering —
findDuplicateIdsdrops tabs, pages, and workspaces whose id appears more than once in the catalog, replacing the old "emit both / re-host the survivor" fallback with unambiguous rejection. - Refined ranking —
containerOnlyjoined the per-candidate metric set (with a newtotalselection step),sourceOrderreplaced the stringproofIdentity, andcompareSelectedSourceOrdernow breaks otherwise-equal proofs;comparePaletteProofRankwas removed in favor ofcomparePaletteDocumentRankplus source order. - Scoped recent-tab resolution —
terminalTabsByIdbecameterminalTabsByWorktree, and occurrence identity now keys onitem.id(the encoded palette identity) instead of a JSON-stringified tuple.
ℹ️ Evaluation-clock snapshot widened
The worktree-jump controller's paletteEvaluationSnapshot was widened from { query, visible } back to live store slices (openFiles, unifiedTabsByWorktree, browserPagesByWorkspace, retainedAgentsByPaneKey, sleepingAgentSessionsByPaneKey, …). Because usePaletteSearchEvaluationContext re-rolls nowMs on every snapshot change, this reverses the earlier narrowing introduced so the activity clock would not churn on store updates. Likely intentional (a fresh nowMs per data change keeps ageBucket current), but worth confirming the search re-run cost is acceptable.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
2f2fda5 to
a83e61b
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed the single commit pushed since the prior Pullfrog review (a83e61b11f → 3faac97f41, "Route same-target SSH worktrees through paired runtime owners").
- Routed runtime-owned worktrees through their paired runtime — new
getPaletteWorktreeExecutionHostId/getPaletteWorktreeIdentitypreferruntimeOwnerEnvironmentId(→runtime:<owner>) over physicalhostId, and every palette/search/activation call site that usedgetWorktreeHostIdentitynow keys on the palette identity instead. - Kept same-target SSH worktrees distinct —
dedupePaletteWorktrees(replacinggetIndexedAllWorktreesin the ownership inventory) and a rebuiltbuildPaletteWorktreeIndex(with an unambiguous physical-host-alias fallback) stop two runtime owners of one physical host from collapsing into a single row. - Simplified empty-query recent-tab ranking to focus recency —
orderRecentWorkspaceTabsdropped the two-tier attention model (blocked/waiting promotion, focused-group MRU, worktree visit recency) in favor of a stablelastFocusedAtsort; attention now surfaces only through the live status dot. - Fixed the
+Nsecondary-match badge accessibility — the badge left the tab order (aria-hidden/tabIndex={-1}) and the extra match texts now read through ansr-onlyspan in the row's accessible name.
ℹ️ Recent-tab ranking no longer promotes attention
The empty-query "Recent chats & terminals" section now ranks purely by lastFocusedAt, so a freshly blocked or permission-requiring terminal is no longer hoisted above recently-focused idle tabs — that signal survives only as the status dot. This is clearly deliberate (the ranking tests were rewritten to pin the new order, and lastFocusedAt was already the documented recency source in tabs-create-actions.ts), but it is a user-facing behavior change that neither the commit message nor the PR description mentions (the What Changed / Why sections are still empty).
Technical details
# Recent-tab ranking simplification is undocumented
## Affected sites
- src/renderer/src/lib/recent-workspace-tab-rows.ts:104 — `orderRecentWorkspaceTabs` now sorts by `lastFocusedAt` only
- src/renderer/src/components/use-worktree-jump-palette-recent-tabs.ts:65 — builds the `tabFocusTimes` map that feeds that sort
## Required outcome
- None required; informational. Add a one-line note to the PR body so the ranking change isn't a surprise to reviewers, or confirm the demotion of attention is intentional.ℹ️ Nitpicks
resolveRecentWorkspaceTabAttentioninsrc/renderer/src/lib/recent-workspace-tab-rows.tsis now dead — its only caller was the removed attention branch oforderRecentWorkspaceTabs.resolveRecentWorkspaceTabStatus(still used) inlines the same attention resolution, so the orphaned export can be dropped.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
b07ebad to
71e19bc
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run re-reviewed the rebase of the branch onto current main, which pulled in the already-merged Seed Cmd-J filter from sidebar scope (#19036) and reconciled the palette's recent-tab ordering with it.
- Reconciled recent-tab ordering with the sidebar-scope filter — the
rawFilter/setRawFilter+filterActiveboolean gave way to the seededfilter/setFilterstate, and the palette'srecentTabSnapshotstate refactor was merged with thecapturedFilterRefguard so a filter change mid-open re-captures the recent order instead of hiding rows a cleared chip brought back. - Moved filter reset into the open path —
setRawFilter(EMPTY_PALETTE_FILTER)on open is gone; filter seeding from the sidebar scope now lives inuseWorktreeJumpPaletteLocalState(re-seeded on each open), and thevisible/unused-import plumbing was tidied.
The reconciliation is clean: no dangling references to the old filter API remain, and the recentTabSnapshot + capturedFilterRef interaction preserves the freeze-until-filter-change semantics.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Replaces the old score-based ranking with a semantic-first contract that compares destination, recovery, word match, coverage, strength, and placement before using age buckets and recency to break ties. Adds explicit field roles (primary, secondary, alias, container), identity encoding, and activity-based bucketing so recent activity never overrides semantic relevance. Removes the substring-elision deduplication of secondary fields. This fixes the fixture where titles like "atlas-follow-up.md" beat recently active "Clarify Atlas action items".
- Structured identity encoding for consistent ID handling - Badge+tooltip reduces clutter of additional secondary matches - Reorder activation to refocus group after state updates
- Use composite keys (executionHostId, worktreeId, tabId) to uniquely identify tabs - Validate tab accessibility before activation to prevent mutation on invalid state - Extract getActivatableBrowserWorkspaceTab for consistent browser workspace validation - Refactor workspace tab validation with stricter collision and ownership checks - Remove unused comparePaletteActivity and mergeCandidateSummaries functions
Replace manual command-item ID construction with encodePaletteIdentity() to include host and worktree context, ensuring tests match the encoding scheme. Also adjust component styling (flex-1→flex-auto) and make HighlightedText highlight class customizable for secondary match badges.
- Add proofIdentity field to enable consistent tiebreaking in matches - Pass field objects in FieldHit instead of fieldId strings - Encode metric keys as numbers via bitwise operations - Eliminate document lookups for field coverage calculation
When worktree IDs collide across hosts, hostless tabs cannot be safely attributed. Refuse activation to prevent accidental host switching. Improve badge accessibility by keeping it out of tab order and exposing secondary matches through screen reader text only.
Add containerOnlyTokenCount and recoveryTokenCount fields to distinguish entities when match quality is equal, enabling better ranking of results that rely on container fields or recovery mechanisms. Cache paletteIdentity in search results to avoid repeated encoding during sorting. Extract omnibox field filtering and open-tab capping into reusable functions. Optimize evidence-unit iteration to only process matched units. Strengthen worktree ambiguity checks to reject hostless tabs when IDs collide across hosts.
- Document why capPaletteSection retains the selected match - Explain retainedResultId's role in keeping keyboard selection visible - Clarify secondaryMatches exposes additional match offsets
- Compute palette identity at search result level instead of constructing ad-hoc - Include folder workspaces in palette ownership via getPaletteOwnershipWorktreeIds - Add duplicate detection to filter colliding tab, page, and file IDs - Refine ranking with containerOnly metric and source-order tiebreakers - Improve secondary matches badge accessibility for keyboard users
- Centralize worktree palette identity resolution via getPaletteWorktreeIdentity and getPaletteWorktreeExecutionHostId, which use runtimeOwnerEnvironmentId when present instead of physical hostId - Deduplicate worktrees by palette identity to keep same-target SSH worktrees distinct when paired with different runtime environments - Replace scattered getWorktreeHostIdentity calls with new palette-specific resolution functions across palette components and search logic - Fix accessibility: move badge out of tab order, expose extra matches through row text instead of interactive tooltip
71e19bc to
c57857c
Compare
* Refactor Cmd+J ranking to semantic-first ordering with activity bucketin Replaces the old score-based ranking with a semantic-first contract that compares destination, recovery, word match, coverage, strength, and placement before using age buckets and recency to break ties. Adds explicit field roles (primary, secondary, alias, container), identity encoding, and activity-based bucketing so recent activity never overrides semantic relevance. Removes the substring-elision deduplication of secondary fields. This fixes the fixture where titles like "atlas-follow-up.md" beat recently active "Clarify Atlas action items". * Encode palette IDs and display secondary matches as badge - Structured identity encoding for consistent ID handling - Badge+tooltip reduces clutter of additional secondary matches - Reorder activation to refocus group after state updates * Encode tab palette identities to resolve collisions across hosts and wor - Use composite keys (executionHostId, worktreeId, tabId) to uniquely identify tabs - Validate tab accessibility before activation to prevent mutation on invalid state - Extract getActivatableBrowserWorkspaceTab for consistent browser workspace validation - Refactor workspace tab validation with stricter collision and ownership checks - Remove unused comparePaletteActivity and mergeCandidateSummaries functions * Update palette identity tests to use encodePaletteIdentity Replace manual command-item ID construction with encodePaletteIdentity() to include host and worktree context, ensuring tests match the encoding scheme. Also adjust component styling (flex-1→flex-auto) and make HighlightedText highlight class customizable for secondary match badges. * rm design doc * Use stable field identity and field objects for ranking optimization - Add proofIdentity field to enable consistent tiebreaking in matches - Pass field objects in FieldHit instead of fieldId strings - Encode metric keys as numbers via bitwise operations - Eliminate document lookups for field coverage calculation * Reject hostless tabs when worktree IDs are ambiguous When worktree IDs collide across hosts, hostless tabs cannot be safely attributed. Refuse activation to prevent accidental host switching. Improve badge accessibility by keeping it out of tab order and exposing secondary matches through screen reader text only. * Improve cmd-j palette ranking with token-count tiebreakers and identity Add containerOnlyTokenCount and recoveryTokenCount fields to distinguish entities when match quality is equal, enabling better ranking of results that rely on container fields or recovery mechanisms. Cache paletteIdentity in search results to avoid repeated encoding during sorting. Extract omnibox field filtering and open-tab capping into reusable functions. Optimize evidence-unit iteration to only process matched units. Strengthen worktree ambiguity checks to reject hostless tabs when IDs collide across hosts. * Add clarifying comments to palette ranking retention logic - Document why capPaletteSection retains the selected match - Explain retainedResultId's role in keeping keyboard selection visible - Clarify secondaryMatches exposes additional match offsets * Centralize palette identity and unify host ownership resolution - Compute palette identity at search result level instead of constructing ad-hoc - Include folder workspaces in palette ownership via getPaletteOwnershipWorktreeIds - Add duplicate detection to filter colliding tab, page, and file IDs - Refine ranking with containerOnly metric and source-order tiebreakers - Improve secondary matches badge accessibility for keyboard users * Route same-target SSH worktrees through paired runtime owners - Centralize worktree palette identity resolution via getPaletteWorktreeIdentity and getPaletteWorktreeExecutionHostId, which use runtimeOwnerEnvironmentId when present instead of physical hostId - Deduplicate worktrees by palette identity to keep same-target SSH worktrees distinct when paired with different runtime environments - Replace scattered getWorktreeHostIdentity calls with new palette-specific resolution functions across palette components and search logic - Fix accessibility: move badge out of tab order, expose extra matches through row text instead of interactive tooltip * fix static analysis

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)