You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(core): read a blank client-hints platform as unknown, not as non-Apple
`isApplePlatform()` in `useHotkeys` and `detectMac()` in `Kbd` both prefer
`navigator.userAgentData.platform` and fall back to `navigator.platform`.
The guard on that preference was `'platform' in uaData`, true whenever the
key exists at all, blank or not. A build reporting `platform: ''` committed
to the client-hints branch, evaluated `/mac/i.test('')`, and got `false`
without ever reaching the fallback that would have answered correctly. An
empty string was read as "not Apple" rather than as "no answer".
Electron and other embedders that rewrite the app's user-agent or
client-hints identity ship exactly that. On macOS every `mod` combo
registered through `useHotkeys` listened for Ctrl instead of Cmd, and every
`<Kbd>` drew Ctrl. Both surfaces agreed with each other, so nothing looked
broken: the shortcut never fired, and the hint named the key that also did
not work.
A blank platform now falls through to `navigator.platform`. Both call sites
change in this one commit, since the `useHotkeys` docstring states it
mirrors the detection used by `Kbd` so displayed and handled shortcuts
agree.
Fixes#5253
0 commit comments