// Command-registry grouping for the help overlay. Moved out of help.ts (whose // imperative DOM overlay #253 deleted) so HelpOverlay.tsx renders the same // grouping the vanilla overlay did. import { publishedCommands, type Command } from "../../commands.js"; /** Published commands bucketed by `group`, in registry order — the order the * overlay lists them in. */ export function groupedCommands(): { title: string; items: Command[] }[] { const groups: { title: string; items: Command[] }[] = []; for (const cmd of publishedCommands()) { let group = groups.find((g) => g.title === cmd.group); if (!group) { group = { title: cmd.group, items: [] }; groups.push(group); } group.items.push(cmd); } return groups; }