dashboard: adopt the async-guard idiom across the unguarded surfaces (34 components make seam calls with no error surfacing) #304

Closed
opened 2026-08-05 23:11:16 +00:00 by ben · 1 comment
Owner

The 2026-08-05 sweep found a sharp split: the operator app's founding journey routes every seam call through a serialized guarded run() with an error banner, while the web dashboard has essentially no error surfacing — only 6 files use the documented useAsyncGuard idiom (packages/ui-kit/src/asyncGuard.ts); 34 components make async seam calls with no error ref, most of them in dashboard/.

The worst offenders have their own tickets (SetupSurface, FleetSurface, PendingDevices/DeviceAdd, BrandKit, Updates). This ticket is the sweep of the remainder: every dashboard surface making a seam call gets the guard idiom — loading, rendered error, retry — so a failed read/verb is never a blank pane or a dead button.

Acceptance

  • No dashboard component awaits a seam call outside the guard idiom (or an equivalent error ref pattern); an eslint rule or a repo-standards note prevents regression if practical.
  • Vitest coverage on each newly-guarded surface's failure path (a representative test per surface is enough).

Filed from the 2026-08-05 fail-loud audit (three-agent pre-production sweep; findings verified against code).

The 2026-08-05 sweep found a sharp split: the operator app's founding journey routes every seam call through a serialized guarded `run()` with an error banner, while the web dashboard has essentially no error surfacing — only 6 files use the documented `useAsyncGuard` idiom (`packages/ui-kit/src/asyncGuard.ts`); **34 components** make async seam calls with no error ref, most of them in `dashboard/`. The worst offenders have their own tickets (SetupSurface, FleetSurface, PendingDevices/DeviceAdd, BrandKit, Updates). This ticket is the sweep of the remainder: every dashboard surface making a seam call gets the guard idiom — loading, rendered error, retry — so a failed read/verb is never a blank pane or a dead button. **Acceptance** - No dashboard component awaits a seam call outside the guard idiom (or an equivalent error ref pattern); an eslint rule or a repo-standards note prevents regression if practical. - Vitest coverage on each newly-guarded surface's failure path (a representative test per surface is enough). --- _Filed from the 2026-08-05 fail-loud audit (three-agent pre-production sweep; findings verified against code)._
Author
Owner

Swept the async-guard idiom across the unguarded dashboard surfaces (commit 7a1ec0d on main).

Shared primitive: packages/ui-kit/src/components/OcErrorState.vue — the one rendered error state (subpath-exported, --oc-*-only, role="alert", data-field="error-message" + retry data-action="retry"), paired with the existing useAsyncGuard. Reads render it in place of the empty content with a Try again that re-reads; verbs render it beside the action with the button re-enabled and short-circuit before any success emit.

Swept 29 components across backups/members/monitoring/provisioning/rescue/shell, each with a representative failure-path Vitest. Three parent-driven presentational screens (OverviewScreen, DeviceLadderScreen, WaitingApprovalScreen) make no seam call and were left. A grep confirms the only unguarded awaited seam calls remaining are the six ticketed surfaces (#297 SetupSurface, #298 FleetSurface, #299 PendingDevices/DeviceAdd, #301 BrandKit, #302 Updates).

Regression fence: new docs/CODING-STANDARDS.md clause — a component that awaits a seam call surfaces its failure; a toast is not a state.

Verify: full dashboard suite 941 green + vue-tsc clean; ui-kit 106 green (new ocErrorState.test.ts).

Swept the async-guard idiom across the unguarded dashboard surfaces (commit 7a1ec0d on main). **Shared primitive:** `packages/ui-kit/src/components/OcErrorState.vue` — the one rendered error state (subpath-exported, `--oc-*`-only, `role="alert"`, `data-field="error-message"` + retry `data-action="retry"`), paired with the existing `useAsyncGuard`. Reads render it in place of the empty content with a Try again that re-reads; verbs render it beside the action with the button re-enabled and short-circuit before any success emit. **Swept 29 components** across backups/members/monitoring/provisioning/rescue/shell, each with a representative failure-path Vitest. Three parent-driven presentational screens (OverviewScreen, DeviceLadderScreen, WaitingApprovalScreen) make no seam call and were left. A grep confirms the only unguarded awaited seam calls remaining are the six ticketed surfaces (#297 SetupSurface, #298 FleetSurface, #299 PendingDevices/DeviceAdd, #301 BrandKit, #302 Updates). **Regression fence:** new `docs/CODING-STANDARDS.md` clause — a component that awaits a seam call surfaces its failure; a toast is not a state. **Verify:** full dashboard suite 941 green + `vue-tsc` clean; ui-kit 106 green (new `ocErrorState.test.ts`).
ben closed this issue 2026-08-06 00:14:06 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#304
No description provided.