Skip to content

fix: show platform-specific shortcut labels in toolbar tooltips - #135

Open
shrutig-blip wants to merge 1 commit into
Rinava:mainfrom
shrutig-blip:fix/issue-41-platform-shortcuts-clean
Open

fix: show platform-specific shortcut labels in toolbar tooltips#135
shrutig-blip wants to merge 1 commit into
Rinava:mainfrom
shrutig-blip:fix/issue-41-platform-shortcuts-clean

Conversation

@shrutig-blip

Copy link
Copy Markdown
Contributor

Summary

Fixes platform-specific shortcut labels in the Markdown toolbar tooltips.

The keyboard shortcut handler already detects the user's platform and uses Ctrl on Windows/Linux and on macOS, but the toolbar tooltips always displayed macOS shortcuts. This change derives the tooltip labels from the same platform check so they accurately reflect the shortcuts available on the current OS.

Changes

  • Detect the current platform (macOS vs Windows/Linux).
  • Display in tooltip labels on macOS.
  • Display Ctrl in tooltip labels on Windows/Linux.
  • Keep tooltip labels consistent with the existing keyboard shortcut behavior.

Closes #41

@vercel

vercel Bot commented Jul 18, 2026

Copy link
Copy Markdown

@shrutig-blip is attempting to deploy a commit to the rinava's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Rinava
Rinava force-pushed the fix/issue-41-platform-shortcuts-clean branch from e5d3ffc to abbeea4 Compare August 13, 2026 23:09
@Rinava

Rinava commented Aug 13, 2026

Copy link
Copy Markdown
Owner

@shrutig-blip rather than leave this stranded behind the Prettier landing, I took it over the line myself — rebuilt on today's main so the diff is just the fix. Your July requote is what's now on main, which is why the old branch had gone all-conflicts; the reconstruction drops that noise and keeps only the label change (16/−12, still under your authorship).

What's in it:

  • a shared isMac / modifierKey at the top (guarded with typeof navigator for the SSR prerender), and the tooltip shortcut labels derived from it — so Windows/Linux finally see Ctrl… while macOS keeps ⌘…;
  • pointed the existing key handler at that same isMac instead of its own local navigator.platform copy, so there's one source of truth now.

One deliberate departure from your version: I left the trackShortcut() event names as Cmd+… rather than making them platform-specific — otherwise the metric forks across Cmd+B / Ctrl+B and we lose continuity with everything logged so far. Only the visible tooltip varies now. Shout if you actually meant those to diverge and I'll flip it back.

Verified locally and in CI — format:check, lint, 87/87 tests, and build all green. (The red Vercel check is just the fork-deploy authorization notice, as always — the real gate is "Lint and build", which passed.)

Heads-up: I force-pushed onto your branch, so git fetch and hard-reset to origin before you touch it locally again. Nothing else needed from you — clean fix, and sorry it sat this long.

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.

Toolbar shortcut tooltips hardcode ⌘ — show Ctrl on Windows/Linux

2 participants