♻️ refactor(frontend): split HealthDashboard into smart wrapper + dumb View for state-based stories #33
Reference in New Issue
Block a user
Delete Branch "feat/healthdashboard-stateful-stories"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Follow-up to PR #30 (Storybook) and PR #32 (Playwright fix). Splits
HealthDashboard.vueinto:HealthDashboardView.vue(new, dumb / pure / presentational) — acceptsdata,pending,erroras propsHealthDashboard.vue(refactored into a smart wrapper) — does theuseFetch('/api/healthz')and forwards state to ViewWhy
PR #30 left a documentation note on
HealthDashboard.stories.tssaying state-based stories needed a future prop refactor. PR #32 added a regression test mocking /api/healthz to 502, but the component itself still couldn't be Storybook-previewed in Loading/Error states because the data fetching was hardcoded internally.This splits per SRP (data layer ↔ presentation layer), enabling:
What's preserved
pages/index.vuestill imports<HealthDashboard />(unchanged).data-testidattributes preserved (health-dashboard,health-info,health-status).What's added
health-loading,health-error.shims-vue.d.ts: Vue 3 file module declaration with permissiveDefineComponent<any,any,any>typing. Required because the strict TS + Storybook combo otherwise generates false-positive TS2353 errors on prop typing through .vue imports.Architecture notes (per code-reviewer skill SOLID/DDD section)
HealthDashboard= composite,HealthDashboardView= view-only)Test plan
npx tsc --noEmitpasses🤖 Co-Authored-By: Claude Opus 4.7 (1M context)