Description
useHotkeys and Kbd take the same '+'-separated combo string, but each keeps its own key vocabulary. useHotkeys resolves aliases through KEY_ALIASES (esc, space, up, down, left, right, return, plus) and accepts mod/ctrl/meta/alt/shift as modifiers. Kbd resolves through KEY_DISPLAY and KEY_LABEL, a different set, and falls back to key.toUpperCase() for anything it does not recognise.
Where the two sets differ, the shortcut works and the hint is wrong:
| combo |
useHotkeys |
Kbd renders |
return |
fires on Enter |
RETURN, not ↵ |
meta |
valid modifier |
META |
esc |
fires on Escape |
ESC (the map has escape → Esc) |
space |
fires on Space |
SPACE |
Same failure mode as #5253: the handler and the hint disagree, and because the hint looks plausible, nothing reads as broken. #5253 was two copies of one platform check; this is two copies of one key vocabulary.
Suggested direction: one vocabulary both surfaces read, the way isApplePlatform became one detection in #5394.
Reproduction
useHotkeys([{keys: 'return', onPress: doThing}]); // fires on Enter
<Kbd keys="return" /> // renders "RETURN"
Same for meta, esc, and space.
Astryx Version
@astryxdesign/core@0.4.7
Environment
Any browser and OS. Not platform dependent.
Diagnosis and draft prepared with Claude Code; reviewed and verified by the contributor before filing.
Description
useHotkeysandKbdtake the same'+'-separated combo string, but each keeps its own key vocabulary.useHotkeysresolves aliases throughKEY_ALIASES(esc,space,up,down,left,right,return,plus) and acceptsmod/ctrl/meta/alt/shiftas modifiers.Kbdresolves throughKEY_DISPLAYandKEY_LABEL, a different set, and falls back tokey.toUpperCase()for anything it does not recognise.Where the two sets differ, the shortcut works and the hint is wrong:
useHotkeysKbdrendersreturnRETURN, not ↵metaMETAescESC(the map hasescape→Esc)spaceSPACESame failure mode as #5253: the handler and the hint disagree, and because the hint looks plausible, nothing reads as broken. #5253 was two copies of one platform check; this is two copies of one key vocabulary.
Suggested direction: one vocabulary both surfaces read, the way
isApplePlatformbecame one detection in #5394.Reproduction
Same for
meta,esc, andspace.Astryx Version
@astryxdesign/core@0.4.7Environment
Any browser and OS. Not platform dependent.
Diagnosis and draft prepared with Claude Code; reviewed and verified by the contributor before filing.