fix(studio): make command palette shortcut platform-aware - #889
Tanmaypatil-25 wants to merge 1 commit into
Conversation
|
@Tanmaypatil-25 is attempting to deploy a commit to the doit's projects Team on Vercel. A member of the Team first needs to authorize it. |
GitNexus Review · PR #8891 issue found across 3 files. SummaryA focused Studio UI change to the command palette shortcut carries a critical blast-radius classification. 🔴 CRITICAL blast radius. This makes the command palette shortcut platform-aware in the Studio UI, with impact reaching direct and second-hop dependents. The change touches Review the shortcut handling across the sidebar and topbar alongside the platform logic in Full detail lives in the GitNexus check run for this commit. |
🤖 Agent context for GitNexus Review · PR #889This comment carries deterministic graph detail for coding agents and reviewers who want the receipts — the main review comment carries the human summary.
What changedSymbol Changes (3)
Changed Files (3)
What it affectsArchitecture Impact
Blast Radius
Direct dependents (d1)
Indirect dependents (d2)
Prompt for AI agents (1 issue) |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
| <span className="flex-1">Search…</span> | ||
| <kbd className="rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-caption text-ink-faint"> | ||
| ⌘K | ||
| {COMMAND_PALETTE_SHORTCUT_LABEL} |
There was a problem hiding this comment.
🟡 Warning — Platform-specific shortcut label differs during server rendering and hydration
COMMAND_PALETTE_SHORTCUT_LABEL is evaluated in platform.ts as Ctrl+K when navigator is unavailable, but evaluates as ⌘K in a Mac browser. Sidebar renders this constant at this line, and AppShell renders Sidebar directly (app-shell.tsx:267); the app entry renders AppShell (page.tsx:7) without a client-only/SSR-disabled wrapper. Thus a Mac receives different server and initial client text for this element, causing a hydration mismatch instead of matching markup.
(the same fix applies at src/components/studio/topbar.tsx:128, src/lib/studio/platform.ts:2)
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/components/studio/sidebar.tsx, line 217:
<comment>'COMMAND_PALETTE_SHORTCUT_LABEL' is evaluated in 'platform.ts' as 'Ctrl+K' when 'navigator' is unavailable, but evaluates as '⌘K' in a Mac browser. 'Sidebar' renders this constant at this line, and 'AppShell' renders 'Sidebar' directly ('app-shell.tsx:267'); the app entry renders 'AppShell' ('page.tsx:7') without a client-only/SSR-disabled wrapper. Thus a Mac receives different server and initial client text for this element, causing a hydration mismatch instead of matching markup.</comment>
<context>Enclosing symbol: Sidebar.</context>
Why this matters: GitNexus flagged this from your code graph — a caller or contract relies on what changed here. · llm-review

Summary
Fixes the command palette shortcut hint so that it displays the appropriate keyboard shortcut based on the user's platform.
⌘Kon macOS.Ctrl+Kon Windows and Linux.Changes
COMMAND_PALETTE_SHORTCUT_LABELinsrc/lib/studio/platform.ts.⌘Klabel insidebar.tsx.⌘Klabel intopbar.tsx.Testing
Local dependency installation could not be completed because
onnxruntime-nodefailed during package extraction with a Node.js out-of-memory error on Windows.The change is limited to the platform-aware shortcut label and does not modify the existing command palette keyboard handler.
Closes #872
📝 Summary by GitNexus
Summary
A focused Studio UI change to the command palette shortcut carries a critical blast-radius classification.
🔴 CRITICAL blast radius. This makes the command palette shortcut platform-aware in the Studio UI, with impact reaching direct and second-hop dependents.
The change touches
SidebarandNavIteminsrc/components/studio/sidebar.tsx,Topbarinsrc/components/studio/topbar.tsx, andsrc/lib/studio/platform.ts. The graph places the impact in theStudiomodule and traces it through 12 affected flows.Review the shortcut handling across the sidebar and topbar alongside the platform logic in
platform.ts. The file risk level is LOW, with no HIGH or CRITICAL risk files identified.Added by GitNexus for PR #889. Edit freely — this block is replaced on the next review, everything above it is left untouched.