Document output UX
Document output UX uses Astro, DaisyUI, and the atomic pattern. The frontend does not own document rendering policy, template rendering, or artifact persistence. It exposes backend-rendered artifacts and keeps a browser print fallback for operator recovery.
Boundary
Section titled “Boundary”- Backend owns render requests, domain eligibility, template loading, and writes
sanmopia_document_render_artifacts. - Supabase Storage stores generated HTML/PDF artifacts in
reservation-documents. - Frontend reads contract-shaped document metadata and artifact status only.
- Frontend preview must not call Strapi, inspect Supabase Storage paths directly, or invent document payload shapes.
OSS Print Engines
Section titled “OSS Print Engines”Preferred engines:
| Use case | Engine | Frontend UX stance |
|---|---|---|
| Standard A4 contracts | Paged.js | Stable preview/download surface for generated HTML/PDF artifacts. |
| Long report series | Vivliostyle | Preferred for repeat sections that flow across A4 pages. |
| Operator recovery | Browser print CSS + print-js | Fallback only; usable when stored PDF is queued or blocked. |
Paged.js and Vivliostyle are adoption points, not bespoke pagination logic. A frontend component may show which engine produced the artifact, but page breaks, section flow, and PDF generation remain backend concerns.
UX Contract
Section titled “UX Contract”Document Center surfaces:
definitionKey,templateVersion, andstylesheetVersion.printStatefor A4, PDF, and HTML.- OSS print engine metadata:
primaryEngine,fallbackEngine, anda4Stability. - Artifact handoff location by logical table/bucket name only:
sanmopia_document_render_artifactsandreservation-documents. - Repeat sections as lower_snake_case keys with
flow_to_next_pageandunboundedpolicies.
Buttons should prefer stored artifacts once ready. window.print() remains a
fallback action for the visible A4 preview and must use print CSS with @page
A4 rules.
Stored artifact download actions request a backend download handoff by
renderRequestCode; UI receives signedUrl and expiresAt only. Components
must not reconstruct Supabase Storage object paths.
Bundle actions call backend bundle handoff with ready member renderRequestCode
values and service kind. UI renders included members and missing definition keys;
it still receives signed URLs only.
Document Room
Section titled “Document Room”Document Room screens show branch/HQ posts, pinned state, target branch, and attachments. They must not show source controller names, filesystem upload paths, storage object keys, or Strapi collection names. Attachment download buttons call backend/Supabase handoff surfaces and receive display metadata, not bucket paths.
Atomic Placement
Section titled “Atomic Placement”- Pages call feature view-model builders.
- Templates compose page-level layout and navigation.
- Organisms render the document catalog, A4 preview, artifact state, and print controls.
- Reusable buttons or links move to atoms when repeated.
No frontend component should duplicate backend render request construction, Supabase Storage upload/download internals, or Strapi document definition editing.
User-Facing Copy
Section titled “User-Facing Copy”Document screens must not show internal keys such as definitionKey,
renderRequestCode, storage paths, source reference JSON, or camelCase contract
field names. Show document titles, Korean status labels, and download readiness
instead. Debug values belong in contract tests, backend logs, or migration docs,
not visible app panels.