/** * The `?` keyboard-shortcut sheet (weave-workspace §11 P4). * * Props in, JSX out. The rows come from `keyHelp` in `keys.model.ts` — the * same module the map itself is built from, so the sheet cannot document a * key the code does not implement — and the trap is `useFocusTrap`. There is * no branch in this file. * * `Escape` is not handled here: the global listener already answers it with * `closeOverlay` whenever an overlay is open, and a second handler claiming * the same key is how a dialog ends up closing twice. */ import { useFocusTrap } from "./FocusTrap"; import type { KeyHelpGroup } from "./keys.model"; import { HELP_HINT, HELP_TITLE, keyHelp } from "./keys.model"; export interface HelpOverlayProps { /** `⌘K` or `Ctrl K`, from `searchShortcut`. */ shortcut: string; onClose: () => void; } function Group({ group }: { group: KeyHelpGroup }) { return (

{group.title}

{group.entries.map((entry) => (
{entry.combo} {entry.what}
))}
); } export function HelpOverlay(props: HelpOverlayProps) { const trap = useFocusTrap(); // `⌘K` reduced to `⌘` / `Ctrl `: the sheet composes its own combinations. const cmd = props.shortcut.slice(0, -1); return (
); }