-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Description
Currently, the search option in the blog navbar displays the shortcut as Ctrl + K for all users. On macOS, the standard and expected shortcut convention is Cmd (⌘) + K, but the UI still shows Ctrl + K, which creates a minor usability and UX inconsistency.
To improve platform alignment and user clarity, the shortcut hint should be rendered conditionally based on the user’s operating system.
Problem Statement
-
macOS users typically use
Cmdinstead ofCtrlfor keyboard shortcuts. -
Displaying
Ctrl + Kon macOS can be misleading, even if the underlying shortcut works. -
This affects polish, accessibility, and overall developer/user experience.
Proposed Solution
Introduce OS-based conditional rendering for the shortcut label:
-
macOS → display
⌘ K -
Windows / Linux → display
Ctrl + K
This can be achieved by detecting the platform at runtime using:
-
navigator.platform -
or
navigator.userAgent -
or a utility/helper abstraction already present in the codebase (if any)
Expected Behavior
| Operating System | Shortcut Display |
|---|---|
| macOS | ⌘ K |
| Windows | Ctrl + K |
| Linux | Ctrl + K |
Acceptance Criteria
-
Shortcut label updates dynamically based on OS.
-
No regression in existing search behavior.
-
UI remains consistent with current design.
-
Logic is reusable and easy to extend if more shortcuts are added later.
Additional Notes
This is a small but high-impact UX improvement that aligns the interface with native platform conventions and improves clarity for macOS users.
Note: I am interested in implementing this enhancement and can follow up with a Pull Request.