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.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
chore: spec, plan, rollout list and review for keyboard-nav polish
aashu2116e44b2f2b
diff --git a/.ai/plans/2026-09-29-keyboard-nav-polish.md b/.ai/plans/2026-09-29-keyboard-nav-polish.mdnew file mode 100644index 0000000000..cb1e5c2d94--- /dev/null+++ b/.ai/plans/2026-09-29-keyboard-nav-polish.md@@ -0,0 +1,188 @@+# 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+- [x] Task 1: Workflow Runs record names+- [x] Task 2: Go-to keycaps on sidebar rail items+- [x] Task 3: Pagination tooltip labels+- [x] Task 4: Menu shortcut mechanism in @carbon/react (+ unit tests)+- [x] Task 5: Menu keys in the `?` overlays + UI conventions doc+- [x] Task 6: Roll out `shortcut` props 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 returns `recordNames`+- Modify: `apps/erp/app/modules/workflows/ui/Runs/WorkflowRunsTable.tsx` — accept `recordNames`, pass `name` to `EntityRecordLink`, use name in `exportValue`+- Copy from (precedent): `apps/erp/app/routes/x+/workflows+/runs.$runId.tsx:54-57` (calls `getWorkflowRunRecordNames`), `WorkflowRunDetail.tsx:170-177` (passes `name=`)++**Steps:**+1. In the `runs.tsx` loader, after `getWorkflowRuns`, build `refs` = distinct `{ table: triggerTable, id: triggerRecordId }` for rows where both are non-null. Call `getWorkflowRunRecordNames(client, companyId, refs)` once (same client/companyId the loader already uses). Return `recordNames` alongside `data`/`count`. Import it from the same place `runs.$runId.tsx` does.+2. Pass `recordNames` from the route component to `<WorkflowRunsTable>`; add `recordNames: Record<string, string>` to its props.+3. In the Record column cell: `const name = recordNames[`${triggerTable}:${triggerRecordId}`]` → `<EntityRecordLink table={triggerTable} id={triggerRecordId} name={name} />`. The column `useMemo` deps must include `recordNames`.+4. `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:**+```bash+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"` with `group-data-[state=expanded]:opacity-100`, ~lines 304-311)++**Steps:**+1. Add optional prop `goToKey?: string` to `NavigationIconButtonProps`.+2. Everywhere `NavigationIconLink` is rendered for a module (the `links.map`, the sortable item if it renders `NavigationIconLink`, and Settings), pass `goToKey={MODULE_GO_TO[link.key]}`.+3. In `NavigationIconLink`, when `goToKey` is set, render after the label span:+ ```tsx+ <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>+ ```+ If Tailwind's stacked group variants (`group-data-[...]:group-hover/item:`) don't apply at runtime, use `group-hover/item:opacity-100` alone plus hiding the whole span with `group-data-[state=collapsed]:hidden`.+4. Hide the hints while `editMode.isEditing` (shortcuts are disabled then).++**Verify:**+```bash+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:**+1. In all four `TooltipContent`s (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>` (and `Next page` / `.next`). Match DetailSidebar's markup if it differs.++**Verify:**+```bash+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` — extract `isTextEntryTarget`+- Create: `packages/react/src/utils/menuShortcut.ts`+- Create: `packages/react/src/__tests__/menuShortcut.test.ts`+- Modify: `packages/react/src/shortcuts.ts` — add `MENU_ITEM_SHORTCUTS`+- Modify: `packages/react/src/Dropdown.tsx` — `shortcut` prop on `DropdownMenuItem`; `onKeyDown` on `DropdownMenuContent` + `DropdownMenuSubContent`+- Modify: `packages/react/src/Context.tsx` — same for `ContextMenuItem`, `ContextMenuContent`, `ContextMenuSubContent`+- Modify: `packages/react/src/Menu.tsx` — `MenuItem` passes `shortcut` through (check its prop type union)+- Modify: `packages/react/src/index.tsx` — export `MENU_ITEM_SHORTCUTS` if `shortcuts.ts` exports aren't already re-exported wholesale+- Copy from (precedent): `packages/react/src/__tests__/useShortcutSequence.test.ts` (pure-function tests, node env — no jsdom)++**Steps:**+1. `keyboard.ts`: add `export function isTextEntryTarget(target)` = the INPUT/TEXTAREA/SELECT/contenteditable part; make `isEditableTarget` call it first. No behavior change for `isEditableTarget`.+2. `shortcuts.ts`:+ ```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];+ ```+3. `menuShortcut.ts` (pure, testable):+ - `menuShortcutFromEvent(e: { code: string; key: string; metaKey; ctrlKey; altKey; shiftKey }): string | null` → null if any modifier; `"backspace"` for key `Backspace` or `Delete`; lowercase letter for code `KeyA`–`KeyZ`; else null.+ - `handleMenuShortcutKeyDown(event: React.KeyboardEvent<HTMLElement>)`: returns early if `event.defaultPrevented`, `isTextEntryTarget(event.target)`, or `(event.target as Element).closest("[role=menu]") !== event.currentTarget`. Compute key; query `event.currentTarget.querySelectorAll('[role=menuitem][data-menu-shortcut="<key>"]:not([data-disabled])')`, keep those whose `closest("[role=menu]") === event.currentTarget`; in dev (`process.env.NODE_ENV !== "production"`, match how the package already checks dev — grep `useShortcutKeys.ts` duplicate warning) warn if >1; take the first; `preventDefault()`, `stopPropagation()`, `(item as HTMLElement).click()`.+4. `DropdownMenuItem` / `ContextMenuItem`: add `shortcut?: MenuItemShortcut`. When set: `data-menu-shortcut={shortcut}` and append `<DropdownMenuShortcut><ShortcutKey shortcut={shortcut} variant="small" className="mx-0" /></DropdownMenuShortcut>` after `children` (render children explicitly — destructure `children`). Note: `asChild` items render a single child, so the keycap cannot be appended — for `asChild`, 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.+5. Content components: compose `onKeyDown={(e) => { props.onKeyDown?.(e); handleMenuShortcutKeyDown(e); }}`.+6. Tests (`menuShortcut.test.ts`): `menuShortcutFromEvent` — KeyE→"e", Backspace→"backspace", Delete→"backspace", ctrl+KeyE→null, Digit1→null, Escape→null, shift+KeyE→null.++**Verify:**+```bash+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:**+1. 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) — each `shortcut: MENU_ITEM_SHORTCUTS.x`. Import from `~/shortcuts` if the app file re-exports, else `@carbon/react`.+2. 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:**+```bash+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:**+1. 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).+2. Add only `shortcut={MENU_ITEM_SHORTCUTS.<verb>}` to each item. Import `MENU_ITEM_SHORTCUTS` from `@carbon/react`. No other edits.+3. **Delete rule:** wire Delete only if selecting it opens a confirmation (e.g. `ConfirmDelete`, a delete modal/route with a confirm, `disclosure.onOpen` for a confirm dialog). If it fires a fetcher/submit that deletes immediately, skip and record the reason.+4. **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.+5. Items using `DropdownMenuCheckboxItem`/`RadioItem`, or menus inside inputs/comboboxes, are skipped.+6. Can be split by module across parallel subagents (disjoint file sets).++**Verify:**+```bash+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:**+1. `pnpm --filter @carbon/react test` — all pass.+2. Run the ERP app (use the `run` skill / project dev command; needs `.env.local` from 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.+3. If the app can't be run (DB/stack not up), report BLOCKED with the exact error — do not claim done.diff --git a/.ai/plans/2026-09-29-keyboard-nav-polish.rollout.md b/.ai/plans/2026-09-29-keyboard-nav-polish.rollout.mdnew file mode 100644index 0000000000..750725e06a--- /dev/null+++ b/.ai/plans/2026-09-29-keyboard-nav-polish.rollout.md@@ -0,0 +1,213 @@+# Keyboard-nav polish — menu shortcut rollout++Every menu item across `apps/erp` and `apps/mes` that got a key in Task 6 of `2026-09-29-keyboard-nav-polish.md`. Keys are `MENU_ITEM_SHORTCUTS.<key>`. Delete items get no key (a user decision), so none are listed.++**205 items.**++| file | label | key |+|---|---|---|+| apps/erp/app/components/DefaultAttachmentsPanel.tsx | Download | download |+| apps/erp/app/components/Documents.tsx | Download | download |+| apps/erp/app/components/Documents.tsx | Download | download |+| apps/erp/app/components/Documents.tsx | View | view |+| apps/erp/app/components/RecordDocuments.tsx | Download | download |+| apps/erp/app/components/RecordDocuments.tsx | View in new tab | view |+| apps/erp/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountsTree.tsx | Edit (account menu) | edit |+| apps/erp/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountsTree.tsx | Edit Group | edit |+| apps/erp/app/modules/accounting/ui/CostCenters/CostCenterNode.tsx | Edit | edit |+| apps/erp/app/modules/accounting/ui/CostCenters/CostCentersListView.tsx | Edit | edit |+| apps/erp/app/modules/accounting/ui/Dimensions/DimensionsTable.tsx | Edit Dimension | edit |+| apps/erp/app/modules/accounting/ui/ExchangeRates/ExchangeRatesTable.tsx | Edit Currency | edit |+| apps/erp/app/modules/accounting/ui/FixedAssets/AssetClassesTable.tsx | Edit Asset Class | edit |+| apps/erp/app/modules/accounting/ui/FixedAssets/DepreciationRunTable.tsx | View Run | view |+| apps/erp/app/modules/accounting/ui/FixedAssets/FixedAssetsTable.tsx | Edit Asset / View Asset (ternary) | edit / view (same ternary) |+| apps/erp/app/modules/accounting/ui/JournalEntries/JournalEntriesTable.tsx | Edit Journal Entry / View Journal Entry (ternary) | edit / view (same ternary) |+| apps/erp/app/modules/accounting/ui/PaymentTerms/PaymentTermsTable.tsx | Edit Payment Term | edit |+| apps/erp/app/modules/accounting/ui/Periods/PeriodsTable.tsx | View Period (only when Closed; else Close Period) | view when closed, else none |+| apps/erp/app/modules/accounting/ui/Projects/ProjectsTable.tsx | Edit Project | edit |+| apps/erp/app/modules/documents/ui/Documents/DocumentsTable.tsx | Download | download |+| apps/erp/app/modules/documents/ui/Documents/DocumentsTable.tsx | Edit | edit |+| apps/erp/app/modules/inventory/ui/Batches/BatchPropertiesConfig.tsx | Edit | edit |+| apps/erp/app/modules/inventory/ui/InventoryCount/InventoryCountsTable.tsx | Edit Count / View Count | edit |+| apps/erp/app/modules/inventory/ui/Kanbans/KanbansTable.tsx | Edit | edit |+| apps/erp/app/modules/inventory/ui/Kanbans/KanbansTable.tsx | View Item Master | view |+| apps/erp/app/modules/inventory/ui/PickingLists/PickingListsTable.tsx | View Picking List / Edit Picking List | view |+| apps/erp/app/modules/inventory/ui/Receipts/ReceiptsTable.tsx | View Receipt / Edit Receipt | view |+| apps/erp/app/modules/inventory/ui/Shipments/ShipmentsTable.tsx | View Shipment / Edit Shipment | view |+| apps/erp/app/modules/inventory/ui/ShippingMethods/ShippingMethodsTable.tsx | Edit Shipping Method | edit |+| apps/erp/app/modules/inventory/ui/StockTransfers/StockTransferLines.tsx | Edit Line | edit |+| apps/erp/app/modules/inventory/ui/StockTransfers/StockTransfersTable.tsx | View Stock Transfer / Edit Stock Transfer | view |+| apps/erp/app/modules/inventory/ui/StorageRules/StorageRulesGroups.tsx | Edit Rule | edit |+| apps/erp/app/modules/inventory/ui/StorageRules/StorageRulesTable.tsx | Edit Rule | edit |+| apps/erp/app/modules/inventory/ui/StorageTypes/StorageTypesTable.tsx | Edit Storage Type | edit |+| apps/erp/app/modules/inventory/ui/StorageUnits/StorageUnitsTable.tsx | Edit Storage Unit | edit |+| apps/erp/app/modules/inventory/ui/Traceability/TrackedEntitiesTable.tsx | Edit Expiry | edit |+| apps/erp/app/modules/inventory/ui/Traceability/TrackedEntitiesTable.tsx | View Traceability Graph | view |+| apps/erp/app/modules/inventory/ui/WarehouseTransfers/WarehouseTransferLines.tsx | Edit | edit |+| apps/erp/app/modules/inventory/ui/WarehouseTransfers/WarehouseTransfersTable.tsx | View Transfer / Edit Transfer | view |+| apps/erp/app/modules/invoicing/ui/Memo/MemosTable.tsx | Edit Memo / View Memo (conditional) | edit / view by status |+| apps/erp/app/modules/invoicing/ui/Payment/PaymentsTable.tsx | Edit Payment / View Payment (conditional) | edit / view by status |+| apps/erp/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceExplorer.tsx | View Item Master | view |+| apps/erp/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoicesTable.tsx | Edit | edit |+| apps/erp/app/modules/invoicing/ui/SalesInvoice/SalesInvoiceExplorer.tsx | View Item Master | view |+| apps/erp/app/modules/invoicing/ui/SalesInvoice/SalesInvoicesTable.tsx | Edit | edit |+| apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeExplorer.tsx | View Item Master | view |+| apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticesTable.tsx | Edit Change Notice | edit |+| apps/erp/app/modules/items/ui/ChangeNoticeActions/ChangeNoticeRequiredActionsTable.tsx | Edit Action | edit |+| apps/erp/app/modules/items/ui/ChangeNoticeTypes/ChangeNoticeTypesTable.tsx | Edit Type | edit |+| apps/erp/app/modules/items/ui/Consumables/ConsumablesTable.tsx | Edit ConsumableListItem | edit |+| apps/erp/app/modules/items/ui/Item/BillOfProcess.tsx | Duplicate | duplicate |+| apps/erp/app/modules/items/ui/Item/BillOfProcess.tsx | Edit | edit |+| apps/erp/app/modules/items/ui/Item/BillOfProcess.tsx | Edit | edit |+| apps/erp/app/modules/items/ui/Item/BillOfProcess.tsx | Edit | edit |+| apps/erp/app/modules/items/ui/Item/CustomerParts/CustomerParts.tsx | Edit Customer Part | edit |+| apps/erp/app/modules/items/ui/Item/ItemDocuments.tsx | Download | download |+| apps/erp/app/modules/items/ui/Item/ItemDocuments.tsx | Download | download |+| apps/erp/app/modules/items/ui/Item/ItemDocuments.tsx | View | view |+| apps/erp/app/modules/items/ui/Item/ItemForm.tsx | View Item Master | view |+| apps/erp/app/modules/items/ui/Item/MakeMethodTools.tsx | Duplicate Version | duplicate |+| apps/erp/app/modules/items/ui/Item/PickMethodForm.tsx | Open Audit Log | open |+| apps/erp/app/modules/items/ui/Item/UsedIn.tsx | Edit | edit |+| apps/erp/app/modules/items/ui/ItemPostingGroups/ItemPostingGroupsTable.tsx | Edit Item Group | edit |+| apps/erp/app/modules/items/ui/MaterialDimensions/MaterialDimensionsTable.tsx | Edit Material Dimension | edit |+| apps/erp/app/modules/items/ui/MaterialFinishes/MaterialFinishesTable.tsx | Edit Material Finish | edit |+| apps/erp/app/modules/items/ui/MaterialGrades/MaterialGradesTable.tsx | Edit Material Grade | edit |+| apps/erp/app/modules/items/ui/MaterialShapes/MaterialShapesTable.tsx | Edit Material Shape | edit |+| apps/erp/app/modules/items/ui/MaterialSubstances/MaterialSubstanceTable.tsx | Edit Substance | edit |+| apps/erp/app/modules/items/ui/MaterialTypes/MaterialTypesTable.tsx | Edit Material Type | edit |+| apps/erp/app/modules/items/ui/Materials/MaterialsTable.tsx | Edit Material | edit |+| apps/erp/app/modules/items/ui/Parts/ConfigurationParameters.tsx | Edit | edit |+| apps/erp/app/modules/items/ui/Parts/ConfigurationParameters.tsx | Edit | edit |+| apps/erp/app/modules/items/ui/Parts/PartsTable.tsx | Edit Part | edit |+| apps/erp/app/modules/items/ui/Services/ServicesTable.tsx | Edit Service | edit |+| apps/erp/app/modules/items/ui/Tools/ToolsTable.tsx | Edit Tool | edit |+| apps/erp/app/modules/items/ui/UnitOfMeasure/UnitOfMeasuresTable.tsx | Edit Unit of Measure | edit |+| apps/erp/app/modules/people/ui/Attributes/AttributeCategoriesTable.tsx | Edit Category | edit |+| apps/erp/app/modules/people/ui/Attributes/AttributeCategoriesTable.tsx | View Attributes | view |+| apps/erp/app/modules/people/ui/Attributes/AttributeCategoryDetail.tsx | Edit Attribute | edit |+| apps/erp/app/modules/people/ui/Departments/DepartmentNode.tsx | Edit | edit |+| apps/erp/app/modules/people/ui/Departments/DepartmentsListView.tsx | Edit | edit |+| apps/erp/app/modules/people/ui/Departments/DepartmentsTable.tsx | Edit Department | edit |+| apps/erp/app/modules/people/ui/Holidays/HolidaysTable.tsx | Edit Holiday | edit |+| apps/erp/app/modules/people/ui/People/PeopleTable.tsx | Edit Employee | edit |+| apps/erp/app/modules/people/ui/Shifts/ShiftsTable.tsx | Edit Shift | edit |+| apps/erp/app/modules/people/ui/Timecards/TimecardsTable.tsx | Edit Timecard | edit |+| apps/erp/app/modules/production/ui/Assemblies/AssemblyInstructionHeader.tsx | View Item Master | view |+| apps/erp/app/modules/production/ui/Assemblies/AssemblyInstructionsTable.tsx | Edit Instruction | edit |+| apps/erp/app/modules/production/ui/Batches/BatchDetailDrawer.tsx | View on schedule board | view |+| apps/erp/app/modules/production/ui/Batches/BatchesTable.tsx | View Batch | view |+| apps/erp/app/modules/production/ui/DemandProjection/DemandProjectionTable.tsx | Edit | edit |+| apps/erp/app/modules/production/ui/InspectionDocument/InspectionDocumentEditor.tsx | Download PDF | download |+| apps/erp/app/modules/production/ui/InspectionDocument/InspectionDocumentEditor.tsx | View Item Master | view |+| apps/erp/app/modules/production/ui/InspectionDocument/InspectionDocumentTable.tsx | Edit Diagram | edit |+| apps/erp/app/modules/production/ui/Jobs/JobBillOfProcess.tsx | Duplicate | duplicate |+| apps/erp/app/modules/production/ui/Jobs/JobBillOfProcess.tsx | Edit | edit |+| apps/erp/app/modules/production/ui/Jobs/JobBillOfProcess.tsx | Edit | edit |+| apps/erp/app/modules/production/ui/Jobs/JobBillOfProcess.tsx | Edit | edit |+| apps/erp/app/modules/production/ui/Jobs/JobDocuments.tsx | Download | download |+| apps/erp/app/modules/production/ui/Jobs/JobDocuments.tsx | Download | download |+| apps/erp/app/modules/production/ui/Jobs/JobDocuments.tsx | View | view |+| apps/erp/app/modules/production/ui/Jobs/JobsTable.tsx | Edit Job | edit |+| apps/erp/app/modules/production/ui/Jobs/ProductionEventsTable.tsx | Edit Event | edit |+| apps/erp/app/modules/production/ui/Jobs/ProductionQuantitiesTable.tsx | Edit Quantity | edit |+| apps/erp/app/modules/production/ui/Procedures/ProcedureExplorer.tsx | Edit Parameter | edit |+| apps/erp/app/modules/production/ui/Procedures/ProcedureExplorer.tsx | Edit Step | edit |+| apps/erp/app/modules/production/ui/Procedures/ProceduresTable.tsx | Edit Procedure | edit |+| apps/erp/app/modules/production/ui/Schedule/Kanban/components/BatchItemCard.tsx | Open in MES | open |+| apps/erp/app/modules/production/ui/Schedule/Kanban/components/ItemCard.tsx | Edit Operation | edit |+| apps/erp/app/modules/production/ui/Schedule/Kanban/components/ItemCard.tsx | Open in MES | open |+| apps/erp/app/modules/production/ui/Schedule/Kanban/components/JobCard.tsx | Edit Job | edit |+| apps/erp/app/modules/production/ui/ScrapReasons/ScrapReasonsTable.tsx | Edit Scrap Reason | edit |+| apps/erp/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderExplorer.tsx | View Item Master | view |+| apps/erp/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrdersTable.tsx | Duplicate | duplicate |+| apps/erp/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrdersTable.tsx | Edit | edit |+| apps/erp/app/modules/purchasing/ui/PurchaseReturnOrders/PurchaseReturnOrdersTable.tsx | Edit | edit |+| apps/erp/app/modules/purchasing/ui/PurchasingRfq/PurchasingRFQsTable.tsx | Edit | edit |+| apps/erp/app/modules/purchasing/ui/Supplier/SupplierBankAccounts.tsx | Edit | edit |+| apps/erp/app/modules/purchasing/ui/Supplier/SupplierProcesses.tsx | Edit Process | edit |+| apps/erp/app/modules/purchasing/ui/Supplier/SuppliersTable.tsx | Edit Supplier | edit |+| apps/erp/app/modules/purchasing/ui/SupplierInteraction/SupplierInteractionDocuments.tsx | Download | download |+| apps/erp/app/modules/purchasing/ui/SupplierInteraction/SupplierInteractionLineDocuments.tsx | Download | download |+| apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteExplorer.tsx | View Item Master | view |+| apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuotesTable.tsx | Edit | edit |+| apps/erp/app/modules/purchasing/ui/SupplierTypes/SupplierTypesTable.tsx | Edit Supplier Type | edit |+| apps/erp/app/modules/purchasing/ui/SupplierTypes/SupplierTypesTable.tsx | View Suppliers | view |+| apps/erp/app/modules/quality/ui/Actions/ActionsTable.tsx | View Issue | view |+| apps/erp/app/modules/quality/ui/Calibrations/GaugeCalibrationRecordsTable.tsx | Edit Record | edit |+| apps/erp/app/modules/quality/ui/Documents/QualityDocumentsTable.tsx | Edit Document | edit |+| apps/erp/app/modules/quality/ui/Gauge/GaugeForm.tsx | View | view |+| apps/erp/app/modules/quality/ui/Gauge/GaugesTable.tsx | Edit Gauge | edit |+| apps/erp/app/modules/quality/ui/GaugeTypes/GaugeTypesTable.tsx | Edit Type | edit |+| apps/erp/app/modules/quality/ui/Issue/IssuesTable.tsx | Edit Issue | edit |+| apps/erp/app/modules/quality/ui/IssueTypes/IssueTypesTable.tsx | Edit Type | edit |+| apps/erp/app/modules/quality/ui/IssueWorkflows/IssueWorkflowsTable.tsx | Edit Template | edit |+| apps/erp/app/modules/quality/ui/RequiredActions/RequiredActionsTable.tsx | Edit Action | edit |+| apps/erp/app/modules/quality/ui/RiskRegister/RiskRegistersTable.tsx | Edit Risk | edit |+| apps/erp/app/modules/resources/ui/Abilities/AbilitiesTable.tsx | View Ability | view |+| apps/erp/app/modules/resources/ui/Abilities/AbilityEmployeesTable.tsx | Edit Employee Ability | edit |+| apps/erp/app/modules/resources/ui/Contractors/ContractorsTable.tsx | Edit Contractor | edit |+| apps/erp/app/modules/resources/ui/FailureModes/FailureModesTable.tsx | Edit Failure Mode | edit |+| apps/erp/app/modules/resources/ui/Locations/LocationsTable.tsx | Edit Location | edit |+| apps/erp/app/modules/resources/ui/Maintenance/MaintenanceDispatchExplorer.tsx | Edit | edit |+| apps/erp/app/modules/resources/ui/Maintenance/MaintenanceDispatchNotes.tsx | Download | download |+| apps/erp/app/modules/resources/ui/Maintenance/MaintenanceDispatchesTable.tsx | Edit Dispatch | edit |+| apps/erp/app/modules/resources/ui/MaintenanceSchedule/MaintenanceSchedulesTable.tsx | Edit Schedule | edit |+| apps/erp/app/modules/resources/ui/Partners/PartnersTable.tsx | Edit Partner | edit |+| apps/erp/app/modules/resources/ui/Processes/ProcessForm.tsx | Edit Process | edit |+| apps/erp/app/modules/resources/ui/Processes/ProcessesTable.tsx | Edit Process | edit |+| apps/erp/app/modules/resources/ui/Suggestions/SuggestionsTable.tsx | View Suggestion | view |+| apps/erp/app/modules/resources/ui/Training/TrainingExplorer.tsx | Edit Question | edit |+| apps/erp/app/modules/resources/ui/Training/TrainingsTable.tsx | Edit Training | edit |+| apps/erp/app/modules/resources/ui/WorkCenters/WorkCentersTable.tsx | Edit Work Center | edit |+| apps/erp/app/modules/sales/ui/Customer/CustomerBankAccounts.tsx | Edit | edit |+| apps/erp/app/modules/sales/ui/CustomerPortals/CustomerPortalsTable.ee.tsx | Edit Portal | edit |+| apps/erp/app/modules/sales/ui/CustomerStatuses/CustomerStatusesTable.tsx | Edit Customer Status | edit |+| apps/erp/app/modules/sales/ui/CustomerStatuses/CustomerStatusesTable.tsx | View Customers | view |+| apps/erp/app/modules/sales/ui/CustomerTypes/CustomerTypesTable.tsx | Edit Customer Type | edit |+| apps/erp/app/modules/sales/ui/CustomerTypes/CustomerTypesTable.tsx | View Customers | view |+| apps/erp/app/modules/sales/ui/Customers/CustomersTable.tsx | Edit | edit |+| apps/erp/app/modules/sales/ui/NoQuoteReasons/NoQuoteReasonsTable.tsx | Edit Reason | edit |+| apps/erp/app/modules/sales/ui/Opportunity/OpportunityDocuments.tsx | Download | download |+| apps/erp/app/modules/sales/ui/Opportunity/OpportunityLineDocuments.tsx | Download | download |+| apps/erp/app/modules/sales/ui/Opportunity/OpportunityLineDocuments.tsx | Download | download |+| apps/erp/app/modules/sales/ui/Opportunity/OpportunityLineDocuments.tsx | View | view |+| apps/erp/app/modules/sales/ui/Pricing/PriceOverrideForm.tsx | View History | view |+| apps/erp/app/modules/sales/ui/Pricing/PriceOverridesTable.tsx | Duplicate to... | duplicate |+| apps/erp/app/modules/sales/ui/Pricing/PriceOverridesTable.tsx | Edit Pricing / Set Pricing (conditional) | edit (only when label is edit pricing) |+| apps/erp/app/modules/sales/ui/Pricing/PricingRulesTable.tsx | Duplicate Pricing Rule | duplicate |+| apps/erp/app/modules/sales/ui/Pricing/PricingRulesTable.tsx | Edit Pricing Rule | edit |+| apps/erp/app/modules/sales/ui/Quotes/QuoteBillOfProcess.tsx | Edit | edit |+| apps/erp/app/modules/sales/ui/Quotes/QuoteBillOfProcess.tsx | Edit | edit |+| apps/erp/app/modules/sales/ui/Quotes/QuoteBillOfProcess.tsx | Edit | edit |+| apps/erp/app/modules/sales/ui/Quotes/QuoteExplorer.tsx | View Item Master | view |+| apps/erp/app/modules/sales/ui/Quotes/QuoteHeader.tsx | Copy Quote | copy |+| apps/erp/app/modules/sales/ui/Quotes/QuoteLineForm.tsx | View Item Master | view |+| apps/erp/app/modules/sales/ui/Quotes/QuotesTable.tsx | Edit | edit |+| apps/erp/app/modules/sales/ui/ReturnReasons/ReturnReasonsTable.tsx | Edit Reason | edit |+| apps/erp/app/modules/sales/ui/SalesOrder/SalesOrderExplorer.tsx | View Item Master | view |+| apps/erp/app/modules/sales/ui/SalesOrder/SalesOrdersTable.tsx | Edit | edit |+| apps/erp/app/modules/sales/ui/SalesRFQ/SalesRFQsTable.tsx | Edit | edit |+| apps/erp/app/modules/sales/ui/SalesReturnOrders/SalesReturnOrdersTable.tsx | Edit | edit |+| apps/erp/app/modules/sales/ui/SalesRules/SalesRulesTable.tsx | Edit Rule | edit |+| apps/erp/app/modules/settings/ui/ApiKeys/ApiKeysTable.tsx | Edit API Key | edit |+| apps/erp/app/modules/settings/ui/Approvals/ApprovalRuleCard.ee.tsx | Edit Rule | edit |+| apps/erp/app/modules/settings/ui/CustomFields/CustomFieldsTable.tsx | View Custom Fields | view |+| apps/erp/app/modules/settings/ui/CustomFields/CustomFieldsTableDetail.tsx | Edit Custom Field | edit |+| apps/erp/app/modules/settings/ui/Printing/PrintJobsTable.tsx | View | view |+| apps/erp/app/modules/settings/ui/Sequences/SequencesTable.tsx | Edit Sequence | edit |+| apps/erp/app/modules/settings/ui/SerialNumbers/ItemSerialSequencesTable.tsx | Edit | edit |+| apps/erp/app/modules/settings/ui/Webhooks/WebhooksTable.tsx | Edit Webhook | edit |+| apps/erp/app/modules/users/ui/EmployeeTypes/EmployeeTypesTable.ee.tsx | Edit Employee Type | edit |+| apps/erp/app/modules/users/ui/EmployeeTypes/EmployeeTypesTable.ee.tsx | View Employees | view |+| apps/erp/app/modules/users/ui/Employees/EmployeesTable.tsx | Edit Permissions (bulk actions) | edit |+| apps/erp/app/modules/users/ui/Employees/EmployeesTable.tsx | Edit Permissions (row menu) | edit |+| apps/erp/app/modules/users/ui/Groups/GroupsTable.tsx | Edit Group | edit |+| apps/erp/app/modules/workflows/ui/WorkflowsTable.tsx | Open Workflow | open |+| apps/erp/app/modules/workflows/ui/WorkflowsTable.tsx | Rename Workflow | rename |+| apps/erp/app/routes/x+/fixed-asset+/$fixedAssetId.tsx | Edit | edit |+| apps/erp/app/routes/x+/person+/$personId.timecard.tsx | Edit | edit |+| apps/erp/app/routes/x+/resources+/assignments.tsx | Edit Assignment | edit |+| apps/erp/app/routes/x+/resources+/assignments.tsx | View Status | view |+| apps/mes/app/components/JobOperation/JobOperation.tsx | Download | download |+| apps/mes/app/components/JobOperation/JobOperation.tsx | Download | download |+| apps/mes/app/routes/x+/timecard.tsx | Edit | edit |diff --git a/.ai/research/keyboard-nav-polish.md b/.ai/research/keyboard-nav-polish.mdnew file mode 100644index 0000000000..546fc2ed4a--- /dev/null+++ b/.ai/research/keyboard-nav-polish.md@@ -0,0 +1,32 @@+# Research — keyboard-nav polish (workflow runs record names, go-to nav, pagination tooltips, menu shortcuts)++Base: origin/main @ f474f0f289.++## 1. Workflow Runs — Record column+- Column: `apps/erp/app/modules/workflows/ui/Runs/WorkflowRunsTable.tsx:82-98` renders `<EntityRecordLink table id />` with no `name`.+- `EntityRecordLink.tsx:10-55` label order: `name` prop → inline row snapshot via `fkDisplayRegistry` → raw id. Link target from `getEntityPath(id)` (`apps/erp/app/utils/entity.ts:71`), renders `<Hyperlink>` or plain span when no route.+- Name lookup already exists: `getWorkflowRunRecordNames(client, companyId, refs)` (`workflows.service.ts:386-439`), one query per table, keyed `"table:id"`. Used by the detail drawer (`routes/x+/workflows+/runs.$runId.tsx:54-57`, `WorkflowRunDetail.tsx:170-177`).+- List loader `routes/x+/workflows+/runs.tsx:11-40` never calls it → the list shows "<Table label> <id>".+- Fix: call `getWorkflowRunRecordNames` in the list loader for the page's refs, pass `name` to `EntityRecordLink`, use the same name in `exportValue`.+- Open-record conventions in other tables: plain `<Hyperlink>` (dominant, e.g. `PurchaseOrdersTable.tsx:101-106`); hover-revealed `LuExternalLink` (`DocumentsTable.tsx:208-226`); separate icon link (`TraceabilityTable.tsx:278-287`).++## 2. Left nav G-then-letter — ALREADY ON MAIN+- `apps/erp/app/shortcuts.ts:68-85` `MODULE_GO_TO_PREFIX = "g"`, `MODULE_GO_TO`: a accounting, d documents, i inventory, v invoicing, t parts (Items), o people, r production, p purchasing, q quality, u resources, s sales, e settings, y users, w workflows. Shop Floor (external MES link) has none.+- Wired in `PrimaryNavigation.tsx:62-80` via `useShortcutSequence` (1500 ms window, ignores typing/dialogs/scanner bursts), disabled in rail edit mode.+- Listed in the `?` overlay (`apps/erp/app/components/ShortcutHelp.tsx:35-48`).+- Gap: rail items (`NavigationIconLink`, `PrimaryNavigation.tsx:325-380`) show no hint of the shortcut; no tooltip. Pattern to copy: `DetailSidebar.tsx:53-80` Tooltip + `ShortcutKey`.++## 3. Pagination Prev/Next tooltips+- Only component: `apps/erp/app/components/Table/components/Pagination/Pagination.tsx` (condensed IconButtons in the table header + full Buttons at the bottom).+- Shortcuts already exist: `PAGINATION_SHORTCUTS` ← / → (`shortcuts.ts:58-61`), bound at `Pagination.tsx:113-127`.+- Tooltip content is ONLY `<ShortcutKey shortcut="arrowleft">`, which renders a chevron icon (`ShortcutKey.tsx:36-45`) with no words → reads as "chevron arrow left".+- Fix: tooltip text "Previous page" / "Next page" + the keycap.+- Unverified risk: header and footer both mount `PaginationButtons` → two `useShortcutKeyMap` bindings for the same arrow.++## 4. Dropdown menu shortcuts+- Primitive: `packages/react/src/Dropdown.tsx` (Radix `react-dropdown-menu` 2.1.16). `DropdownMenuShortcut` exists (:197-207) but no app code uses it. `Context.tsx` wraps Radix context menu; `Menu.tsx` is a layer over both (`MenuItem`, `MenuShortcut`, `<Menu type="context"|"dropdown">`).+- ~190 files use DropdownMenu; ~116 look like three-dot "More" menus. Table row menus go through `renderContextMenu` (`Table.tsx:147`), rendered both in the actions column (`ActionMenu`) and as a right-click context menu (`Table.tsx:1325-1355`).+- No per-item shortcuts exist anywhere. Radix typeahead only moves focus to the first item starting with the typed letter — it does not activate it.+- Global hotkeys already stand down inside `[role=menu]` (`packages/react/src/utils/keyboard.ts:7-16`, `useShortcutKeys.ts:251-256`), so menu-scoped letters won't collide with page shortcuts.+- Only existing in-menu keydown: `QuoteLinePricing.tsx:732` (NumberField inside a menu stops propagation) — menu letters must skip editable targets.+- `ShortcutKey` (OS-aware keycap) is never used inside a menu item yet.diff --git a/.ai/reviews/2026-09-29-keyboard-nav-polish-thermo.md b/.ai/reviews/2026-09-29-keyboard-nav-polish-thermo.mdnew file mode 100644index 0000000000..4cd35c50ec--- /dev/null+++ b/.ai/reviews/2026-09-29-keyboard-nav-polish-thermo.md@@ -0,0 +1,95 @@+# Thermo-nuclear review — feat/keyboard-nav-polish++Scope: full uncommitted diff (230 files). Core logic in 10 files; the other 220 carry the mechanical `shortcut={MENU_ITEM_SHORTCUTS.x}` rollout.++**Verdict: not approved yet.** There are no correctness regressions, and no file crossed 1,000 lines (checked every changed file against HEAD). But five behavior-preserving restructures would each delete a moving part rather than move it. Findings 1 and 2 are the big ones.++---++## 1. Workflow Runs: attach the name to the row in the loader; drop the map prop and the ref (code judo)++`runs.tsx` returns a separate `recordNames` map. `WorkflowRunsTable` then:+- takes it as a new prop,+- mirrors it into `recordNamesRef` (so the `[t]`-memoised columns can read it),+- rebuilds the `${triggerTable}:${triggerRecordId}` key twice (once in the cell, once in `exportValue`).++Adding the prop to the `memo(({ data, count }) =>` signature also made biome re-indent the whole component, which is why a ~10-line change shows as **270 changed lines** (`WorkflowRunsTable.tsx`).++**Remedy.** In the loader, map the name onto each row once:++```ts+data: data.map((run) => ({+ ...run,+ recordName: run.triggerTable && run.triggerRecordId+ ? recordNames[`${run.triggerTable}:${run.triggerRecordId}`]+ : undefined+}))+```++The table then reads `row.original.recordName`. This deletes:+- the prop,+- the ref,+- both client-side key builds,+- the reformat noise.++The `table:id` key stays inside the loader, next to the service that defines it.++## 2. Menu keys in the `?` overlay are copy-pasted into both apps; the shared overlay should own them (SSOT)++`apps/erp/.../ShortcutHelp.tsx` and `apps/mes/.../ShortcutHelp.tsx` each gained the same 35-line block of 7 entries. Menu keys are behaviour of `@carbon/react`'s shared menu parts. `ShortcutHelpOverlay` also lives in `@carbon/react` and already uses Lingui (`ShortcutHelpOverlay.tsx:1,47`).++**Remedy.** Build the "In an open menu" group inside `ShortcutHelpOverlay` from `MENU_ITEM_SHORTCUTS`. Revert both app files. That removes 70 duplicated lines and a second source of truth that will drift the first time a verb is added.++## 3. Dropdown and Context carry four copies of the same keydown composition and two copies of the item-body logic++- `DropdownMenuContent`, `DropdownMenuSubContent`, `ContextMenuContent` and `ContextMenuSubContent` each inline the same composition: `onKeyDown={(event) => { onKeyDown?.(event); handleMenuShortcutKeyDown(event); }}`.+- `DropdownMenuItem` and `ContextMenuItem` each inline the same `asChild || !shortcut ? children : <>{children}<Shortcut>…` branch, with a duplicated JSX comment.++**Remedy.** In `utils/menuShortcut.ts`:+- Export `withMenuShortcuts(onKeyDown?)`, which returns the composed handler. Each content component then becomes a one-liner.+- Export a tiny `MenuItemShortcutKey` (the keycap with `mx-0`). Both items render `{children}{shortcut && !asChild && <XShortcut className="pl-4"><MenuItemShortcutKey …/></XShortcut>}`.++The asChild rule is then stated once, in `menuShortcut.ts`, instead of in two JSX comments.++## 4. Sidebar hint: `goToKey` is a pass-through prop the component can derive itself++`NavigationIconLink` already receives `link`, and every caller passes `goToKey={MODULE_GO_TO[link.key]}`. The implementation link (`get-started`) has no entry, so a lookup inside the component yields `undefined`, which is the same as not passing the prop. Changing the `forwardRef` signature also caused another re-indent (`PrimaryNavigation.tsx` shows 126 changed lines).++**Remedy.** Compute `const goToKey = MODULE_GO_TO[link.key]` inside `NavigationIconLink`. Delete the prop, the two call-site edits and the reformat.++## 5. Pagination: four identical tooltip bodies++`Pagination.tsx` now has the same `<TooltipContent><HStack><span><Trans>…</Trans></span><ShortcutKey …/></HStack></TooltipContent>` shape four times (condensed/full × previous/next). The duplication was there before the change, but this diff doubled the size of each copy.++**Remedy.** Add a local `PaginationTooltip({ label, shortcut, children })` that wraps `Tooltip`/`TooltipTrigger asChild`/`TooltipContent`. That cuts about 40 lines, and the four call sites then read as what they are.++---++## Checked and fine++- **Menu handler scoping is correct.**+ - Radix composes `props.onKeyDown` before its own handler and skips it when `defaultPrevented`, so typeahead can't double-act.+ - `stopPropagation` stops the portal bubble into the parent menu.+ - The `closest("[role='menu']") === menu` filter keeps submenu items separate.+- `isTextEntryTarget` is split out of `isEditableTarget` rather than re-implemented, as the conventions require.+- `MenuItemShortcut` is typed to the constant's values, so a combo like `mod+e` (which the bare-key parser would never match) cannot be passed.+- **Rollout diff is clean.** Every non-`shortcut` line in the 220 rollout files is a biome reflow or import-list change; no logic was touched. Conditional keys (`cond ? edit : view`) follow the label's own condition.+- **Delete safety:** 20 non-confirming Delete items are skipped, each with a recorded reason (`.ai/plans/2026-09-29-keyboard-nav-polish.rollout.md`).+- No file crossed 1,000 lines.++## Not flagged (considered)++- `MENU_ITEM_SHORTCUTS` has alias keys (`copy`/`duplicate`, `view`/`open`). They make call sites read by their own verb; collapsing them would save two lines and cost clarity.+- The DOM-query dispatch (`data-menu-shortcut` + `querySelectorAll`) versus a React context registry. The registry would need register/unregister effects per item across four content types. The DOM query is smaller and has no lifecycle.++---++## Outcome (applied 2026-09-29)++1. **Fixed.** The loader maps `recordName` onto each row, and the table uses a `WorkflowRunListItem` type. The prop, the ref and the client-side keys are gone. The `WorkflowRunsTable.tsx` diff went from 270 changed lines to 30.+2. **Fixed.** `ShortcutHelpOverlay` appends the "In an open menu" group itself. Both app `ShortcutHelp.tsx` files are back to their HEAD versions.+3. **Fixed.** `withMenuShortcuts(onKeyDown)` in `utils/menuShortcut.ts` replaces the four inline compositions. The asChild note now lives once, in each item's `shortcut` prop docs. The item-body ternary stays: an `asChild` Slot must get exactly one child, so `{children}{false}` is not safe.+4. **Reverted: the finding was wrong.** The implementation nav item is typed `Authenticated<NavItem>`, which has no `key`; only `ModuleDefinition` adds it. Deriving the letter inside the component would need a cast or an optional `key`. The caller-supplied `goToKey` prop is the honest boundary, so it stays.+5. **Fixed.** A local `PaginationTooltip({ direction })` replaces the four copies.++Verification: typecheck for erp, mes and @carbon/react passes. `@carbon/react` vitest: 42/42. Biome: 0 errors; the 10 warnings are pre-existing, in lines this diff doesn't touch.diff --git a/.ai/specs/2026-09-29-keyboard-nav-polish.md b/.ai/specs/2026-09-29-keyboard-nav-polish.mdnew file mode 100644index 0000000000..a7e97962f1--- /dev/null+++ b/.ai/specs/2026-09-29-keyboard-nav-polish.md@@ -0,0 +1,151 @@+# Keyboard-nav polish: run record names, go-to hints, pager tooltips, menu letter keys++> Status: draft+> Author: Aashu+> Date: 2026-09-29++## TLDR++Four small, independent improvements to the ERP UI:++1. The Workflow Runs list shows each run's record by name, and the name links to the record.+2. The left sidebar shows the G-then-letter shortcut that already exists for each module.+3. The table Previous/Next tooltips say what the buttons do, alongside the key.+4. Menu items get one-key shortcuts that work only while their menu is open.++No schema changes. Research: `.ai/research/keyboard-nav-polish.md`.++## Problem Statement++1. **Workflow Runs → Record** shows "Purchase Order po_01J…" instead of the record's number or name. The list loader never looks names up (`routes/x+/workflows+/runs.tsx`), though the run drawer already does (`getWorkflowRunRecordNames`, `runs.$runId.tsx:54-57`).+2. **Module go-to**: G-then-letter navigation already works (`MODULE_GO_TO`, `apps/erp/app/shortcuts.ts:68-85`; wired in `PrimaryNavigation.tsx:62-80`). But the sidebar never shows the letters, so nobody finds them outside the `?` overlay.+3. **Pagination tooltips**: the Previous/Next tooltip contains only a `ShortcutKey` for ←/→. `ShortcutKey` draws those keys as chevron icons (`ShortcutKey.tsx:36-45`), so the tooltip reads as a bare "chevron arrow" with no words.+4. **Menus**: no menu item has a key of its own. Radix typeahead only moves focus to the first item that starts with the typed letter; it does not run the item. Acting from a More menu therefore always takes a mouse click or arrow keys plus Enter.++## Proposed Solution++### 1. Workflow Runs record names++- **List loader (`runs.tsx`):** after `getWorkflowRuns`, collect the distinct non-null `{table: triggerTable, id: triggerRecordId}` pairs on the page. Call `getWorkflowRunRecordNames(client, companyId, refs)` once; it already makes one query per table, so there is no N+1. Return `recordNames` (a `Record<"table:id", string>`).+- **`WorkflowRunsTable`:**+ - Accept `recordNames`.+ - The Record cell passes `name={recordNames[`${table}:${id}`]}` to the existing `EntityRecordLink`. That component already renders a `Hyperlink` to `getEntityPath(id)`, so the name is the link.+ - When a table isn't in `fkDisplayRegistry` or the record was deleted, the current fallback applies: label plus id.+ - `exportValue` uses the name when one is present (CSV shows what the user sees).++### 2. Go-to hints on the sidebar++- `NavigationIconLink` takes an optional `goToKey` (the letter from `MODULE_GO_TO[link.key]`).+- When the rail is expanded, the hovered or focused item shows two small keycaps on the right edge, `G` and the letter. Hovering is what expands the rail, so this is the moment the user is looking at that item.+- Styling follows the existing ⌘K badge on the Search button (`PrimaryNavigation.tsx:304-311`): `ShortcutKey variant="small"`, `pointer-events-none`, and opacity driven by `group-data-[state=expanded]` plus `group-hover/item` / `group-focus-visible/item`.+- Settings (pinned at the bottom) gets the same hint.+- Shop Floor has no letter and shows nothing.+- The letter map is unchanged.++### 3. Pagination tooltips++- In both modes of `PaginationButtons` (condensed header icons and the full footer buttons), `TooltipContent` becomes a translated label followed by the keycap: **"Previous page ←"** and **"Next page →"**.+- The wording matches the `?` overlay entries (`ShortcutHelp.tsx:78-84`).+- Layout: a flex row with a gap; the text is wrapped in `<Trans>`.++### 4. Menu letter keys++**Mechanism (shared, `packages/react`)**++- `DropdownMenuItem` and `ContextMenuItem` gain an optional `shortcut?: ShortcutInput` prop. `MenuItem` passes it through.+ - When set, the item renders the keycap on its right (`ShortcutKey variant="small"`, inside the existing `DropdownMenuShortcut` / `ContextMenuShortcut` slot).+ - The item also carries a `data-menu-shortcut` attribute holding the normalised key.+- The content components (`DropdownMenuContent`, `DropdownMenuSubContent`, `ContextMenuContent`, `ContextMenuSubContent`) get a composed `onKeyDown`. On keydown it:+ 1. Handles the key only when there are no modifiers, the event target is not an input, textarea or contenteditable, and the target's nearest `[role=menu]` is this content element. That last check matters because React portals bubble keydown from a submenu up to its parent content.+ 2. Finds an enabled `[role=menuitem][data-menu-shortcut=<key>]` whose nearest `[role=menu]` is this content.+ 3. If one is found: `preventDefault`, `stopPropagation` (so Radix typeahead does not also act), then `.click()` the item. Radix runs `onSelect`/`onClick` and closes the menu as it would for a pointer click. `asChild` Link items navigate.+ 4. If none is found, the event passes through untouched, so Radix typeahead and arrow keys behave as today.+- **Scoping:** the handler lives on the menu content, which is only mounted while the menu is open. No document listener exists, so keys can never fire from a closed menu. Page-level hotkeys already stand down inside `[role=menu]` (`packages/react/src/utils/keyboard.ts:7-16`), so there are no double fires.+- **Key matching:**+ - Letters match on `event.code` (`KeyE`), the same physical-key matching react-hotkeys-hook uses, so non-Latin layouts work.+- **Duplicate keys in one menu:** a dev-only `console.warn`, and the first item in DOM order wins.++**Shared letter set: `MENU_ITEM_SHORTCUTS` in `packages/react/src/shortcuts.ts`**++| Verb (label starts with) | Key |+|---|---|+| Edit | E |+| Rename | R |+| Pin / Unpin | P |+| Duplicate / Copy | C |+| Download | D |+| View / Open | O |++**Rollout:** every menu item in `apps/erp` and `apps/mes` whose label starts with one of these verbs gets `shortcut={MENU_ITEM_SHORTCUTS.<verb>}`. Items with any other label are left alone.++**No Delete key:** Delete items get no shortcut. Removing data stays a deliberate pointer or Enter action.++### Design Decisions++| Decision | Choice | Rationale |+|---|---|---|+| Go-to letter map | Keep the existing `MODULE_GO_TO` | Already on main, conflict-free (T Items, V Invoicing, I Inventory), and listed in the `?` overlay; the user chose to keep it |+| Where go-to hints show | Keycaps on the hovered/focused rail item while the rail is expanded | The rail expands on hover, so a collapsed-state tooltip would never be seen; showing hints on every row at once would be noisy |+| Record link style | The name is the `Hyperlink` (via `EntityRecordLink`) | Matches the PO/SO tables and this table's own Workflow column; the user's choice |+| Pager tooltip | Label + keycap | The tooltip must say what the button does; the user's choice |+| How menu items get keys | Explicit `shortcut` prop, no auto-assignment | Predictable letters that don't shift when items hide or labels are translated; the user's choice |+| Delete key | None | Removing data should never be one keystroke away, even behind a confirmation; the user's call, reversing the earlier Backspace decision |+| Scoping of menu keys | `onKeyDown` on menu content, not a document listener | Content is mounted only while the menu is open, so scoping comes for free; no global binding to guard |+| react-hotkeys-hook for menu keys | Not used | The convention bans hand-rolled *document* listeners. This is an element-scoped React handler. `useHotkeys` would need a ref per content plus its menu/typeahead suppression, and `isEditableTarget` treats `[role=menu]` as editable, so it would suppress exactly the keys we need |+| Shortcut constants location | `packages/react/src/shortcuts.ts` | Menus are shared parts used by ERP and MES; the convention puts shared combos there |++## Data Model Changes++N/A: no schema changes. Item 1 reads existing columns through an existing service function.++## API / Service Changes++- `routes/x+/workflows+/runs.tsx` loader also returns `recordNames`. There is no new service function (it reuses `getWorkflowRunRecordNames`).++## UI Changes++- `apps/erp/app/modules/workflows/ui/Runs/WorkflowRunsTable.tsx`: Record cell name and export value.+- `apps/erp/app/components/Layout/Navigation/PrimaryNavigation.tsx`: go-to keycaps on rail items and Settings.+- `apps/erp/app/components/Table/components/Pagination/Pagination.tsx`: tooltip text.+- `packages/react/src/Dropdown.tsx`, `Context.tsx`, `Menu.tsx`, `shortcuts.ts`: the menu shortcut mechanism and constants.+- Menu call sites across `apps/erp` and `apps/mes` get `shortcut` props (the mechanical rollout).+- `apps/erp/app/components/ShortcutHelp.tsx` (and the MES equivalent) gain a "Menus" group listing the letter set.+- `.claude/rules/conventions-ui.md` § Keyboard shortcuts gains a paragraph on menu item keys.+- All new copy is Lingui-translated.++## Acceptance Criteria++- [ ] On `/x/workflows/runs`, a run triggered by a purchase order shows the PO number (e.g. "PO000123"), not the `po_…` id. Clicking it opens that PO.+- [ ] A run whose record table isn't in `fkDisplayRegistry` still shows the label plus id, and still links when a route exists.+- [ ] CSV export of the runs table contains the same record text as the cell.+- [ ] With the rail expanded, hovering Items shows `G` `T` keycaps on that row only. Pressing G then T goes to Items. Shop Floor shows no keycaps.+- [ ] Hovering the table header's Previous icon shows "Previous page" with a ← keycap; the footer's Next button shows "Next page" with a → keycap. ← and → still page.+- [ ] Opening a table row's action menu (three-dot or right-click) that has "Edit …" and "Delete …": pressing E runs Edit and closes the menu; Delete shows no keycap and Backspace does nothing.+- [ ] With no menu open, pressing E on the page does nothing menu-related.+- [ ] In a menu with a submenu open, a letter pressed inside the submenu runs only the submenu's matching item.+- [ ] Typing in a NumberField inside a menu (Quote line pricing) never triggers a menu key.+- [ ] Typing a letter that no item owns still moves focus the Radix typeahead way.+- [ ] Every wired item shows its keycap; the `?` overlay lists the menu keys.+- [ ] `pnpm exec turbo run typecheck --filter=erp --filter=mes --filter=@carbon/react` and `pnpm run lint` pass; the new keydown logic has unit tests.++## Risks++| Risk | Severity | Mitigation |+|---|---|---|+| Large mechanical rollout touches many files and invites merge conflicts | Med | Change only the `shortcut` prop, one commit per module, no other edits |+| Letter keys steal Radix typeahead for that letter | Low | Only for letters an item owns; others fall through unchanged |+| Header and footer pagination both bind ←/→ | Low | Already the case on main, and harmless: both call `gotoPage(pageIndex + 1)` with the same value (`usePagination.ts:37-39`). Out of scope |++## Open Questions++- [x] G-then-letter scope: redesign or keep? — **Answer:** keep the existing map and add sidebar hints.+- [x] How do menu items get letters? — **Answer:** an explicit `shortcut` prop; no auto-assignment.+- [x] Workflow run record opening style? — **Answer:** the name is the Hyperlink (existing `EntityRecordLink`).+- [x] Pager tooltip content? — **Answer:** label plus keycap ("Previous page ←").+- [x] Delete key in menus? — **Answer:** first Backspace/Delete, then revised to none (no Delete shortcut at all).+- [x] Rollout scope? — **Answer:** the mechanism plus every menu item starting with a common verb (Edit, Rename, Pin, Duplicate/Copy, Download, View/Open, Delete) across ERP and MES.++## Changelog++- 2026-09-29: Created+- 2026-09-29: Dropped the Delete menu key (user decision); Delete items get no shortcut