assessment-model/docs
Daniel Roth 3b84ed58ad feat(ara-projects): import mapping screen — column + value mapping UI (#415)
Step 2 of 3's screen, on top of the pure logic in the previous commit. Follows
wireframes 08 (value mapping locked) and 09 (unlocked). Writes nothing.

Where the step lives
  Client state inside ImportUpload, not a /import/mapping route: the parsed rows
  live in that component (#414), so a URL step would drop them and force a
  re-upload on every Back. "Continue to mapping" — disabled since #414 —
  now opens the mapping screen.

ImportMapping — the screen
  Owns the two mapping layers and nothing else. Statuses, counts, which values
  need review and whether Continue is enabled are all derived inline from
  (file, columnMapping, valueMapping, targets) on each render, so re-pointing the
  workstream column immediately re-groups the contractor and stage tables — they
  were never a separate copy of the answer. No useEffect, no useMemo.

ColumnMappingTable — file column -> Ara field
  One row per file column with the wireframe's matched / needs-review
  affordances, an "e.g. …" sample from the preview, and a shadcn Select per row
  offering every field plus "Don't import this column". Picking a field another
  column already holds says so in the option hint rather than moving it
  silently. Beneath the table, the requirement blockers: which required fields
  are still unmapped and why. Unmapped *optional* fields are stated, never
  blocking.

ValueMappingTables — values -> the project's own entities
  Three tables. Workstream values map flat; contractor and stage values are
  grouped under the workstream they are scoped to, because a contractor
  assignment and a stage ladder belong to a workstream (ADR-0019) — the same
  "Acme" under two workstreams is two questions, and each picker offers only
  that workstream's assignments. Row counts per value, auto-matched marked as
  such. Notes carry the cases with no row of their own: rows waiting on their
  workstream mapping, blank contractors (an error downstream), and blank stages
  (not an error — they start at the workstream's first stage).

Gating (AC)
  The value tables are locked, exactly as wireframe 08 shows, until every
  required column is mapped — there is nothing to list until we know which
  column holds the workstream. Continue to validation is disabled until the same
  condition holds, and names what is missing. Unmapped *values* never block: they
  surface as "N of M rows will fail validation as mapped".

page.tsx
  Loads the value-mapping targets server-side alongside readiness (read-only, and
  skipped entirely for a gated project, which has nothing to map to). Container
  widened to max-w-5xl for the mapping tables; the eyebrow now covers steps 1–2.

ADR-0020 — records that the import session, and the mapping persisted alongside
it, are client-held. Persisting the mapping without the rows buys nothing: the
rows are client-held too, so a refresh loses them either way and a restored
mapping has no file to apply to. ImportSession is JSON-clean so a future
server-side session can store it unchanged; the ADR names moving the file
server-side as the thing that would change the answer. It also records the
production-database constraint honestly, as a constraint and not as the reason.

Stepping back to the drop zone and forward again keeps the mapping: the session
is held above the mapping component, so that component may unmount freely.

225 tests pass across src/lib/projects; tsc and eslint clean. No component tests
— this repo runs vitest in a node environment with no DOM setup.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 10:22:18 +00:00
..
adr feat(ara-projects): import mapping screen — column + value mapping UI (#415) 2026-07-23 10:22:18 +00:00
backend-asks feat(tags): table query + tag filter, filter-driven bulk assign, preview join, settings UI 2026-07-13 16:23:49 +00:00
design docs(design): home-page redesign context — Stitch refs, PRODUCT.md, impeccable trial 2026-07-07 15:12:07 +00:00
runbooks perf(backfill): faster, resumable recommendation denormalization + ops tooling 2026-07-02 10:00:46 +00:00
wip fix(postcode-search): PR #355 review feedback 2026-07-06 15:13:49 +00:00
wireframes/ara-projects Add Ara Projects UX wireframes under docs/wireframes 2026-07-20 15:15:21 +00:00