# 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"]
Row["lib/firstRow"] --> Grid["PortfolioGrid"]
Row --> Port["routes/portfolio head"]
Seo --> Port
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,Grid,Port app;
class Open,Close,Hook,Pure,Twin,Seo,Row 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 and portfolio heads use 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 ``, `url(` or `@import` (BR-NAV-02). The ids and attributes it names are exported as constants next to it (`MOBILE_NAV_ID`, `HEADER_ID`) and used by the components, so a rename breaks a test and not the fallback. |
| `src/components/NoScript/NoScriptStyles.tsx` | `NoScriptStyles()` renders ``. Rendered by the root shell after `HeadContent`. Renders the same on both sides; the browser ignores the children (BR-IMG-03). |
| `src/lib/firstRow.ts` | `GRID_COLUMNS` (base 1, 48em 2, 64em 3; also used by `PortfolioGrid`'s `gridTemplateColumns`), `firstRow(index, columns = GRID_COLUMNS): 'always' \| { media: string } \| null`, `firstRowPreloads(items, columns = GRID_COLUMNS): HeadLink[]` (BR-PRE-08, 11). Pure; `src/lib` has a 100 % coverage threshold. |
| `src/components/NavigationBar/NoScriptNav.tsx` | `NoScriptMenuOpen()`: `