From 9cdbb38a7745ebf3e4a6caa0fc712e1818dc701d Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 22 Jan 2026 21:05:22 +0000 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20show=20Ctrl=20instead=20of=20?= =?UTF-8?q?=E2=8C=98=20on=20non-Mac=20keyboards=20in=20keyboard=20shortcut?= =?UTF-8?q?=20hints?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The KeyboardShortcutHint component now detects the user's platform and displays 'Ctrl' instead of '⌘' for Windows/Linux users. This fixes the issue where the Reference Guide hint (and other keyboard shortcut hints) incorrectly showed Mac-specific keyboard symbols on non-Mac platforms. Co-authored-by: michael --- .../app/components/keyboardShortcutHint.tsx | 47 +++++++++++++------ 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/packages/web/src/app/components/keyboardShortcutHint.tsx b/packages/web/src/app/components/keyboardShortcutHint.tsx index 8e0e4703b..383743024 100644 --- a/packages/web/src/app/components/keyboardShortcutHint.tsx +++ b/packages/web/src/app/components/keyboardShortcutHint.tsx @@ -1,5 +1,7 @@ -import { cn } from '@/lib/utils' -import React from 'react' +'use client'; + +import { cn, IS_MAC } from '@/lib/utils' +import React, { useMemo } from 'react' interface KeyboardShortcutHintProps { shortcut: string @@ -7,18 +9,33 @@ interface KeyboardShortcutHintProps { className?: string } +/** + * Converts Mac-specific keyboard shortcuts to platform-appropriate shortcuts. + * On Mac: displays the shortcut as-is (e.g., "⌘") + * On Windows/Linux: replaces "⌘" with "Ctrl" + */ +function getPlatformShortcut(shortcut: string): string { + if (IS_MAC) { + return shortcut; + } + // Replace Mac Command key symbol with Ctrl for non-Mac platforms + return shortcut.replace(/⌘/g, 'Ctrl'); +} + export function KeyboardShortcutHint({ shortcut, label, className }: KeyboardShortcutHintProps) { - return ( -
- - {shortcut} - -
- ) + const platformShortcut = useMemo(() => getPlatformShortcut(shortcut), [shortcut]); + + return ( +
+ + {platformShortcut} + +
+ ) } From 031695d8a14936b4d7a5c19eac954b1ba2356b92 Mon Sep 17 00:00:00 2001 From: msukkari Date: Thu, 22 Jan 2026 13:12:11 -0800 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1301323ec..0c4bb0a75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Added `isBranchFilteringEnabled` flag to `search_finished` PostHog event. [#781](https://github.com/sourcebot-dev/sourcebot/pull/781) +### Fixed +- Fixed reference guide key hint for PC [#782](https://github.com/sourcebot-dev/sourcebot/pull/782) + ## [4.10.15] - 2026-01-22 ### Fixed