diff --git a/client/public/version.js b/client/public/version.js index 254afb9..668f82c 100644 --- a/client/public/version.js +++ b/client/public/version.js @@ -1,5 +1,5 @@ // Maintainer-controlled web client version. // Format: YYYY.MM.DD Rn (example: 2026.02.20 R2) -window.CHGRID_WEB_VERSION = "2026.03.08 R336"; +window.CHGRID_WEB_VERSION = "2026.03.08 R337"; // Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid. window.CHGRID_TIME_ZONE = "America/Detroit"; diff --git a/client/src/input/commandTypes.ts b/client/src/input/commandTypes.ts index 3134fb6..a03b4ca 100644 --- a/client/src/input/commandTypes.ts +++ b/client/src/input/commandTypes.ts @@ -1,3 +1,5 @@ +import { describeCharacter } from './textInput'; + export type ModeInput = { code: string; key: string; @@ -13,7 +15,22 @@ export type CommandDescriptor = { section: string; }; +function formatShortcutToken(token: string): string { + const trimmed = token.trim(); + if (trimmed.length === 1) { + return describeCharacter(trimmed); + } + return trimmed; +} + +export function formatCommandShortcut(shortcut: string): string { + return shortcut + .split('+') + .map((token) => formatShortcutToken(token)) + .join('+'); +} + /** Formats a palette/menu label as `Name: Key`. */ export function formatCommandMenuLabel(command: Pick): string { - return `${command.label}: ${command.shortcut}`; + return `${command.label}: ${formatCommandShortcut(command.shortcut)}`; }