Skip to content

Isolate command palette renders#2753

Draft
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/react-component-health-dccc
Draft

Isolate command palette renders#2753
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/react-component-health-dccc

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented May 18, 2026

What Changed

  • Moved command palette dialog state/effects into a sibling controller so the app shell (AppSidebarLayout/Outlet) is no longer rendered under CommandDialog.Root.
  • Changed the sidebar search trigger to open the palette through the existing command palette store instead of requiring Base UI dialog context above the whole app.
  • Extracted the command palette effects touched by this change into named hooks.

Why

react-doctor plus a manual hot-path pass identified CommandPalette as a high-blast-radius render risk: the dialog root previously wrapped the entire sidebar and routed chat UI. Isolating the dialog/controller keeps palette open/close state changes out of the app shell subtree while preserving the composer handle context.

UI Changes

Behavior should be unchanged. React Scan before/after recordings were captured for the same interaction: open command palette, type settings, close, reopen, close.

  • Before recording: /workspace/react-scan-recordings/before-command-palette.webm
  • After recording: /workspace/react-scan-recordings/after-command-palette.webm
  • Preview frames also captured in /workspace/react-scan-recordings/before-frame.png and /workspace/react-scan-recordings/after-frame.png

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Validation:

  • bun fmt
  • bun lint (passes with existing warnings, 0 errors)
  • bun typecheck
  • bunx react-doctor@latest . --verbose (73/100, 253 existing findings across 88 files)
Open in Web View Automation 

Note

Isolate command palette renders into dedicated controller and dialog components

  • Refactors CommandPalette.tsx by extracting keyboard shortcut handling, open-state management, and dialog rendering into separate components (CommandPaletteController, CommandPaletteDialog) and hooks (useCommandPaletteShortcut, useCloseCommandPaletteOnUnmount).
  • Extracts browse-path prefetching into usePrefetchBrowsePaths and add-project intent handling into useOpenAddProjectIntent to reduce the size of OpenCommandPaletteDialog.
  • Updates Sidebar.tsx to replace CommandDialogTrigger with a direct SidebarMenuButton that calls useCommandPaletteStore to open the palette.

Macroscope summarized 7dbf310.

cursoragent and others added 2 commits May 18, 2026 16:10
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels May 18, 2026
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant