CE-WP-0011: Attributes title migration, guide polish, Add attribute placement.
Migrate legacy Demo evidence-backed form titles on capture-state load; move Add attribute below the list; track workplan CE-WP-0011 as finished.
This commit is contained in:
parent
1fb1841173
commit
154e48cdd2
4 changed files with 115 additions and 2 deletions
|
|
@ -32,10 +32,12 @@ publish tasks wait on ADR-0002 resolution.
|
|||
| Workplan | Title | Status |
|
||||
|----------|-------|--------|
|
||||
| `CE-WP-0010` | Annotate & Attributes UX — labels, filters, layout, evidence connectors | finished |
|
||||
| `CE-WP-0011` | Attributes guide n:m lines, title migration, Add attribute placement | finished |
|
||||
|
||||
User-facing polish after manual document review: rename Review→Annotate, keep
|
||||
Evidence column in Capture with Attributes on the right, list filters, and
|
||||
card→citation connector lines. See `workplans/CE-WP-0010-annotate-attributes-ux.md`.
|
||||
card→citation connector lines. CE-WP-0011 adds n:m attribute↔evidence guides,
|
||||
legacy title migration, and Add attribute below the list.
|
||||
|
||||
## Order
|
||||
|
||||
|
|
|
|||
|
|
@ -87,6 +87,21 @@ describe("capture-persistence", () => {
|
|||
expect(loaded?.fieldValues).toEqual({ amount: "1500", summary: "Updated" });
|
||||
});
|
||||
|
||||
it("migrates legacy Demo evidence-backed form title to Attributes", () => {
|
||||
const storage = memoryStorage();
|
||||
const base = defaultCaptureState();
|
||||
const raw = {
|
||||
...base,
|
||||
formSchema: {
|
||||
...base.formSchema,
|
||||
title: "Demo evidence-backed form",
|
||||
},
|
||||
};
|
||||
storage.setItem(captureStateKey(SESSION), JSON.stringify(raw));
|
||||
const loaded = loadCaptureState(SESSION, storage);
|
||||
expect(loaded?.formSchema.title).toBe("Attributes");
|
||||
});
|
||||
|
||||
it("removeCaptureState clears the key", () => {
|
||||
const storage = memoryStorage();
|
||||
saveCaptureState(SESSION, defaultCaptureState(), storage);
|
||||
|
|
|
|||
|
|
@ -51,6 +51,20 @@ function isFormSchema(value: unknown): value is FormSchema {
|
|||
});
|
||||
}
|
||||
|
||||
/** Legacy Capture titles from pre-CE-WP-0010 sessions. */
|
||||
const LEGACY_FORM_TITLES = new Set([
|
||||
"Demo evidence-backed form",
|
||||
"Demo form",
|
||||
"Form",
|
||||
]);
|
||||
|
||||
function normalizeFormSchemaTitle(schema: FormSchema): FormSchema {
|
||||
if (!LEGACY_FORM_TITLES.has(schema.title) && schema.title.trim().length > 0) {
|
||||
return schema;
|
||||
}
|
||||
return { ...schema, title: DEMO_SCHEMA.title };
|
||||
}
|
||||
|
||||
function parseCaptureState(raw: unknown): CaptureStateSnapshot | null {
|
||||
if (typeof raw !== "object" || raw === null) return null;
|
||||
const o = raw as Record<string, unknown>;
|
||||
|
|
@ -67,7 +81,7 @@ function parseCaptureState(raw: unknown): CaptureStateSnapshot | null {
|
|||
const evidenceLinks = o.evidenceLinks as EvidenceLink[];
|
||||
return {
|
||||
version: CAPTURE_STATE_VERSION,
|
||||
formSchema: o.formSchema,
|
||||
formSchema: normalizeFormSchemaTitle(o.formSchema),
|
||||
fieldValues,
|
||||
evidenceLinks,
|
||||
};
|
||||
|
|
|
|||
82
workplans/CE-WP-0011-attributes-guide-nm.md
Normal file
82
workplans/CE-WP-0011-attributes-guide-nm.md
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
---
|
||||
id: CE-WP-0011
|
||||
type: workplan
|
||||
title: "Attributes guide n:m lines, title migration, Add attribute placement"
|
||||
domain: infotech
|
||||
repo: citation-evidence
|
||||
repo_id: a677c189-b4e2-4f2a-9e48-faa482c277e6
|
||||
topic_slug: citation_evidence_mvp
|
||||
topic_id: cee7bedf-2b48-46ef-8601-006474f2ad7a
|
||||
status: finished
|
||||
owner: codex
|
||||
created: "2026-07-30"
|
||||
updated: "2026-07-30"
|
||||
depends_on_workplan: CE-WP-0010
|
||||
planning_order: 11
|
||||
planning_priority: high
|
||||
spec_refs:
|
||||
- workplans/CE-WP-0010-annotate-attributes-ux.md
|
||||
- workplans/CE-WP-0003-form-binding-visual-guide.md
|
||||
---
|
||||
|
||||
# CE-WP-0011 — Attributes guide polish
|
||||
|
||||
Follow-on after CE-WP-0010 manual review. CE-WP-0010 shipped layout/filters;
|
||||
this workplan covers residual UX and n:m visual guide behaviour.
|
||||
|
||||
## User requirements (locked)
|
||||
|
||||
1. **Caption is always Attributes** — including sessions that still have the
|
||||
legacy persisted title `"Demo evidence-backed form"` in capture-state.
|
||||
2. **Optical links** run from the **right edge of evidence cards** to the
|
||||
**left edge of attribute rows** (side-by-side Capture columns).
|
||||
3. **n:m visualisation** — evidence ↔ attributes is many-to-many:
|
||||
- Selected **evidence** → draw lines to **all** linked attributes.
|
||||
- Selected **attribute** → draw lines to **all** linked evidence cards.
|
||||
- Evidence → citation highlight remains as in CE-WP-0010.
|
||||
4. **Add attribute** control sits **below** the list of captured attributes
|
||||
(not in the header next to the title).
|
||||
|
||||
## Tasks
|
||||
|
||||
## T01 — Migrate legacy Capture titles on load
|
||||
|
||||
```task
|
||||
id: CE-WP-0011-T01
|
||||
status: done
|
||||
priority: high
|
||||
```
|
||||
|
||||
Normalize `formSchema.title` when loading capture-state from localStorage.
|
||||
|
||||
## T02 — Overlay n:m + edge anchors
|
||||
|
||||
```task
|
||||
id: CE-WP-0011-T02
|
||||
status: done
|
||||
priority: high
|
||||
```
|
||||
|
||||
Update `Overlay` to resolve all links via binding service; card right →
|
||||
field left.
|
||||
|
||||
## T03 — Move Add attribute below list
|
||||
|
||||
```task
|
||||
id: CE-WP-0011-T03
|
||||
status: done
|
||||
priority: medium
|
||||
```
|
||||
|
||||
`FormRenderer` header keeps title + filter; add button and add form at bottom.
|
||||
|
||||
## T04 — Tests + finish
|
||||
|
||||
```task
|
||||
id: CE-WP-0011-T04
|
||||
status: done
|
||||
priority: medium
|
||||
depends_on: [T01, T02, T03]
|
||||
```
|
||||
|
||||
Unit/DOM coverage; mark workplan finished.
|
||||
Loading…
Add table
Add a link
Reference in a new issue