docs(unit-3): Complete functional design based on user answers

All Q1-Q5 answered A:
- Topbar removed; LanguageSwitcher + UserMenu move to sidebar footer
- Mobile: slide-over overlay with hamburger button
- Theme toggle in sidebar footer
- No-flash init via inline script in index.html
- Role-filtered sidebar items client-side

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 11:51:24 +02:00
co-authored by Claude Haiku 4.5
parent 037332e52f
commit 6760257e49
5 changed files with 364 additions and 6 deletions
@@ -0,0 +1,37 @@
# Domain Entities — Unit 3: Layout & Navigation
## NavItem
Represents a single entry in the sidebar navigation. Defined as a constant array in `Sidebar.tsx`.
| Field | Type | Description |
|---|---|---|
| `to` | `string` | TanStack Router route path |
| `labelKey` | `string` | i18n key for the display label |
| `icon` | `LucideIcon` | Icon component from lucide-react |
| `testId` | `string` | `data-testid` value |
| `roles` | `Role[] \| undefined` | Roles that can see this item; `undefined` = all authenticated roles |
## Role (from AuthContext — existing)
```ts
type Role = 'Owner' | 'Administrator' | 'User';
```
Sourced from `useAuth().user.role`. Used by `Sidebar` to filter `NavItem[]`.
## Theme
```ts
type Theme = 'light' | 'dark';
```
Persisted in `localStorage` under key `cms-theme`. Applied as class on `<html>`.
## SupportedLanguage (existing, Unit 1)
```ts
type SupportedLanguage = 'en' | 'nl';
```
No changes — `changeLanguage` from `@/i18n/config` is reused as-is.