Repository navigation
Expand Cmd+J and interleave open tabs with worktrees on search - #13120
Conversation
Increase palette dimensions (900x600) and remove redundant secondary
labels ("Terminal tab", "Mobile Emulator tab") that crowded rows. When
a typed query matches both open tabs and worktrees, use a soft-split
layout: leading section preview followed by trailing section floor so
neither primary is buried under ~50 rows. Trailing section no longer
truncates to hard cap when paired with a larger leading section.
Add searchable type aliases (e.g. "terminal tab", "mobile emulator") so users can find items by type without cluttering the row display. Refactor multi-primary palette layout into orderMultiPrimaryPaletteItems to prevent selection/render order drift, simplify selectableItems derivation, and track trailing hard-overflow count separately from scrollable rest.
Typecheck failed because the ternary lead/trail arrays inferred a WorktreePaletteItem[] | OpenTabPaletteItem[] union that could not satisfy layoutMultiPrimaryPaletteSections' single T parameter.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe palette now searches workspace tabs and simulator tabs through type aliases without fixed secondary labels. Alias matches contribute to open-tab relevance. Typed queries can interleave capped open-tab and worktree sections with overflow hints. Keyboard selection follows the rendered order. Workspace-tab, simulator-tab, and browser-page rows share one primary-line renderer. The command dialog and list viewport are larger. Tests cover alias metadata, relevance, section splitting, ordering, and overflow. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 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: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 47f348f0-9a53-43a5-b435-abeeac4ccaa9
📒 Files selected for processing (12)
src/renderer/src/components/WorktreeJumpPalette.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/open-tab-search.test.tssrc/renderer/src/lib/cmd-j-match-relevance.test.tssrc/renderer/src/lib/cmd-j-match-relevance.tssrc/renderer/src/lib/simulator-palette-search.test.tssrc/renderer/src/lib/simulator-palette-search.tssrc/renderer/src/lib/workspace-tab-palette-activation.test.tssrc/renderer/src/lib/workspace-tab-palette-results.tssrc/renderer/src/lib/workspace-tab-palette-search.test.tssrc/renderer/src/lib/workspace-tab-palette-search.ts
* Expand Cmd+J palette and interleave tabs/worktrees on query
Increase palette dimensions (900x600) and remove redundant secondary
labels ("Terminal tab", "Mobile Emulator tab") that crowded rows. When
a typed query matches both open tabs and worktrees, use a soft-split
layout: leading section preview followed by trailing section floor so
neither primary is buried under ~50 rows. Trailing section no longer
truncates to hard cap when paired with a larger leading section.
* Add type-alias search and fix multi-primary palette ordering
Add searchable type aliases (e.g. "terminal tab", "mobile emulator") so users can find items by type without cluttering the row display. Refactor multi-primary palette layout into orderMultiPrimaryPaletteItems to prevent selection/render order drift, simplify selectableItems derivation, and track trailing hard-overflow count separately from scrollable rest.
* fix(cmd-j): pin multi-primary layout generic for mixed item types
Typecheck failed because the ternary lead/trail arrays inferred a
WorktreePaletteItem[] | OpenTabPaletteItem[] union that could not
satisfy layoutMultiPrimaryPaletteSections' single T parameter.
…yai#13120) * Expand Cmd+J palette and interleave tabs/worktrees on query Increase palette dimensions (900x600) and remove redundant secondary labels ("Terminal tab", "Mobile Emulator tab") that crowded rows. When a typed query matches both open tabs and worktrees, use a soft-split layout: leading section preview followed by trailing section floor so neither primary is buried under ~50 rows. Trailing section no longer truncates to hard cap when paired with a larger leading section. * Add type-alias search and fix multi-primary palette ordering Add searchable type aliases (e.g. "terminal tab", "mobile emulator") so users can find items by type without cluttering the row display. Refactor multi-primary palette layout into orderMultiPrimaryPaletteItems to prevent selection/render order drift, simplify selectableItems derivation, and track trailing hard-overflow count separately from scrollable rest. * fix(cmd-j): pin multi-primary layout generic for mixed item types Typecheck failed because the ternary lead/trail arrays inferred a WorktreePaletteItem[] | OpenTabPaletteItem[] union that could not satisfy layoutMultiPrimaryPaletteSections' single T parameter.
Summary
Makes Cmd+J larger and easier to scan when a query matches both open tabs and worktrees.
· ·under width pressure. Worktree name still shows; empty secondaries no longer force separators.Single-section results keep the full hard-capped list (no empty floor).
terminal,mobile,simulator, etc. still finds those tabs without painting a type label on the row. Relevance scoring treats aliases as secondary-tier hits so section leadership stays correct.selectableItemsis derived fromlistEntriesso keyboard order matches render order.Screenshots
Testing
pnpm lintpnpm typecheckpnpm exec vitest run --config config/vitest.config.tson the touched test files — 181 passed)pnpm test(full suite)pnpm buildAI Review Report
Deep review of the branch before/while landing follow-up fixes:
tmp/cmd-j-recommended.html)selectableItemsbuilder; derive fromlistEntriesNO_MATCH, breaking open-tab sort and which section leadsbg-backgroundon host chips; overflow-hidden on primary line containersuseShortcutKeyComboDetails/ platform-aware combos. Paths untouched. No shell/Electron main-process changes.Security Audit
Notes
WorktreeJumpPalette.tsxremains large; multi-primary helpers live inpalette-section-render-cap.tsfor the pure layout logic.