2.6 KiB
2.6 KiB
FRAME Frontend Integration
Purpose
FRAME follows the frontend three-layer architecture for persisted action-plan entries.
View -> Business Logic -> API/Data Access -> Backend
Files
View layer:
frontend/src/components/frameworks/FrameModule.tsxfrontend/src/components/frame/frontend/src/components/frameworks/Dashboard.tsxfrontend/src/components/dashboard/DashboardFramePreview.tsxfrontend/src/components/frameworks/DirectorDashboard.tsxfrontend/src/components/director-dashboard/DirectorRecentFramePanel.tsx
Business logic layer:
frontend/src/business/frame/hooks.tsfrontend/src/business/frame/mappers.tsfrontend/src/business/frame/selectors.tsfrontend/src/business/frame/types.tsfrontend/src/business/dashboard/hooks.tsfrontend/src/business/director-dashboard/hooks.tsfrontend/src/business/director-dashboard/selectors.tsfrontend/src/shared/business/week.ts(shared American/Sunday week canonicalization)
API/data access layer:
frontend/src/shared/api/frame.tsfrontend/src/shared/types/frame.ts
Constants:
frontend/src/shared/constants/frame.ts
Behavior
- FRAME entries load from
GET /api/frame_entries. - Create/update workflows use typed API calls and React Query mutations.
- Week selection: the create and edit forms use
FrameWeekPicker(aPopover+Calendar) — picking any day snaps to that week's Sunday (American week) via the sharedshared/business/week.ts(toWeekStartIso), and an optional free-text week label (e.g. "Spring Break week") is captured separately. The entry stores the canonical Sunday-start ISO inweek_ofand the label inweek_label; cards renderWeek of <formatWeekOf(weekStart)>+ the label badge. The same week util backs the dashboard hero "Week of …" and the safety-quiz week, so the week is consistent across the app. FrameModule.tsxis a thin wrapper that callsuseFrameModuleand renders focused FRAME view components.- FRAME view components use shared UI primitives:
Button,Input,Textarea, andStatePanel. - Static FRAME sample entries are not used as runtime persisted-data substitutes.
- Empty and error states are rendered explicitly.
- Dynamic F/R/A/M/E field access is typed through
FrameSectionKey. - Director dashboard renders recent FRAME previews through director dashboard selectors instead of deriving preview rows in JSX.
- Home dashboard renders the latest FRAME entry through
useDashboardPageandDashboardFramePreview.
Remaining Related Work
Dashboard zone check-ins are owned by the dashboard business layer and user progress API, not by FRAME.