Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
Keyboard-nav polish — implementation plan
Spec / source: .ai/specs/2026-09-29-keyboard-nav-polish.md
Branch: feat/keyboard-nav-polish (worktree /Users/aashu/work/carbon/carbon-feat-keyboard-nav-polish)
Commits: NONE without explicit user permission (user rule overrides ship-it's per-task commit).
Revision (2026-09-29): Delete has no menu key. Everything below about
delete/Backspace, the Delete confirmation rule, and Delete skips is superseded — see the spec changelog.
Progress
- Task 1: Workflow Runs record names
- Task 2: Go-to keycaps on sidebar rail items
- Task 3: Pagination tooltip labels
- Task 4: Menu shortcut mechanism in @carbon/react (+ unit tests)
- Task 5: Menu keys in the
?overlays + UI conventions doc - Task 6: Roll out
shortcutprops across ERP and MES menus - Task 7: End-to-end verification
Dependencies
Tasks 1, 2, 3, 4 are independent. Task 5 and 6 need Task 4. Task 7 needs all.
Task 1: Workflow Runs record names
Depends on: none Files:
- Modify:
apps/erp/app/routes/x+/workflows+/runs.tsx— loader also returnsrecordNames - Modify:
apps/erp/app/modules/workflows/ui/Runs/WorkflowRunsTable.tsx— acceptrecordNames, passnametoEntityRecordLink, use name inexportValue - Copy from (precedent):
apps/erp/app/routes/x+/workflows+/runs.$runId.tsx:54-57(callsgetWorkflowRunRecordNames),WorkflowRunDetail.tsx:170-177(passesname=)
Steps:
- In the
runs.tsxloader, aftergetWorkflowRuns, buildrefs= distinct{ table: triggerTable, id: triggerRecordId }for rows where both are non-null. CallgetWorkflowRunRecordNames(client, companyId, refs)once (same client/companyId the loader already uses). ReturnrecordNamesalongsidedata/count. Import it from the same placeruns.$runId.tsxdoes. - Pass
recordNamesfrom the route component to<WorkflowRunsTable>; addrecordNames: Record<string, string>to its props. - In the Record column cell:
const name = recordNames[${triggerTable}:${triggerRecordId}]→<EntityRecordLink table={triggerTable} id={triggerRecordId} name={name} />. The columnuseMemodeps must includerecordNames. exportValue:name ??${row.triggerTable} ${row.triggerRecordId}`` (keep "" when no record).
- If
getWorkflowRunRecordNames's return shape is not a"table:id"-keyed record, STOP and report.
Verify:
pnpm exec turbo run typecheck --filter=erp
# Expected: Tasks: ... successful, no errors
Out of scope: EntityRecordLink internals, the run detail drawer, the service function.
Task 2: Go-to keycaps on sidebar rail items
Depends on: none Files:
- Modify:
apps/erp/app/components/Layout/Navigation/PrimaryNavigation.tsx - Copy from (precedent): the Search button's ⌘K badge in the same file (
ShortcutKey variant="small"withgroup-data-[state=expanded]:opacity-100, ~lines 304-311)
Steps:
- Add optional prop
goToKey?: stringtoNavigationIconButtonProps. - Everywhere
NavigationIconLinkis rendered for a module (thelinks.map, the sortable item if it rendersNavigationIconLink, and Settings), passgoToKey={MODULE_GO_TO[link.key]}. - In
NavigationIconLink, whengoToKeyis set, render after the label span:
If Tailwind's stacked group variants (<span aria-hidden className={cn( "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-0.5", "opacity-0 transition-opacity duration-100", "group-data-[state=expanded]:group-hover/item:opacity-100", "group-data-[state=expanded]:group-focus-visible/item:opacity-100" )}> <ShortcutKey shortcut={MODULE_GO_TO_PREFIX} variant="small" className="mx-0" /> <ShortcutKey shortcut={goToKey} variant="small" className="mx-0" /> </span>group-data-[...]:group-hover/item:) don't apply at runtime, usegroup-hover/item:opacity-100alone plus hiding the whole span withgroup-data-[state=collapsed]:hidden. - Hide the hints while
editMode.isEditing(shortcuts are disabled then).
Verify:
pnpm exec turbo run typecheck --filter=erp
# Expected: success
Manual (Task 7): hover Items in expanded rail → G T keycaps on that row only.
Out of scope: MODULE_GO_TO letters, MES AppSidebar, MobileNavigation.
Task 3: Pagination tooltip labels
Depends on: none Files:
- Modify:
apps/erp/app/components/Table/components/Pagination/Pagination.tsx - Copy from (precedent):
apps/erp/app/components/Layout/Navigation/DetailSidebar.tsx:53-80(TooltipContent with text +ShortcutKey)
Steps:
- In all four
TooltipContents (condensed prev/next, full prev/next) render<div className="flex items-center gap-2"><Trans>Previous page</Trans><ShortcutKey shortcut={PAGINATION_SHORTCUTS.previous} variant="small" /></div>(andNext page/.next). Match DetailSidebar's markup if it differs.
Verify:
pnpm exec turbo run typecheck --filter=erp
# Expected: success
Out of scope: the double ←/→ binding (harmless, spec Risks), other prev/next buttons outside Pagination.tsx.
Task 4: Menu shortcut mechanism in @carbon/react
Depends on: none Files:
- Modify:
packages/react/src/utils/keyboard.ts— extractisTextEntryTarget - Create:
packages/react/src/utils/menuShortcut.ts - Create:
packages/react/src/__tests__/menuShortcut.test.ts - Modify:
packages/react/src/shortcuts.ts— addMENU_ITEM_SHORTCUTS - Modify:
packages/react/src/Dropdown.tsx—shortcutprop onDropdownMenuItem;onKeyDownonDropdownMenuContent+DropdownMenuSubContent - Modify:
packages/react/src/Context.tsx— same forContextMenuItem,ContextMenuContent,ContextMenuSubContent - Modify:
packages/react/src/Menu.tsx—MenuItempassesshortcutthrough (check its prop type union) - Modify:
packages/react/src/index.tsx— exportMENU_ITEM_SHORTCUTSifshortcuts.tsexports aren't already re-exported wholesale - Copy from (precedent):
packages/react/src/__tests__/useShortcutSequence.test.ts(pure-function tests, node env — no jsdom)
Steps:
keyboard.ts: addexport function isTextEntryTarget(target)= the INPUT/TEXTAREA/SELECT/contenteditable part; makeisEditableTargetcall it first. No behavior change forisEditableTarget.shortcuts.ts:/** One-key shortcuts for menu items — active only while their menu is open. */ export const MENU_ITEM_SHORTCUTS = { edit: "e", rename: "r", pin: "p", duplicate: "c", copy: "c", download: "d", view: "o", open: "o", delete: "backspace" } as const; export type MenuItemShortcut = (typeof MENU_ITEM_SHORTCUTS)[keyof typeof MENU_ITEM_SHORTCUTS];menuShortcut.ts(pure, testable):menuShortcutFromEvent(e: { code: string; key: string; metaKey; ctrlKey; altKey; shiftKey }): string | null→ null if any modifier;"backspace"for keyBackspaceorDelete; lowercase letter for codeKeyA–KeyZ; else null.handleMenuShortcutKeyDown(event: React.KeyboardEvent<HTMLElement>): returns early ifevent.defaultPrevented,isTextEntryTarget(event.target), or(event.target as Element).closest("[role=menu]") !== event.currentTarget. Compute key; queryevent.currentTarget.querySelectorAll('[role=menuitem][data-menu-shortcut="<key>"]:not([data-disabled])'), keep those whoseclosest("[role=menu]") === event.currentTarget; in dev (process.env.NODE_ENV !== "production", match how the package already checks dev — grepuseShortcutKeys.tsduplicate warning) warn if >1; take the first;preventDefault(),stopPropagation(),(item as HTMLElement).click().
DropdownMenuItem/ContextMenuItem: addshortcut?: MenuItemShortcut. When set:data-menu-shortcut={shortcut}and append<DropdownMenuShortcut><ShortcutKey shortcut={shortcut} variant="small" className="mx-0" /></DropdownMenuShortcut>afterchildren(render children explicitly — destructurechildren). Note:asChilditems render a single child, so the keycap cannot be appended — forasChild, set only the data attribute (key still works) and skip the keycap.- If
asChild+ data attribute doesn't land on the rendered element, STOP and report.
- If
- Content components: compose
onKeyDown={(e) => { props.onKeyDown?.(e); handleMenuShortcutKeyDown(e); }}. - Tests (
menuShortcut.test.ts):menuShortcutFromEvent— KeyE→"e", Backspace→"backspace", Delete→"backspace", ctrl+KeyE→null, Digit1→null, Escape→null, shift+KeyE→null.
Verify:
pnpm --filter @carbon/react exec vitest run src/__tests__/menuShortcut.test.ts src/__tests__/useShortcutKeys.test.ts
# Expected: all tests pass
pnpm exec turbo run typecheck --filter=@carbon/react
# Expected: success
Out of scope: Radix typeahead config, ActionMenu trigger, Command palette.
Task 5: Menu keys in the ? overlays + conventions doc
Depends on: 4 Files:
- Modify:
apps/erp/app/components/ShortcutHelp.tsx,apps/mes/app/components/ShortcutHelp.tsx— "Menus" group - Modify:
.claude/rules/conventions-ui.md(§ Keyboard shortcuts),packages/react/AGENTS.md(Shortcuts bullet)
Steps:
- Add group
t\Open menus`with entries: Edit (e), Rename (r), Pin (p), Duplicate or copy (c), Download (d), View or open (o), Delete (backspace) — eachshortcut: MENU_ITEM_SHORTCUTS.x. Import from~/shortcutsif the app file re-exports, else@carbon/react`. - Docs: one paragraph — menu items take
shortcut={MENU_ITEM_SHORTCUTS.x}; key is live only while the menu is open (handled on menu content, not a document listener); Delete is wired only when it confirms first.
Verify:
pnpm exec turbo run typecheck --filter=erp --filter=mes
# Expected: success
Task 6: Roll out shortcut props across ERP and MES menus
Depends on: 4
Files: every .tsx in apps/erp/app and apps/mes/app with a DropdownMenuItem, ContextMenuItem or MenuItem whose visible label starts with Edit, Rename, Pin, Unpin, Duplicate, Copy, Download, View, Open, Delete.
Steps:
- Inventory:
grep -rlE "(DropdownMenuItem|ContextMenuItem|MenuItem)" apps/erp/app apps/mes/app --include=*.tsx; in each file find items whose label (<Trans>Verb…,t\Verb…`, or plain text) starts with a verb above. Write the inventory to.ai/plans/2026-09-29-keyboard-nav-polish.rollout.md` (file, line, label, key, wired/skipped + reason). - Add only
shortcut={MENU_ITEM_SHORTCUTS.<verb>}to each item. ImportMENU_ITEM_SHORTCUTSfrom@carbon/react. No other edits. - Delete rule: wire Delete only if selecting it opens a confirmation (e.g.
ConfirmDelete, a delete modal/route with a confirm,disclosure.onOpenfor a confirm dialog). If it fires a fetcher/submit that deletes immediately, skip and record the reason. - Per-menu conflict rule: if two items in the same menu would get the same key (e.g. Copy + Duplicate, View + Open), wire only the first and record the skip.
- Items using
DropdownMenuCheckboxItem/RadioItem, or menus inside inputs/comboboxes, are skipped. - Can be split by module across parallel subagents (disjoint file sets).
Verify:
pnpm exec turbo run typecheck --filter=erp --filter=mes
# Expected: success
pnpm run lint
# Expected: no new errors
Out of scope: changing labels, icons, handlers, or menu structure; adding shortcuts to other verbs.
Task 7: End-to-end verification
Depends on: 1–6 Steps:
pnpm --filter @carbon/react test— all pass.- Run the ERP app (use the
runskill / project dev command; needs.env.localfrom dev tooling) and check every acceptance criterion in the spec with agent-browser: runs page names + links, rail keycaps + G T, pager tooltips, row menu E / Backspace, closed-menu no-op, submenu scoping, typeahead fallthrough,?overlay group. - If the app can't be run (DB/stack not up), report BLOCKED with the exact error — do not claim done.