Repository navigation
[Tabs] Preserve host routing and reduce search churn - #13114
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:
📝 WalkthroughWalkthroughThe change adds execution-host-aware search across workspace, browser, simulator, and agent tabs. It returns deferred query state with search results and rejects stale results in the tab bar. It routes activation through host-aware workspace, browser, and simulator helpers. It adds direct browser focus requests, worktree-aware path deduplication, typed failure handling, tests, and localized search labels. 🚥 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.
Actionable comments posted: 3
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/components/WorktreeJumpPalette.tsx (1)
1737-1759: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy liftPreserve the simulator result execution host.
Line 1739 passes
SimulatorPaletteSearchResultto the activation helper. That result type has noexecutionHostId. The helper then resolvesgetKnownWorktreeById(worktreeId, undefined).When worktree IDs collide across execution hosts, this can activate or reject the wrong simulator tab. Add
executionHostIdwhen building simulator search results. Pass it through the result type. Add a host-collision regression test.
🧹 Nitpick comments (1)
src/renderer/src/components/tab-bar/open-tab-entry-dedupe.test.ts (1)
70-100: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winStrengthen the terminal fixture so the test proves what its name claims.
The terminal result at Line 72 carries
relativePath: null, so it is filtered by theresult.relativePathcheck, not by thesource === 'workspace'check. The test therefore does not prove that a terminal result cannot suppress a file entry. Give the terminal fixture a non-nullrelativePathto pin the intended contract insidedropFileEntriesCoveredByTabResults.♻️ Proposed test fixture change
const results: OpenTabSearchResult[] = [ - { ...editorTab(null), contentType: 'terminal' }, + { ...editorTab('src/zebra.ts'), contentType: 'terminal' }, {
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 49f7a5f9-644c-459d-bd72-02cedacb10a0
📥 Commits
Reviewing files that changed from the base of the PR and between 4c26ef6 and 0f00c7c0c6da2ed2ac6fe9099eb3440ed77f0351.
📒 Files selected for processing (37)
src/renderer/src/components/WorktreeJumpPalette.test.tsxsrc/renderer/src/components/WorktreeJumpPalette.tsxsrc/renderer/src/components/tab-bar/TabBar.context-menu.test.tssrc/renderer/src/components/tab-bar/TabBar.tsxsrc/renderer/src/components/tab-bar/TabBar.windows-shell-launch.test.tssrc/renderer/src/components/tab-bar/TabBarCreateEntry.keyboard.test.tsxsrc/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/lucide-icon-stub-fixture.tssrc/renderer/src/components/tab-bar/open-tab-entry-dedupe.test.tssrc/renderer/src/components/tab-bar/open-tab-entry-dedupe.tssrc/renderer/src/components/tab-bar/open-tab-search-entries.tssrc/renderer/src/components/tab-bar/open-tab-search.test.tssrc/renderer/src/components/tab-bar/open-tab-search.tssrc/renderer/src/components/tab-bar/open-tab-selection-routing.test.tssrc/renderer/src/components/tab-bar/open-tab-selection-routing.tssrc/renderer/src/components/tab-bar/tab-create-entry-active-option.tssrc/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/use-open-tab-search.test.tssrc/renderer/src/components/tab-bar/use-open-tab-search.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/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/simulator-tab-palette-activation.test.tssrc/renderer/src/lib/simulator-tab-palette-activation.tssrc/renderer/src/lib/workspace-tab-palette-activation.test.tssrc/renderer/src/lib/workspace-tab-palette-activation.tssrc/renderer/src/lib/workspace-tab-palette-search.test.tssrc/renderer/src/lib/workspace-tab-palette-search.ts
0f00c7c to
fe0efb5
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 600305d9-0ebc-445b-a07d-b8e08bd95614
📥 Commits
Reviewing files that changed from the base of the PR and between 0f00c7c0c6da2ed2ac6fe9099eb3440ed77f0351 and bb8df1c768baf377b7541bfddbd02a6b78009606.
📒 Files selected for processing (4)
src/renderer/src/components/tab-bar/open-tab-search-entries.tssrc/renderer/src/components/tab-bar/open-tab-selection-routing.test.tssrc/renderer/src/components/tab-bar/open-tab-selection-routing.tssrc/renderer/src/components/tab-bar/use-open-tab-search.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- src/renderer/src/components/tab-bar/open-tab-selection-routing.test.ts
- src/renderer/src/components/tab-bar/open-tab-selection-routing.ts
- src/renderer/src/components/tab-bar/use-open-tab-search.test.ts
bb8df1c to
1fedc1e
Compare
- Use worktree.hostId to resolve execution host instead of defaulting to LOCAL_EXECUTION_HOST_ID - Correctly populate search results for remote-only worktrees when activeWorkspaceExecutionHostId is null - Remove automatic focus of terminal tabs after search activation
- useOpenTabSearch now returns {query, results} to track which query the results describe
- Gate tab results on query match so stale results don't appear on user's screen
- Add live region (role=status) for accessibility of tab switch error messages
- Distinguish missing-worktree from missing-page errors in browser page activation
- Improve host resolution to prefer active host when worktree and repo don't specify one
Track whether selection auto-follows the top-ranked result or was manually positioned. Re-pin entry to tabs when they rank higher, but preserve manual selection.
- Extract requestBrowserFocus to handle queueing + event dispatch atomically - Simplify omnibox selection tracking with single pinnedOptionId state - Optimize host resolution in tab search to compute once per query
0441067 to
19e4caa
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. |
Two readiness-checklist fixes for open-tab search: - Browser page activation checked page/workspace before the worktree, but deleting a worktree purges its browser workspaces and pages too, so a dead workspace surfaced as "Browser page no longer exists". Check the worktree first; routing already maps missing-worktree to the workspace wording. - Editor-tab/file dedupe compared paths with separator normalization only, so a Windows worktree offered both "Switch to tab" and "Open file" for the same path in different case. Fold by the worktree path's syntax via the new isCaseInsensitiveRuntimeRoot, keeping WSL, POSIX and SSH roots case-sensitive, and add NFC so a macOS NFD listing matches an editor's composed path.
|
@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. |
- Only editor tabs should suppress file entries; check contentType instead of relying on path being empty for non-editor tabs. - Add executionHostId to simulator search results to disambiguate when the same worktree id exists on multiple execution hosts.
* fix tab search host routing and churn
* Fix open-tab search to resolve hosts from worktree when active host unkn
- Use worktree.hostId to resolve execution host instead of defaulting to LOCAL_EXECUTION_HOST_ID
- Correctly populate search results for remote-only worktrees when activeWorkspaceExecutionHostId is null
- Remove automatic focus of terminal tabs after search activation
* Prevent stale tab results when user keeps typing ahead of deferred searc
- useOpenTabSearch now returns {query, results} to track which query the results describe
- Gate tab results on query match so stale results don't appear on user's screen
- Add live region (role=status) for accessibility of tab switch error messages
- Distinguish missing-worktree from missing-page errors in browser page activation
- Improve host resolution to prefer active host when worktree and repo don't specify one
* Re-pin entry to deferred tab results that rank higher
Track whether selection auto-follows the top-ranked result or was
manually positioned. Re-pin entry to tabs when they rank higher,
but preserve manual selection.
* Consolidate browser focus requests and simplify selection state
- Extract requestBrowserFocus to handle queueing + event dispatch atomically
- Simplify omnibox selection tracking with single pinnedOptionId state
- Optimize host resolution in tab search to compute once per query
* Report dead browser workspaces correctly and fold dedupe case by host
Two readiness-checklist fixes for open-tab search:
- Browser page activation checked page/workspace before the worktree, but
deleting a worktree purges its browser workspaces and pages too, so a dead
workspace surfaced as "Browser page no longer exists". Check the worktree
first; routing already maps missing-worktree to the workspace wording.
- Editor-tab/file dedupe compared paths with separator normalization only, so
a Windows worktree offered both "Switch to tab" and "Open file" for the same
path in different case. Fold by the worktree path's syntax via the new
isCaseInsensitiveRuntimeRoot, keeping WSL, POSIX and SSH roots case-sensitive,
and add NFC so a macOS NFD listing matches an editor's composed path.
* Fix tab deduplication and resolve worktree host collisions
- Only editor tabs should suppress file entries; check contentType instead
of relying on path being empty for non-editor tabs.
- Add executionHostId to simulator search results to disambiguate when
the same worktree id exists on multiple execution hosts.
Summary
Verification
pnpm run typecheckpassed.