MEGAINFRA-WEBAPP/docs/superpowers/specs
DEls 31c86b5b89 docs(spec): vehicle unit_type inline-edit UI (fleet + plant)
The vehicles PB collection already has a unit_type field (fuel |
plant, default fuel, made optional on 2026-08-28) and the
PATCH /api/vehicles/[id] endpoint accepts it with full test
coverage. Today there is no UI surface for assigning or changing a
vehicle's unit_type on either the Fleet page (/dashboard/fuel) or
the Plant page (/dashboard/plant), so the 53 currently mis-classified
vehicles cannot be triaged from the UI.

This spec adds that surface via the existing inline-edit pattern
already used on both pages for description editing: a Type column
renders a 'Fleet (L)' / 'Plant (h)' badge in display mode and a
Select in edit mode. Saving a flip calls PATCH /api/vehicles/[id];
on success router.refresh() re-pulls the page and the row drops
out of the page's filter, effectively moving it to the other page.

Scope is intentionally tight:
- Server-side filter on each page (Fleet: unit_type=fuel or empty;
  Plant: unit_type=plant AND cost_per_hour > 0).
- New Type column on the existing Fleet and Plant tables (no new
  pages, no new top-level nav).
- New shared <UnitTypePill> / <UnitTypeSelect> cell components.
- Reuses the generic useInlineEdit<K extends keyof T> hook (no
  hook changes needed).
- No schema migration, no API changes, no new tests.

Spec self-review pass: tightened two claims (pb-types.ts UnitType
line 37 not 48; useInlineEdit is already generic so no hook edit).
2026-08-31 12:48:57 +02:00
..
2026-08-19-po-import-queue-redesign.md docs: add PO import queue spec/plan, ignore cooler.env, rewrite n8n ingest impl 2026-08-19 22:03:39 +02:00
2026-08-19-purchase-order-upload-design.md Spec: clarify PO upload dialog does not auto-close 2026-08-19 15:03:48 +02:00
2026-08-26-needs-review-modal-compact.png docs(specs): screenshot of compact needs-review modal with working PDF 2026-08-26 23:33:33 +02:00
2026-08-26-needs-review-modal-resize-and-pdf-viewer-design.md docs(specs): fix stale URL example, 'above' wording, and add recordId notes 2026-08-26 23:34:10 +02:00
2026-08-26-pdf-url-fix-and-modal-compact-design.md docs(specs): PDF URL fix + compact needs-review modal 2026-08-26 23:20:08 +02:00
2026-08-26-purchasing-ui-tweaks-design.md docs(specs): purchasing UI tweaks — shorter upload labels, unlinked-DN styling, view PO PDF, fulfillment bug 2026-08-26 23:56:34 +02:00
2026-08-27-po-supplier-edit-and-dn-collapse-design.md docs(spec): PO detail supplier edit + DN items collapse 2026-08-27 00:49:42 +02:00
2026-08-28-fuel-attention-dismissal-design.md docs(spec): fuel attention dismissal design 2026-08-28 12:19:59 +02:00
2026-08-28-plant-hours-weekly-log-design.md docs(plant-hours): weekly log import + exception report design 2026-08-28 12:20:58 +02:00
2026-08-28-site-overhead-monthly-and-oneoff-design.md docs(spec): clarify card subtitle covers monthly + one-off 2026-08-28 12:33:53 +02:00
2026-08-30-pwa-split-icon-design.md docs(spec): MEGA Ask vs MEGA OPS PWA split-install icon design 2026-08-30 22:11:02 +02:00
2026-08-31-vehicle-unit-type-toggle-ui-design.md docs(spec): vehicle unit_type inline-edit UI (fleet + plant) 2026-08-31 12:48:57 +02:00