Commit 54bf6b6
committed
feat(frontend): hierarchical equipment picker wired to ISA-95 tree
Replace the flat hardcoded equipment select with a SCADA-style
command-palette that reflects the real DB model (Enterprise → Site →
Area → Line → Cell) via `GET /api/v1/hierarchy/tree`.
- `EquipmentPicker`: trigger button with bracketed breadcrumb
(`[EQ] cellName · SITE · AREA · LINE`) + `⌘⇧E` shortcut. Popover
with search (token-split, case-insensitive), tree grouped by line,
keyboard navigation (↑↓ Home End wrap, Enter commit, Esc restore),
StatusRail per row, disabled cells greyed. Full ARIA (dialog+modal,
listbox/option, activedescendant, expanded/haspopup/controls).
- `lib/hierarchy`: ISA-95 DTO types, `useHierarchyTree` TanStack query
(staleTime 60s), `flattenTree/searchCells/groupByLine`, `findCell`
helpers. `EquipmentSelection` now carries `{lineId, lineName, cellId,
cellName, siteName, areaName}` for live MetaStrip binding.
- `TopBar`: MetaStrip binds to the live selection (`SITE / LINE / REV`
instead of hardcoded `UNIT / CELL / REV`).
- `AppShell`: `aria.selectedEquipment` shape migrated; old string
payload ("P-01") is dropped via a new `validator` option on
`useLocalStorage`, which also filters out stale shapes arriving on
cross-tab `storage` events. Auto-seeds the first enabled cell when
no selection exists.
Zero new deps. All tokens-only (no hex literals). Icons via DS wrapper.
Motion via `Motion.fadeInUp` + `--ds-motion-*` tokens.
`npm run typecheck` / `npm run build` / `npm run check` all green.
Bundle 453.33 kB / 143.36 kB gzipped (+3 kB vs baseline).1 parent 2045892 commit 54bf6b6
5 files changed
Lines changed: 908 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | | - | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
30 | 40 | | |
31 | 41 | | |
32 | 42 | | |
| |||
40 | 50 | | |
41 | 51 | | |
42 | 52 | | |
43 | | - | |
| 53 | + | |
44 | 54 | | |
45 | | - | |
| 55 | + | |
| 56 | + | |
46 | 57 | | |
47 | 58 | | |
48 | 59 | | |
| |||
77 | 88 | | |
78 | 89 | | |
79 | 90 | | |
80 | | - | |
81 | | - | |
| 91 | + | |
| 92 | + | |
82 | 93 | | |
83 | 94 | | |
84 | 95 | | |
| |||
0 commit comments