Skip to content

Conversation

@msukkari
Copy link
Contributor

@msukkari msukkari commented Jan 22, 2026

This PR will make it so the KeyBoardShortcutHint accepts the same format as react hotkeys. The displayed symbol is then mapped based on the platform

FIxes #783

Summary by CodeRabbit

  • Bug Fixes
    • Fixed keyboard shortcut hints throughout the UI to display correctly on all platforms
    • Updated shortcut display text to use standardized cross-platform notation (e.g., "mod+b", "shift+a", "alt+f12") instead of Mac-only symbols like ⌘ and ⇧
    • All keyboard shortcuts now render with the appropriate notation for the user's operating system

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

Walkthrough

This PR updates keyboard shortcut display throughout the UI to be platform-aware. Changes include replacing platform-specific symbol notation (⌘, ⌥, ⇧, ↵) with cross-platform text notation (mod, alt, shift, enter) in UI components, and implementing a platform-aware mapping system in the KeyboardShortcutHint component to convert these notations to platform-appropriate display strings.

Changes

Cohort / File(s) Summary
Core Shortcut System
packages/web/src/app/components/keyboardShortcutHint.tsx
Introduced platform-aware key mapping with MAC_KEY_MAP and WINDOWS_KEY_MAP to convert generic terms (mod, ctrl, alt, shift, enter) and special keys (arrows, function keys) to platform-appropriate symbols or display names. Replaced simple passthrough logic with comprehensive mapKey helper and updated getPlatformShortcut to split, map, and join shortcut strings.
Search Interface
packages/web/src/app/[domain]/components/searchBar/searchSuggestionsBox.tsx, packages/web/src/app/[domain]/components/searchModeSelector.tsx, packages/web/src/app/[domain]/components/syntaxReferenceGuideHint.tsx, packages/web/src/app/[domain]/search/components/searchResultsPage.tsx
Updated keyboard shortcut hints from symbol notation (⌘ P, ⌘ I, ↵) to cross-platform text format (mod+p, mod+i, enter).
Navigation UI
packages/web/src/app/[domain]/browse/components/bottomPanel.tsx, packages/web/src/app/[domain]/chat/components/chatSidePanel.tsx, packages/web/src/features/fileTree/components/fileTreePanel.tsx
Updated shortcut displays from Mac symbols (⌘ E, ⌘ B, ⇧ ⌘ E) to cross-platform format (shift+mod+e, mod+b).
Code Navigation
packages/web/src/ee/features/codeNav/components/exploreMenu/index.tsx, packages/web/src/ee/features/codeNav/components/symbolHoverPopup/index.tsx
Updated shortcut hints from symbolic glyphs (⌥ F12, ⌥ ⇧ F12, ⇧ A) to text-based aliases (alt+f12, alt+shift+f12, shift+a).
Documentation
CHANGELOG.md
Added Unreleased Fixed entry documenting the hotkey mapping fix across the platform.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: updating hotkey display to map platform-appropriately across the UI.
Linked Issues check ✅ Passed The PR addresses the linked issue #783 by implementing platform-aware keyboard shortcut mapping in the UI, ensuring hotkeys display correctly for PC users.
Out of Scope Changes check ✅ Passed All changes directly support the objective of fixing hotkey display across platforms; the CHANGELOG update and UI text modifications are all within scope.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

This comment has been minimized.

@msukkari msukkari merged commit 6f22ffa into main Jan 22, 2026
9 checks passed
@msukkari msukkari deleted the michael/sou-257-bug-properly-display-hotkeys-for-pc branch January 22, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Properly display hotkeys for PC

2 participants