3.1 KiB
3.1 KiB
Sign Language Integration
Purpose
SignLanguage renders backend-owned sign catalog content and current-user learned progress through the three-layer frontend architecture.
View -> Business Logic -> API/Data Access -> Backend
Runtime sign records, teaching tips, video URLs, GIF URLs, step instructions, and page-level teaching reminders belong to backend content catalog payloads. The frontend owns only UI state, filter config, style tokens, and progress interaction wiring.
Frontend Layers
View:
frontend/src/components/frameworks/SignLanguage.tsxfrontend/src/components/frameworks/SignLanguageVideoModal.tsxfrontend/src/components/sign-language/SignLanguageView.tsxfrontend/src/components/sign-language/SignLanguageHeader.tsxfrontend/src/components/sign-language/SignLanguageRememberPanel.tsxfrontend/src/components/sign-language/SignLanguageProgressPanel.tsxfrontend/src/components/sign-language/SignLanguageFilters.tsxfrontend/src/components/sign-language/SignLanguageGrid.tsxfrontend/src/components/sign-language/SignLanguageCard.tsxfrontend/src/components/sign-language/SignLanguageVideoModal.tsx
Business logic:
frontend/src/business/sign-language/hooks.tsfrontend/src/business/sign-language/selectors.tsfrontend/src/business/sign-language/types.ts
Shared contracts and UI config:
frontend/src/shared/types/app.tsfrontend/src/shared/constants/signLanguage.tsfrontend/src/shared/constants/contentCatalog.ts
Backend Contracts
The page reads content from:
GET /api/content-catalog/read/sign-language-itemsGET /api/content-catalog/read/sign-language-page-content
Learned progress uses:
GET /api/user_progress?progress_type=sign_learnedPOST /api/user_progressDELETE /api/user_progress/by-item
Content payloads are seeded in:
backend/src/db/seeders/content-catalog-data/content-catalog-seed-payloads.js
Behavior
useSignLanguagePageloads sign items, page content, and learned sign progress.- Learned progress is a personal persisted state. When a parent-scope user is drilled into a child tenant, the page still shows sign content, but it does not load/write learned-sign progress or render "Progress Saved" / "Learned" affordances.
- Selectors handle category counts, search/category filtering, progress percentage, video duration, filter normalization, and YouTube search URL construction.
- View components receive a prepared page model and do not call API/data access modules.
- The video modal uses
useSignLanguageVideoModalStatefor GIF/video mode, GIF loading state, and step-guide expansion. - Loading, empty, and error states are explicit through
StatePanel.
Data Ownership Rules
- Do not add sign records, teaching tips, page reminders, video URLs, GIF URLs, or step instructions to frontend constants.
- Do not add frontend fallback sign payloads.
- Keep frontend constants limited to filter options, category style classes, external URL templates, and UI view modes.
- Test-only fixtures may live in selector tests or
frontend/src/test-seeds/.