--- name: a4-entry-points description: How the two report editors are reached and dispatched between — kind decides the route, and why the A4 editor now needs Router + NomenclatureData context in tests metadata: type: project --- Phase 7 wired the A4 designer to real operator entry points. Three things here are easy to get wrong later. **Report `kind` decides the route, never a default.** `Main.jsx` fetches `/api/reports/?name=notice_report` and branches: `kind === 'a4'` → dynamic `import()` of `a4/print/printReport` and `printA4Report(report, data)`; otherwise the existing `ReportPreviewModal`. "Design Notice" routes to `/report-editor-a4` or `/report-editor` by the same field. **Why it matters:** a matrix report opened in the mm editor reads its character x/y as millimetres and looks like a corrupt layout rather than a routing bug — a slow, confusing failure. The A4 editor's auto-load therefore filters on `?kind=a4&name=...`, not name alone; verified against the real DB that `?kind=a4&name=` returns 0 rows. **How to apply:** any new entry point that opens a saved report must resolve `kind` before choosing an editor or a render path. Never assume a name implies a kind. **`A4ReportEditor` now requires two contexts.** It calls `useLocation`/ `useNavigate` (router-state auto-load) and `useNomenclatureData` (sample-data fallback). Both throw outside their providers, so any jsdom test mounting the whole editor needs `` plus `vi.mock('../../../../contexts/NomenclatureDataContext', ...)`. Mocking the nomenclature hook rather than standing up the provider keeps the SSE client and auth context out of tests that are really about drag geometry. **Why:** adding these deps silently broke four existing `a4Guides` tests with "useLocation() may be used only in the context of a " — the component was fine, the harness was stale. **`window.print()` is not gated by transient user activation** the way `window.open` is, so an `await` before it is safe. The A4 print chunk is still prefetched on hover/focus of the Print Notice button, purely to shorten the gap on a slow station. This was reasoned, not verified in a real browser — if Print Notice is ever reported as doing nothing on click, re-test that assumption first. Related: [[a4-print-path]], [[a4-designer-conventions]], [[testing-react]]