Skip to content

[blog-website]: Improve Search Shortcut Display Based on User Operating System (Ctrl + K vs Cmd + K) #3439

@Abhi0049k

Description

@Abhi0049k

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 Cmd instead of Ctrl for keyboard shortcuts.

  • Displaying Ctrl + K on 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions