Skip to content

Commit 1a574d7

Browse files
committed
fix(webapp): keep the keyboard shortcut hint on the Help & Feedback Shortcuts item
The popover restyle dropped the "⇧ ?" hint that the old button rendered via its shortcut prop. Add a trailing slot to SideMenuItemButton and pass the ShortcutKey so the hint is shown again.
1 parent 08c2ab7 commit 1a574d7

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

apps/webapp/app/components/Shortcuts.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ export function Shortcuts() {
1111
return (
1212
<Sheet>
1313
<SheetTrigger asChild>
14-
<SideMenuItemButton icon={KeyboardIcon} name="Shortcuts" data-action="shortcuts" />
14+
<SideMenuItemButton
15+
icon={KeyboardIcon}
16+
name="Shortcuts"
17+
data-action="shortcuts"
18+
trailing={<ShortcutKey shortcut={{ modifiers: ["shift"], key: "?" }} variant="medium" />}
19+
/>
1520
</SheetTrigger>
1621
<ShortcutContent />
1722
</Sheet>

apps/webapp/app/components/navigation/SideMenuItem.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ export function SideMenuItem({
174174
*/
175175
export const SideMenuItemButton = forwardRef<
176176
HTMLButtonElement,
177-
{ icon: RenderIcon; name: string } & ButtonHTMLAttributes<HTMLButtonElement>
178-
>(function SideMenuItemButton({ icon, name, className, type, ...props }, ref) {
177+
{ icon: RenderIcon; name: string; trailing?: ReactNode } & ButtonHTMLAttributes<HTMLButtonElement>
178+
>(function SideMenuItemButton({ icon, name, trailing, className, type, ...props }, ref) {
179179
return (
180180
<button
181181
ref={ref}
@@ -190,9 +190,10 @@ export const SideMenuItemButton = forwardRef<
190190
icon={icon}
191191
className="size-5 shrink-0 text-text-dimmed group-hover/menuitem:text-text-bright"
192192
/>
193-
<span className="min-w-0 select-none truncate text-[0.90625rem] font-medium tracking-[-0.01em]">
193+
<span className="min-w-0 flex-1 select-none truncate text-[0.90625rem] font-medium tracking-[-0.01em]">
194194
{name}
195195
</span>
196+
{trailing && <span className="flex shrink-0 items-center gap-1">{trailing}</span>}
196197
</button>
197198
);
198199
});

0 commit comments

Comments
 (0)