Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 83 additions & 23 deletions docs/answer-page-redesign-handover.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ The live answer surface opens four separate panels from one answer:
| Today | Where | Becomes |
| --------------------------------- | --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| Sources capsule → popover / sheet | `answer-content.tsx` `NaturalLanguageAnswer` | The source rail + the single-source drawer |
| Clinical notes sheet | `answer-result-surface.tsx` | Folded into the drawer's per-source content, or dropped |
| Clinical notes sheet | `answer-result-surface.tsx` | **Goes** (settled 2026-08-24). Its content is carried by the prose, the drawer and the rail — audited in §10a |
| Evidence sheet (6 tabs) | `answer-result-surface.tsx` → `evidence-panels.tsx` | The drawer. A table on a cited page becomes a chip inside that source |
| Safety findings sheet | `answer-result-surface.tsx` | Stays a distinct surface — safety findings are answer-level, not per-source. Do **not** fold this into the drawer |

Expand Down Expand Up @@ -196,7 +196,7 @@ the earlier margin-plus-padding read as a word space. Hover and focus paint
- **One colour, always.** Document staleness is not encoded in the mark. It is a
property of the document, and two hues inside running prose make the eye stop
twice. Status lives on the rail card and in the drawer. _(This is the one design
decision the owner may still reverse — see §10.)_
decision the owner might have reversed; **settled 2026-08-24 — one colour stays.** See §10.)_
- **Touch target — the v1 figures are wrong; use these.** An absolutely positioned
transparent child that must not change the line box, at `inset -7px -10px -8px -10px`
and **split across a cluster** (outer edges reach 10px, interior edges 2px).
Expand Down Expand Up @@ -415,24 +415,79 @@ requirement — it costs a branch in the render path that has to be removed late

---

## 10. Open decisions for the owner

_Recommendations for all three are drawn in `/mockups/answer-chat-perfected-v2`; decide
against the frames rather than against the prose._

1. **Status in the mark.** The design deliberately keeps every mark one colour and
puts document staleness on the rail card and in the drawer. If a claim resting on
an out-of-date document should say so at the point of the claim, that is a one-line
change in the mark component — but decide before PR 2, not after.
2. **What happens to `compactCitations`.** The preference currently shrinks the
sources capsule. The capsule is going. Either retarget it at the rail or retire it.
_Recommendation (drawn in v2): retarget._ Compact collapses the rail to one
`Sources · 3` chip that expands. The invariant `tests/answer-preferences.dom.test.tsx`
pins — the missing-source warning is never hidden in compact mode — then still means
something, because the verification notice and any worded mark sit outside the rail.
3. **Clinical notes.** The design folds the clinical-notes sheet away. Confirm nothing
in it is relied on before it goes; it is the one removed surface with content not
obviously duplicated elsewhere.
## 10. Decisions — settled by the owner, 2026-08-24

All four are settled. They were judged against the frames in
`/mockups/answer-chat-perfected-v2`, which already draws each one the way it was decided.
**Do not reopen these while building.** The reasoning is kept alongside the verdict so a
later reader can see why, rather than re-deriving it.

1. **Status in the mark — NO. Every mark stays one colour.** Document staleness is a
property of the document, not of the claim, and two hues inside running prose make the
eye stop twice at reading speed. Status is carried where there is room to say it in
words: the rail card's tinted badge and the drawer's metadata line. This also keeps the
mark legible in forced-colors, where a second hue would not survive (§4).
2. **`compactCitations` — KEEP, retargeted at the rail.** Compact collapses the rail to a
single `Sources · 3` chip that expands on tap. The preference therefore keeps meaning
something instead of silently becoming a no-op when the capsule goes. The invariant
`tests/answer-preferences.dom.test.tsx` pins — the missing-source warning is never
hidden in compact mode — still holds, because the verification notice, the source-only
disclosure and any worded mark all sit outside the rail.
3. **The table aside — GOES. Tables fold into the drawer.** The wide-screen
`table-specific-answer-layout` column is removed; a table on a cited page becomes a chip
inside that source. The accepted cost is that a table can no longer be read side by side
with the answer on a large screen — it is one tap away instead. Stated so the removal is
deliberate; see §12.5.
4. **The clinical-notes sheet — GOES.** Audited before the decision was recorded rather
than after; the audit is §10a. Nothing in it is lost, but two at-a-glance views are, and
one of those is worth re-checking before the old surface is actually deleted.

### 10a. Clinical-notes Essentials audit (2026-08-24, corrected)

The Essentials tab is the only removed surface whose content was not obviously duplicated, so
it was traced rather than assumed.

**Trace the rendered rows, not the builder.** The first version of this audit read
`buildClinicalOutputSections` (`src/lib/ward-output.ts`) and reported every section it
produces. That is wrong: two of those sections never reach the screen. Corrected after review
of PR #2358, by tracing what actually renders.

What the sheet renders, exactly:

- `clinicalNotesDetailSectionsForAnswer` (`evidence-panels.tsx`) ends with
`.filter((section) => section.items.length > 0)`, so any section carrying only `tables`
is dropped before the tabs are built.
- `clinicalNotesRowsForTab` then builds rows with `for (const item of section.items.slice(0, 4))`.
**A table never becomes a row.**
- `displayItemsForClinicalDetailSection` additionally drops items already redundant with the
answer prose, keeping the originals only when that would empty the section — so the sheet is
a de-duplicated view of the prose to begin with.

Consequently:

| Essentials section | Created as | Renders? |
| --------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| `support-map` | `items: []` plus one structured-support table (`ward-output.ts:705`) | **Never.** Dropped by the empty-items filter |
| `comparison` | `items: []` plus one table when the prose produced no comparison lines (`:766`) | **Only when the prose produced comparison items**; the table-only form is dropped |
| `thresholds` | `items: thresholdItems` plus tables | **Its items only** — the threshold lines from the prose and quote cards. Its tables never render |
| `monitoring` / `medication` | items from `parsedLines` | Yes — and those lines are the answer prose and `sectionDisplayLines` |

**Corrected conclusion: no content is lost, and one at-a-glance view is.**

Every row the Essentials tab renders originates in the answer prose or its sections, which the
new design shows as the prose itself. The earlier claim that a _stacked per-document comparison_
view would be lost was wrong — that view is table-only and never rendered here.

**The one real loss is the grouped threshold list**: `thresholds` items collect the
threshold-shaped lines into a single scan, and the new design has no equivalent. Every value is
still on screen or one tap away, so it is not a blocker — but re-check it against real answers
once the rail and drawer ship, **before** the old surface is deleted in the separate PR §8
already stages.

**A method note worth keeping.** This audit was wrong the first time in the same way the
first-pass design was wrong: it asserted from a code path without checking what the code path
puts on screen. When this document says "confirm nothing is relied on", it means trace to the
rendered output.

## 11. Related records

Expand Down Expand Up @@ -500,11 +555,16 @@ Both were raised against PR #2356 and both were verified in the code before bein
and promising the number is stable would reintroduce, in the streaming path, the exact
wrong-page attribution the design forbids everywhere else.

### 12.5 The table aside is an unacknowledged removal
### 12.5 The table aside — raised as an unacknowledged removal, now decided

`data-testid="table-specific-answer-layout"` gives tables their own column on `lg:` today
(`answer-result-surface.tsx`). Folding tables into a chip inside the drawer removes that
column. That is a real change to a shipped layout: state it in the PR body and decide it,
rather than discovering it at review.
column — a real change to a shipped layout, raised here because the design was making it
silently.

**Settled 2026-08-24: the column goes.** The table travels with the page it came from, and
the answer keeps one reading column. The accepted cost is that a table can no longer be read
side by side with the answer on a large screen. Still state it in the PR body — a reviewer
seeing the aside disappear deserves the sentence.

---
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| 2026-08-24 | PR #2358 | b23aaec3922351123bc5c069b6f99bc7cf51ca9c | answer page decisions + clinical-notes Essentials audit | Records the four settled owner decisions in the handover with reasoning (mark stays one colour; compactCitations kept and retargeted at the rail; table aside goes; clinical-notes sheet goes). New section 10a audits the Essentials tab before its removal is recorded: all five section ids trace through buildClinicalOutputSections to the prose, the answerSections, the quote cards or promoted visualEvidence, all of which the new surface shows. No content lost; two at-a-glance views are (threshold list, stacked per-document detail). Flags that buildSourceComparisonTable fires on any 3+ document answer, and that the threshold list has no equivalent and must be re-checked on real answers before the old surface is deleted. Design study copy updated from open questions to decisions taken. Follow-up to PR #2346/#2356; branch restarted from merged main c4e4196. | arbiter (RUN lint), eslint, tsc --noEmit, npm run format, Chromium 1440px with 0px horizontal overflow |
12 changes: 6 additions & 6 deletions src/components/answer-chat-perfected-v2-mockups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1384,17 +1384,17 @@ const RECONCILE: Array<[string, string, string]> = [
[
"Table aside",
"`table-specific-answer-layout` gives tables their own column on wide screens today.",
"The design folds tables into a chip in the drawer, which removes that column. A real removal — decide it, do not let it happen quietly.",
"Settled: the column goes. Tables fold into a chip in the drawer, so a table travels with the page it came from and the answer keeps one reading column. Accepted cost — a table can no longer be read beside the answer on a large screen.",
],
[
"compactCitations",
"The preference shrinks a capsule this design deletes.",
"Retargeted at the rail: collapse to one chip that expands. The pinned invariant — the missing-source warning is never hidden — still holds, because the notice and any worded mark sit outside the rail.",
"Settled: kept, retargeted at the rail collapse to one chip that expands. The pinned invariant — the missing-source warning is never hidden — still holds, because the notice and any worded mark sit outside the rail.",
],
[
"Clinical notes sheet",
"Folded away with nothing obviously carrying its content.",
"Its three tabs are Essentials, Actions and Safety. Actions and Safety already have homes; confirm Essentials is duplicated before it goes.",
"Folded away. Essentials was the tab nothing obviously carried.",
"Settled: it goes — audited first, then corrected in review. The sheet drops any section carrying only tables and builds rows from items alone, so its structured-support and table-only comparison rows never rendered at all. Everything it does render originates in the answer prose or its sections, which this design shows as the prose. No content is lost; one at-a-glance view is — the grouped threshold list — and that is the thing to re-check on real answers before the old surface is deleted.",
],
[
"Answer feedback",
Expand Down Expand Up @@ -1637,7 +1637,7 @@ export function AnswerChatPerfectedV2MockupsPage() {
</DetailCard>
<DetailCard
title="compactCitations, retargeted"
body="The preference shrinks a capsule this design deletes. Pointed at the rail it still means something: collapsed to one chip that expands, while the notice and any worded mark stay visible which is the invariant its test pins."
body="Settled: kept rather than retired. The preference shrinks a capsule this design deletes; pointed at the rail it still means somethingcollapsed to one chip that expands, while the notice and any worded mark stay visible, which is the invariant its test pins."
>
<div className="space-y-2">
<V2Rail pool={THREE_SOURCES} activeId={null} onOpen={() => undefined} compact />
Expand All @@ -1651,7 +1651,7 @@ export function AnswerChatPerfectedV2MockupsPage() {
<Panel
step="Six"
title="What this collides with"
intro="Five things the design touches that already have owners or recorded decisions. None is a reason not to build it; all five need a sentence in the PR rather than being discovered at review."
intro="Five things the design touches that already have owners or recorded decisions. Three were open questions for the owner and are now settled — recorded here with their reasoning so nobody reopens them while building. All five still want a sentence in the PR rather than being discovered at review."
>
<div className="overflow-x-auto">
<table className="w-full min-w-[40rem] border-collapse text-left">
Expand Down
Loading