AGENTS.md@packages/client/src/components/overlay · git:20260823.2db82a3 · 2026-08-23 · sha256 73ac5cfb30c0f6a8

AGENTS.md@packages/client/src/components/overlay git:20260823.2db82a3A

Immutable. This exact content is served forever at /api/v1/blob/73ac5cfb30c0f6a8.

# DOX — packages/client/src/components/overlay

Route-backed overlay container. See change: add-route-backed-overlay-dialogs.

| File | Purpose |
|------|---------|
| `RouteBackedOverlay.tsx` | Route-backed overlay container (design D1 option C). Renders the overlay in the shared `Dialog` and the launching surface as a pinned underlay: a nested wouter `<Router>` whose `hook`+`searchHook` come from `memoryLocation({path, searchPath, static:true})`, so the underlay derives from a FROZEN location and never from `window.location`. Both location halves are pinned (three converted routes carry query strings). `static:true` blocks navigation out from under the overlay. Underlay is `aria-hidden` + `inert`; `useMemo` on `(path, search)` keeps it from remounting on in-overlay navigation, preserving scroll. Focus trap / Escape / backdrop / ✕ come from `Dialog`, not reimplemented. Exports `RouteBackedOverlay`. |
| `overlay-dismiss-guard.tsx` | Panel-level opt-in seam letting a surface with unsaved edits intercept overlay dismissal (backdrop / Escape / ✕). `useOverlayDismissGuard(active, onAttempt)` registers while `active` and returns a `dismiss` to call after the user confirms the discard; the container consults one guard, so it stays ignorant of what "dirty" means and plugin claims are unaffected (C3, risk R1). See change: add-route-backed-overlay-dialogs. |