From e4092458c8e4d8ca14cede630a3a2a4f9dfcfe2c Mon Sep 17 00:00:00 2001 From: brennanb2025 Date: Mon, 8 Jun 2026 16:42:03 -0700 Subject: [PATCH] Fix shortcut chip floating right in Cmd-J palette tip on Windows/Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Cmd-J palette feature tip rendered its title and shortcut chip as flex siblings (inline-flex + md:flex-nowrap, chip shrink-0). With a wide label like Ctrl+Shift+J the row overflowed, so the title text shrank to two lines while the fixed-width chip floated to the right edge, vertically centered — detached from the sentence. The compact Mac label (⌘⇧J) fit, so the bug only showed on Windows/Linux. Render the chip as inline text in the title instead of a flex item: short labels stay on one line, wide labels wrap to the next line under the title rather than floating right. whitespace-nowrap keeps the chip from breaking internally; align-middle keeps it aligned with the heading text. Co-authored-by: Orca --- .../feature-tips/CmdJPaletteTipDialog.tsx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/renderer/src/components/feature-tips/CmdJPaletteTipDialog.tsx b/src/renderer/src/components/feature-tips/CmdJPaletteTipDialog.tsx index 27aceab5de5..447ecf1609e 100644 --- a/src/renderer/src/components/feature-tips/CmdJPaletteTipDialog.tsx +++ b/src/renderer/src/components/feature-tips/CmdJPaletteTipDialog.tsx @@ -66,16 +66,21 @@ export function CmdJPaletteTipDialog({ > {tip.eyebrow.toUpperCase()} + {/* Why: flow the shortcut chip as inline text (not a flex item) so the + short Mac label (⌘⇧J) stays on one line, while a wide label like + "Ctrl+Shift+J" wraps to the next line only when it doesn't fit — + instead of being pushed to the right edge on Win/Linux. */} - - {titlePrefix.trimEnd()} - {displayShortcutLabel ? ( - + {titlePrefix.trimEnd()} + {displayShortcutLabel ? ( + <> + {' '} + {displayShortcutLabel} - ) : null} - {titleSuffix ? {titleSuffix} : null} - + + ) : null} + {titleSuffix ? ` ${titleSuffix}` : null} {tip.description}