Skip to content

fix(cmd-j): short-screen fit and overflow copy for larger palette - #13123

Merged
AmethystLiang merged 3 commits into
mainfrom
cmd-j-remaining-polish
Aug 8, 2026
Merged

AmethystLiang merged 3 commits into
mainfrom
cmd-j-remaining-polish

Conversation

@AmethystLiang

Copy link
Copy Markdown
Contributor

Summary

Follow-up polish for the larger Cmd+J palette (#13120). Addresses the remaining non-blocking issues from post-merge review:

  • Short-viewport clipping: the expanded list (72vh / 600px) plus top offset could push input/filter/footer off short windows. Cap the dialog with max-h and size the list as min(600px, calc(100vh - 14rem)), with a slightly safer top offset.
  • Stale English overflow copy: en.json still said “keep typing or add a filter” while the runtime fallback said “scroll or keep typing”. Catalog now matches multi-primary overflow behavior.

Intentionally not in this PR (by design / pre-existing noise, not regressions):

  • Soft-split rows continuing under the other section header after the floor
  • Type-alias substring matches for short queries like tab

Screenshots

  • Visual change: Cmd+J on a short window should keep footer/input visible; overflow hint English copy updated.
  • No visual change on tall screens beyond the same large palette shell.

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm build
  • Manual reasoning: viewport calc leaves room for input + chips + footer; i18n key alignment verified in en.json + fallback
  • No new unit tests required (layout CSS + catalog string only)

AI Review Report

Residual review of #13120 found no release blockers. These two polish items were the only actionable leftovers:

Item Severity Action
List 72vh + top 10% clipping chrome on short screens Medium UX Clamp dialog/list height
en.json overflow string out of date Low Sync catalog
Soft “N more” includes hard-cap tail By design Copy already covers “keep typing”
Rows under alternate section header after floor By design Left alone
Type-alias short-query noise Pre-existing pattern Left alone

Cross-platform: renderer CSS only (vh/rem); no shortcuts, paths, shell, or Electron main changes.

Security Audit

  • No IPC, auth, secrets, command execution, or path handling.
  • Copy/catalog and layout constraints only.

Notes

@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: 70d65a45-4fed-42ac-bcec-8d400637dd45

📥 Commits

Reviewing files that changed from the base of the PR and between 8a061b9 and 0f14720.

📒 Files selected for processing (11)
  • src/renderer/src/components/WorktreeJumpPalette.tsx
  • src/renderer/src/components/cmd-j/palette-section-render-cap.ts
  • src/renderer/src/components/worktree-jump-palette-interleaved-sections.test.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/palette-type-alias-match.test.ts
  • src/renderer/src/lib/palette-type-alias-match.ts
  • src/renderer/src/lib/simulator-palette-search.test.ts
  • src/renderer/src/lib/simulator-palette-search.ts
  • src/renderer/src/lib/workspace-tab-agent-metadata.ts
  • src/renderer/src/lib/workspace-tab-palette-results.ts
  • src/renderer/src/lib/workspace-tab-palette-search.ts

📝 Walkthrough

Walkthrough

The palette now gates expensive indexing while inactive, reuses sorted worktree results, and memoizes quick-action availability. Interleaved query results preserve section headers, including continuation sections. Dialog and command-list sizing now uses available viewport space. A shared alias matcher is used by simulator and workspace-tab searches. Workspace-tab search builds one indexed lookup for agent metadata. Tests cover alias matching and interleaved section rendering.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the short-viewport layout fix and overflow copy update for the Cmd+J palette.
Description check ✅ Passed The description covers the user-visible changes, testing rationale, review findings, security audit, platform scope, and known follow-up items.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 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.

AmethystLiang and others added 3 commits August 8, 2026 13:14
Cap dialog/list height against the viewport so the input, filter chips, and
footer stay visible after the larger Cmd+J shell, and align the English catalog
overflow hint with the multi-primary “scroll or keep typing” wording.
When both open tabs and worktrees overflow their first-screen slice, the
layout interleaves remainder rows. The trailing-section header renders
before the leading remainder, so unlabeled rows read as the wrong section.
Re-emit headers before each remainder with a distinct suffix for React keys.
Refactor type-alias matching into a reusable utility that prefers earliest
match position over declaration order.
P1-a: Move quickActionContext filtering into a useMemo with stable
primitive deps (activeView, activeWorktreeId, sshConnectionStates, etc.)
instead of calling buildQuickActionContext() inline every render — the
fresh object identity defeated the middleItems memo on every keystroke.

P1-b: Guard browserSortedWorktrees, browserPageEntries,
simulatorTabEntries, and workspaceTabEntries on paletteStatusInputsActive
so the always-mounted palette stops rebuilding full open-tab indexes
after every store write while closed.

P2-a: Derive sortedWorktrees from browserSortedWorktrees by filtering
out archived worktrees — both called sortWorktreesSmart with identical
deps, so one sort + filter replaces two.

P2-b: Pre-index agent metadata by tabId once per build via
buildAgentMetadataTabIndex, replacing the O(tabs × map entries) scan in
collectAgentMetadataForTerminal with O(1) lookups per tab.

P2-e: Assert in the interleaved test that rendered selectable row order
matches orderMultiPrimaryPaletteItems, keeping listEntries and the
layout function as a single source of truth.

Co-authored-by: Orca <[email protected]>
@AmethystLiang
AmethystLiang force-pushed the cmd-j-remaining-polish branch from 7fdb265 to 0f14720 Compare August 8, 2026 20:53
@AmethystLiang
AmethystLiang merged commit b11354a into main Aug 8, 2026
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

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.

enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…ablyai#13123)

* fix(cmd-j): fit large palette on short screens and sync overflow copy

Cap dialog/list height against the viewport so the input, filter chips, and
footer stay visible after the larger Cmd+J shell, and align the English catalog
overflow hint with the multi-primary “scroll or keep typing” wording.

* fix(cmd-j): re-emit section headers for interleaved palette remainder ro

When both open tabs and worktrees overflow their first-screen slice, the
layout interleaves remainder rows. The trailing-section header renders
before the leading remainder, so unlabeled rows read as the wrong section.
Re-emit headers before each remainder with a distinct suffix for React keys.
Refactor type-alias matching into a reusable utility that prefers earliest
match position over declaration order.

* fix(cmd-j): stabilize palette memos and gate heavy builders when closed

P1-a: Move quickActionContext filtering into a useMemo with stable
primitive deps (activeView, activeWorktreeId, sshConnectionStates, etc.)
instead of calling buildQuickActionContext() inline every render — the
fresh object identity defeated the middleItems memo on every keystroke.

P1-b: Guard browserSortedWorktrees, browserPageEntries,
simulatorTabEntries, and workspaceTabEntries on paletteStatusInputsActive
so the always-mounted palette stops rebuilding full open-tab indexes
after every store write while closed.

P2-a: Derive sortedWorktrees from browserSortedWorktrees by filtering
out archived worktrees — both called sortWorktreesSmart with identical
deps, so one sort + filter replaces two.

P2-b: Pre-index agent metadata by tabId once per build via
buildAgentMetadataTabIndex, replacing the O(tabs × map entries) scan in
collectAgentMetadataForTerminal with O(1) lookups per tab.

P2-e: Assert in the interleaved test that rendered selectable row order
matches orderMultiPrimaryPaletteItems, keeping listEntries and the
layout function as a single source of truth.

Co-authored-by: Orca <[email protected]>

---------

Co-authored-by: Orca <[email protected]>
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