Skip to documentation

Design system / Sources & standards

Current repository source

ADR-0083-title-only-drafts-and-ui-submit-readiness.md

docs/decisions/ADR-0083-title-only-drafts-and-ui-submit-readiness.md

This view contains the escaped source read during the deployment build. Code and policy text are unchanged. Markdown is shown as source, not rendered as a document. A new deployment refreshes the content.

# ADR-0083: Title-only drafts and UI-only submit readiness

- **Status:** accepted
- **Date:** 2026-10-05
- **Supersedes (scoped):** ADR-0067's server-enforced submission integrity acceptance only. Configured/historical statements, independent Edition snapshots, and Program activation rules remain unchanged.

## Context

CXH-264 combines storage/API and UI work so a submitter can save and reopen an entry with only a nonblank Campaign Title. Completeness belongs exclusively to the submission UI; structural validation and tenant/reference integrity remain server responsibilities.

## Options considered

1. Require all metadata, category and configured acceptance for every save. Rejected: prevents title-only drafts.
2. Apply status-dependent server completeness validation. Rejected: conflicts with the requested UI-only boundary.
3. Accept incomplete entry data and derive readiness in the feature-owned UI. Accepted.

## Decision

- Creation requires a nonblank Campaign Title. Updates cannot clear it. Omitted Zone, Brand, Agency and Country are stored as empty strings, preserving existing non-null read contracts. Existing nullable narrative fields and category references remain nullable. The current schema already permits these values; no migration or data rewrite is needed.
- Server validation retains value types, existing length constraints, zone/status enums, configured submission gates, ownership/manager authorization, tenant isolation, reference integrity and mutation audits. Supplying a category still requires membership in the Edition. No API completeness validator or client-configurable rules engine is introduced, even for direct requests with `status: submitted`.
- Creation and editing share a UI-only readiness adapter: title, zone, applicable category, brand, agency, country, at least one successful file, no pending upload, and configured integrity acceptance. Narrative fields (Team Members, Problem, Insight, Idea/Solution, Results, Write-Up) remain optional whether enabled or disabled, as required by ADR-0051; field visibility controls rendering only. File descriptions do not require population.
- Submit is disabled with explanations until ready. Inline editing also requires saving/cancelling the active field; submitted status and the displayed attachment set are persisted in one repository transaction so newly uploaded files are not left unlinked. Failed mutation retains draft state. Removed attachments do not count toward readiness.
- Routes retain server authorization and initial loading. `SubmissionForm` is a submissions-owned organism; `EditSubmissionForm` is a product instance backed by `useEditSubmission`. `SubmissionRequirements` is a feature-owned molecule, not a generic UI foundation. Readiness derives from existing local form/hook state without Context or a store.

## Rationale

Drafts capture incremental work without unnecessary schema churn. The browser gives actionable completion guidance; the server still protects identity, valid data representation, and references. UI completeness is guidance, not a security guarantee for direct API consumers.

## Consequences

- Direct authenticated API callers may submit incomplete entries. Consumers must tolerate empty metadata; this is intentional, not a server-side assurance of completeness.
- Existing integrity text is preserved, but its acceptance requirement now lives only in the UI.
- Regression tests cover title-only save/reload, structural/authorization/reference denials, readiness, upload states and failed mutations. Review/navigation browser fixtures use the incomplete-entry API contract explicitly rather than misrepresenting a successful file upload.
All sources and standards
Current components and theme tokens. Fictional example data. Source views refresh on deployment; authors maintain contract notes.