Skip to content

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.

  • 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.

Preferred engines:

Use caseEngineFrontend UX stance
Standard A4 contractsPaged.jsStable preview/download surface for generated HTML/PDF artifacts.
Long report seriesVivliostylePreferred for repeat sections that flow across A4 pages.
Operator recoveryBrowser print CSS + print-jsFallback 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.

Document Center surfaces:

  • definitionKey, templateVersion, and stylesheetVersion.
  • printState for A4, PDF, and HTML.
  • OSS print engine metadata: primaryEngine, fallbackEngine, and a4Stability.
  • Artifact handoff location by logical table/bucket name only: sanmopia_document_render_artifacts and reservation-documents.
  • Repeat sections as lower_snake_case keys with flow_to_next_page and unbounded policies.

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 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.

  • 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.

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.