wealth/docs/pages/wall-street-plaza/layout-panel.md

23 lines
2.7 KiB
Markdown

# Layout: panel
`apps/wall-street-plaza/src/app/(panel)/layout.tsx` · wraps every page in `(panel)`, inside [layout.md](layout.md) · it reads nothing on the server; `dynamic = 'force-dynamic'`
| Section | Data | HTML | JS | Index | Notes |
| ---------------------- | ------------- | ----------- | ------- | ----- | --------------------------------------------------------------------------------------------------------------------------- |
| AdminSidebar (desktop) | config | first flush | hydrate | no | `hidden desktop:flex`, so it is in the DOM on phones too; the brand links to `/health` |
| ↳ NavList | config | first flush | hydrate | no | a `next/link` per section, `aria-current` from the path; «به‌زودی» items as plain text |
| ↳ Section counts | query | none | hydrate | no | `usePanelCounts`, enabled once the admin is known and refetched on an interval; a `CountBadge` only when a count is above 0 |
| ↳ AdminIdentity | viewer | skeleton | hydrate | no | avatar, name, `@username` and sign-out once the admin is known |
| AdminTopBar (mobile) | config | first flush | hydrate | no | `desktop:hidden`, sticky; the brand and the menu button |
| ↳ Menu sheet | config, query | none | hydrate | no | island `Sheet` mounts the `NavList` and sign-out only while open |
| SignOutDialog | — | none | hydrate | no | one in each bar; mounted only while open |
| Page column `<main>` | — | first flush | none | no | each page renders its own `AdminGuard` and skeleton |
Scripts: none.
## Notes
- The frame is not guarded: a guest sees the sidebar or top bar, with an identity skeleton, until the page's `AdminGuard` sends them to `/login?returnTo=<path>`. When the session ends on a page, the guard shows `SessionEnded` in the page's place.
- Both bars hydrate on every device, because one DOM holds both templates.
- Debt: the `AdminGuard` comment says the `(panel)` layout renders it (`platforms/garden-roof/src/app/guards/admin-guard/AdminGuard.tsx:13`), but every page renders its own guard. Fix the comment.