Skip to content

Expand Cmd+J and interleave open tabs with worktrees on search - #13120

Merged
AmethystLiang merged 3 commits into
mainfrom
make-cmd-j-larger
Aug 8, 2026
Merged

AmethystLiang merged 3 commits into
mainfrom
make-cmd-j-larger

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Makes Cmd+J larger and easier to scan when a query matches both open tabs and worktrees.

  • Bigger palette: ~900px wide, list height up to ~600px / 72vh (was ~736×460).
  • Denser open-tab rows: drop fixed secondaries like “Terminal tab” / “Mobile Emulator tab” that crowded the primary line and could render bare · · under width pressure. Worktree name still shows; empty secondaries no longer force separators.
  • Soft-split multi-primary layout when a typed query hits both open tabs and worktrees:
    1. Leading section preview (6 rows)
    2. Non-selectable “N more — scroll or keep typing” hint
    3. Trailing primary floor (3 rows) so the other section stays above the fold
    4. Remaining leading rows, then remaining trailing rows (still hard-capped at 50 each)
    5. Projects / actions after both primaries
      Single-section results keep the full hard-capped list (no empty floor).
  • Search-only type aliases: typing 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.
  • Overflow + selection correctness: trailing hard-cap overflow gets its own hint; selectableItems is derived from listEntries so keyboard order matches render order.

Screenshots

  • Visual change: larger Cmd+J dialog, denser open-tab primary lines, interleaved open-tabs/worktrees first screen on multi-hit queries.
  • Please attach a short screen recording of Cmd+J with a shared query (both open tabs + worktrees matching) if available.

Testing

  • pnpm lint
  • pnpm typecheck
  • Focused unit tests for palette soft-split, workspace/simulator search, open-tab search, and match relevance (pnpm exec vitest run --config config/vitest.config.ts on the touched test files — 181 passed)
  • pnpm test (full suite)
  • pnpm build
  • Added/updated unit tests for:
    • multi-primary soft-split + trailing hard overflow
    • ordered multi-primary items
    • terminal / simulator type aliases without display secondary
    • type-alias relevance ranking

AI Review Report

Deep review of the branch before/while landing follow-up fixes:

Area Result
Multi-primary interleave vs design mock (tmp/cmd-j-recommended.html) Matches intentional order (preview → soft hint → trailing floor → rests)
Trailing hard-cap overflow Fixed — was silently dropping rows past 50 with no hint
Selection vs render order Fixed — removed dual-path selectableItems builder; derive from listEntries
Removing fixed secondaries Fixed search regression — type aliases kept for terminals/simulators without re-cluttering rows
Relevance for alias-only hits Fixed — aliases used to score as NO_MATCH, breaking open-tab sort and which section leads
Host badge bleed-through Solid bg-background on host chips; overflow-hidden on primary line containers
Cross-platform No new hard-coded Mac shortcuts; palette is renderer UI only. Shortcut badges still use existing useShortcutKeyComboDetails / platform-aware combos. Paths untouched. No shell/Electron main-process changes.

Security Audit

  • No new IPC, auth, secrets, command execution, or path handling.
  • Search stays local/in-memory; existing query byte limits for browser/simulator/open-tab engines unchanged.
  • Overflow hints and section headers remain non-selectable plain rows (not command targets).

Notes

  • Soft “N more” on the leading section includes both scrollable rest and hard-capped tail; copy says “scroll or keep typing” to cover both.
  • WorktreeJumpPalette.tsx remains large; multi-primary helpers live in palette-section-render-cap.ts for the pure layout logic.
  • Follow-up (optional): further extract list-entry building from the palette component.

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.
@AmethystLiang AmethystLiang changed the title Make cmd j larger Expand Cmd+J and interleave open tabs with worktrees on search Aug 8, 2026
Typecheck failed because the ternary lead/trail arrays inferred a
WorktreePaletteItem[] | OpenTabPaletteItem[] union that could not
satisfy layoutMultiPrimaryPaletteSections' single T parameter.
@coderabbitai

coderabbitai Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c108962c-a92c-4d49-a8c9-0203a8609d78

📥 Commits

Reviewing files that changed from the base of the PR and between 486f5d3 and 03ab422.

📒 Files selected for processing (1)
  • src/renderer/src/components/WorktreeJumpPalette.tsx

📝 Walkthrough

Walkthrough

The 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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary changes: expanding Cmd+J and interleaving open-tab results with worktrees during search.
Description check ✅ Passed The description covers the summary, visual changes, focused testing, AI review, security audit, and notes, with only screenshots and some broader checks still incomplete.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai 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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between f968583 and 486f5d3.

📒 Files selected for processing (12)
  • src/renderer/src/components/WorktreeJumpPalette.tsx
  • src/renderer/src/components/cmd-j/palette-section-render-cap.test.ts
  • src/renderer/src/components/cmd-j/palette-section-render-cap.ts
  • src/renderer/src/components/tab-bar/open-tab-search.test.ts
  • src/renderer/src/lib/cmd-j-match-relevance.test.ts
  • src/renderer/src/lib/cmd-j-match-relevance.ts
  • src/renderer/src/lib/simulator-palette-search.test.ts
  • src/renderer/src/lib/simulator-palette-search.ts
  • src/renderer/src/lib/workspace-tab-palette-activation.test.ts
  • src/renderer/src/lib/workspace-tab-palette-results.ts
  • src/renderer/src/lib/workspace-tab-palette-search.test.ts
  • src/renderer/src/lib/workspace-tab-palette-search.ts

@AmethystLiang
AmethystLiang merged commit 0d29497 into main Aug 8, 2026
7 of 41 checks passed
AmethystLiang added a commit that referenced this pull request Aug 8, 2026
* 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.
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant