# Frontend Components - Unit 2: Display fallbacks All paths are under `web/`. "New" and "changed" refer to the state at the end of unit 1 (worktree HEAD). Component list and responsibilities follow [components.md](../../../inception/application-design/components.md) ("Display (unit 2)"); this document fixes the details and records the differences. Rules: [business-rules.md](business-rules.md). Logic: [business-logic-model.md](business-logic-model.md). Data: [domain-entities.md](domain-entities.md). ## 1. Component hierarchy ```mermaid graph TD Root["routes/__root.tsx shell"] --> Head["head: HeadContent and NoScriptStyles"] Root --> Body["body: ChakraProvider, AppShell, Scripts"] Body --> Nav["NavigationBar"] Nav --> Open["NoScriptMenuOpen in noscript"] Nav --> Mob["MobileNav"] Mob --> Close["NoScriptMenuClose in noscript"] Nav --> Sub["NavSubmenu and MobileNavGroup"] Body --> Pages["Pages"] Pages --> Rev["Reveal"] Rev --> Hook["useReveal"] Hook --> Pure["lib/revealPhase"] Pages --> Def["DeferredImage"] Def --> Twin["noscript twin image"] Pages --> Hero["Hero, FilterBar, Testimonials, Footer"] Seo["seo.ts preloadImage"] --> Contact["routes/contact head"] classDef shell fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000; classDef app fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; classDef newc fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000; class Root,Head,Body shell; class Nav,Mob,Sub,Pages,Rev,Def,Hero,Contact app; class Open,Close,Hook,Pure,Twin,Seo newc; ``` Text alternative: the shell holds the noscript CSS, navigation the noscript menu links, Reveal a hook over a pure module, DeferredImage a twin, and the contact head uses preloadImage (yellow new, green changed). ## 2. Components "Contract" is what the component renders in the first render on the server and in the browser (BR-HYD-01), so each change keeps the hydration rule. ### New | File | Exports and contract | |---|---| | `src/lib/revealPhase.ts` | `type RevealPhase = 'settled' \| 'hidden' \| 'revealed'`; `startsHidden(top: number, viewportHeight: number): boolean` (`top >= viewportHeight`); `nextRevealPhase(phase, event: 'belowViewport' \| 'inView' \| 'intersected'): RevealPhase` (BR-RVL-09, 12). Pure, no DOM. | | `src/components/NoScript/noScriptCss.ts` | `NO_SCRIPT_CSS: string`, the whole sheet of BR-NAV, BR-NJS and BR-IMG-02, 04. No ``. Rendered by the root shell after `HeadContent`. Renders the same on both sides; the browser ignores the children (BR-IMG-03). | | `src/components/NavigationBar/NoScriptNav.tsx` | `NoScriptMenuOpen()`: `