Skip to content

Answer page: second-pass design study and handover errata - #2356

Merged
BigSimmo merged 6 commits into
mainfrom
claude/answer-page-redesign-review-4ufdl5
Aug 24, 2026
Merged

Answer page: second-pass design study and handover errata#2356
BigSimmo merged 6 commits into
mainfrom
claude/answer-page-redesign-review-4ufdl5

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Aug 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • New design-scratch route /mockups/answer-chat-perfected-v2. The handover settles direction A and points at /mockups/answer-chat-perfected as the design to build. That page draws one answer — model-written, confident, three sources, every claim numbered. AnswerState has five kinds, and on the only measurement the handover itself cites (30 blinded pairs, 2026-08-18) twenty were source_only: assembled without the model, carrying no answerSections and therefore no numbers at all. The state the rail exists to serve was never drawn. The new route keeps both decisions the first pass argues for (one colour for the mark, one source at a time in the drawer) and draws the four answer states side by side, four treatments for AnswerSection.supportLevel instead of two, headed sections, a pager that degrades to a counter above four sources, and one drawer menu item mapping to the wrong_source feedback type the taxonomy in evidence-panels.tsx already ships.
  • Four corrections to docs/answer-page-redesign-handover.md, each checked against code rather than inferred, recorded in a new §12 and drawn corrected on the new route: the verification line is placed opposite to the placement answer-result-surface.tsx records (fix(rag): exempt deterministic document-list/table answers from prose sanitizer #207/test(eval): defer clozapine-wcc-abbreviation-threshold golden case #227/fix(dashboard): prune dead #quotes/#images evidence nav anchors #228); the mark's inset -14px -6px tap target overlaps the marks on adjacent lines and the other half of its own cluster, so a tap between two numbers can open the wrong source; the active ring (a box-shadow) and the claim wash (a background) are both dropped in forced-colors, taking the mechanism that holds the reader's place with them; and the streaming frame draws a typewriter caret, which answer-stream-contract.ts excludes by name because token events would re-expose unvalidated clinical prose.
  • New handover §2b listing the answer states the design must cover and the evidence-preview ordering (VerifiedEvidencePreviewUnit lands before the prose and the client already consumes it), plus recommendations recorded against the three open decisions in §10 and the table aside flagged as an unacknowledged removal from a shipped layout.
  • answer-chat-perfected-mockups.tsx gains export keywords only — no render change — so v2 extends the approved design rather than forking a copy of it. Chrome suppression in mockups-layout-client.tsx covers both routes; docs/site-map.md regenerated.

No production surface changed. Nothing under src/lib/rag/**, src/app/(search-app) or src/components/clinical-dashboard was touched.

Verification

  • npm run verify:pr-local — all gates passed except build, which was correctly refused while the dev server held .next (BUILD_REFUSED_DEV_SERVER exit=76). Completed: check:runtime, check:installed-lock-parity, format:changed, sitemap:check, docs:check-index, docs:check-inventory, docs:check-scripts, docs:check-links, check:branch-review-ledger, check:outstanding-issues, check:ledger-write-discipline, lint, typecheck, test. Unit suite: Test Files 831 passed (831) / Tests 10011 passed | 4 skipped (10015).
  • npm run build re-run after stopping the dev server and clearing .next — passed, ending Client bundle secret surface check passed.
  • npm run check:bundle-budget against that fresh build — mockups (design scratch, 404s in production, 118 routes, 140 exclusive chunks): 522.0 KiB gzip — baseline 487.6 KiB, within tolerance. Production bucket unchanged by this diff and also within tolerance.
  • npm run arbiter -- lint before running it — RUN "lint" — rag scope never defers — CI's own routing treats it as heavy.
  • Browser check via npm run ensure (http://localhost:4598), Chromium, at 390px and 1440px. Every panel rendered and read; several defects found this way and fixed before commit, including a partial mark treatment that turned out not to be drawn at all — a dotted text-decoration and a 1px bottom border are both invisible under a 0.7em glyph with line-height: 0, so the treatment is a glyph instead.
  • Forced-colors verified rather than asserted: Chromium forcedColors: "active" on the new route. The claim wash is dropped as expected and the paired left rule survives, so the claim owning the open source stays identifiable; the active mark's outline survives where the first pass's box-shadow ring would not.
  • UI verification not run: npm run verify:ui was not run. This diff adds a design-scratch route that 404s in production and touches no production component, so the Chromium production journeys cover no changed failure path. Targeted browser evidence for the changed surface is above.

Risk and rollout

  • Risk: Very low. The only change to an existing rendered file is a one-line condition in mockups-layout-client.tsx extending chrome suppression to the new path; everything else is additive or export-keyword-only. Mockups 404 in production.
  • Rollback: Revert the commit. Nothing depends on the new route.
  • Provider or production effects: None. No provider-backed command was run.
  • RAG impact: none — no retrieval, ranking, selection, generation or fixture surface is touched. (classifyPullRequestFiles returns clinicalRisk: false, operationalRisk: false, ragRanking: false, ui: true for this file set.)

Clinical Governance Preflight

Not applicable: this change touches no ingestion, answer generation, search/ranking, source rendering, document access, privacy, production env, or clinical output surface. classifyPullRequestFiles returns clinicalRisk: false for this file set. All clinical copy on the new route is synthetic and nothing is wired to retrieval.

Notes

  • The handover's build order still holds — rail and drawer first on every answer, then marks where sections earn them. What this changes is what "every answer" has to mean.
  • /mockups/answer-chat-perfected is deliberately left as the record of what was approved, so the two can be compared side by side before anything is costed.
  • Three open decisions in handover §10 now carry recommendations drawn as frames rather than argued in prose, so they can be judged by looking.

Generated by Claude Code


Note

Low Risk
Additive mockup route and documentation only; the sole change to existing runtime UI is extending mockup chrome suppression to the new path.

Overview
Adds a second-pass design mockup at /mockups/answer-chat-perfected-v2 that keeps direction A (numbered marks, single-source drawer) but illustrates the answer states v1 skipped—ready, source_only, stale_evidence, partial_retrieval—plus four supportLevel treatments, evidence-before-prose loading, drawer pager degradation above four sources, verification above prose, and related UX fixes (tap targets, forced-colors outlines, citation feedback menu item). The route is a thin page wrapper; the UI lives in new answer-chat-perfected-v2-mockups.tsx, which imports shared chrome from v1 after answer-chat-perfected-mockups.tsx is export-only (no behavior change to v1).

Handover doc (docs/answer-page-redesign-handover.md) now points builders at v2, adds §2b (answer states and evidence-preview ordering), expands §3–§6/§10 with code-aligned build guidance, and adds §12 errata against the first mockup. docs/site-map.md lists the new mockup route; mockups-layout-client.tsx extends full-frame chrome suppression to v2 like v1.

No production answer UI, RAG, or clinical-dashboard code changes.

Reviewed by Cursor Bugbot for commit d8bae82. Configure here.

The answer-page handover settles direction A and points at
/mockups/answer-chat-perfected as the design to build. That page draws one
answer: model-written, confident, three sources, every claim numbered. The
payload produces at least five materially different answers, and on the only
measurement the handover itself cites (30 blinded pairs, 2026-08-18) twenty
were source_only -- assembled without the model, carrying no sections and
therefore no numbers at all. The state the rail exists to serve was never
drawn.

New route /mockups/answer-chat-perfected-v2 keeps both decisions the first
pass argues for (one colour for the mark, one source at a time in the drawer)
and adds what was missing:

- The four answer states side by side, so source_only can be judged rather
  than reasoned about. With no numbers in the prose every route to a source
  runs through the rail, which is why the rail is sized at production tap
  size here and cannot be the control that shrinks when space is tight.
- Four treatments for AnswerSection.supportLevel, not two. The build order
  gates marks on support, so support is the field that decides whether a
  number appears; the first pass struck it from the drawer as "never
  actionable". nearby stays a control (the reader should see what the page
  does say); unsupported does not (there is nowhere for it to lead).
- Headed sections. The payload delivers heading and kind, and the first pass
  rendered four unheaded sentences.
- The pager degrades to a counter above four sources; the render policy caps
  primary sources at six and six buttons plus prev, next, overflow and close
  need ~396px inside a ~362px phone drawer.
- One drawer menu item mapping to the wrong_source feedback type the
  taxonomy already ships. Opening a cited page and finding it does not say
  the thing is the moment a bad citation is catchable, and there was no
  control for it anywhere.

Four corrections, each checked against code rather than inferred, recorded in
handover section 12 and drawn corrected on the new route:

- The verification line is drawn below the prose; answer-result-surface
  records the opposite placement with its reasons, and reads attribution from
  answerQualityTier so it cannot announce AI authorship above a source-only
  notice.
- The mark's tap target at inset -14px -6px overlaps the marks on adjacent
  lines and, inside a cluster, the other half of its own cluster, so a tap
  between two numbers can open the wrong source. Bounded to the line box and
  split across the cluster. An inline mark cannot reach the repo's 48px
  standard without stealing the line above it, which is the argument for the
  rail rather than a defect to design around.
- The active ring was a box-shadow and the claim wash a background; neither
  is painted in forced-colors, so the mechanism that holds the reader's place
  disappeared there. Now an outline plus a left rule, verified under Chromium
  forcedColors: active rather than asserted.
- The streaming frame drew a typewriter caret. The stream contract excludes
  token events by name because they would re-expose unvalidated clinical
  prose. Replaced with the sequence that does occur: the evidence preview
  lands and the rail paints before there is an answer to number.

Also records recommendations against the handover's three open decisions, and
notes the table aside as an unacknowledged removal from a shipped layout.

v1 is left as the record of what was approved; only export keywords were added
to it so v2 extends that design instead of forking a copy. Chrome suppression
covers both routes; site map regenerated.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AP3MXGx1bGeEBmFKYkeLA8
@supabase

supabase Bot commented Aug 24, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 16 minutes.

View limit details

Limit details: You’ve used the included review currently available. Your 100 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d5be023c-35d2-4d5c-ac2f-03c9d4db0660

📥 Commits

Reviewing files that changed from the base of the PR and between c2403ff and 91703d7.

⛔ Files ignored due to path filters (3)
  • docs/answer-page-redesign-handover.md is excluded by !docs/**, !**/*.md
  • docs/branch-review-records/6db09ce93d6b8a6699b2577fa59a13c9a24cc65aaec4825715094972f3ef0941.record.md is excluded by !docs/**, !**/*.md
  • docs/site-map.md is excluded by !docs/**, !**/*.md
📒 Files selected for processing (4)
  • src/app/mockups/answer-chat-perfected-v2/page.tsx
  • src/app/mockups/mockups-layout-client.tsx
  • src/components/answer-chat-perfected-mockups.tsx
  • src/components/answer-chat-perfected-v2-mockups.tsx

Comment @coderabbitai help to get the list of available commands.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 4 potential issues.

Fix All in Cursor

Bugbot Autofix prepared fixes for all 3 issues found in the latest run.

  • ✅ Fixed: Drawer menu state not reset
    • V2Drawer now keys V2DrawerPanel on the open source id, so overflow-menu state is discarded on pager steps and reopen.
  • ✅ Fixed: Source-only banner duplicates notice
    • StateBanner now returns null for source_only, matching production AnswerCard and handover §2b so the verification notice is the only caution.
  • ✅ Fixed: Wrong drawer support fallback
    • Uncited rail sources now fall back to unsupported instead of inventing direct claim support.

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit d8bae82. Configure here.

Comment thread src/components/answer-chat-perfected-v2-mockups.tsx
Comment thread src/components/answer-chat-perfected-v2-mockups.tsx
Comment thread src/components/answer-chat-perfected-v2-mockups.tsx Outdated
Comment thread src/components/answer-chat-perfected-v2-mockups.tsx

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not approved: Cursor Bugbot completed and reported 4 unresolved findings that need human review. Reviewers were not assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

Immutable record travelling with its owning product PR rather than a
ledger-only tip, per the ledger write policy.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AP3MXGx1bGeEBmFKYkeLA8

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d8bae8235d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/components/answer-chat-perfected-v2-mockups.tsx Outdated
Comment thread src/components/answer-chat-perfected-v2-mockups.tsx Outdated
Comment thread docs/answer-page-redesign-handover.md Outdated
Key the drawer panel on the open source so overflow-menu state cannot leak across pager steps, drop the duplicate source-only banner that restates the verification notice, and treat uncited rail sources as unsupported instead of inventing direct claim support.
@BigSimmo

Copy link
Copy Markdown
Owner Author

@codex resolve actionable Codex review findings for this pull request and current head using the repository instructions. This is the pull request's single automatic repair pass: do not perform a fresh review, create new standalone findings, or request another review. Work only the existing unresolved Codex threads on the current head. The only repository destination is BigSimmo/Database, and the only branch destination is the pull request head branch claude/answer-page-redesign-review-4ufdl5 at starting commit 5b7b8d7; never publish fixes to a detached or synthetic work branch and never create a stacked pull request. Use the authenticated GitHub connector to commit each approved fix to BigSimmo/Database:claude/answer-page-redesign-review-4ufdl5, then verify that the pull request head contains the published commit before reporting success. Always fix P0 and P1 findings. For P2 and lower findings, fix only clear, scoped, low-risk issues; otherwise disposition them with a concise reason. For a fixed thread, reply with as the first line and as the second line. For a no-code disposition, use followed by . These result markers authorize the workflow to close that exact thread only after it verifies a fixed commit is the pull request head; a local-only commit is not a fix. If publication or verification fails, do not use either result marker, do not claim success, and leave the thread open with the blocker. If human input or new authorization is required, do the same. Finish only after every actionable thread is fixed or dispositioned and closed, or explicitly left open for a human decision. Do not update the branch from main, address unrelated reviews, broaden scope, or create more than one scoped fix commit. Do not use external APIs, paid services, credentials, dependency changes, or broad refactors unless explicitly authorized. Add targeted tests where behavior changes and run the narrowest relevant validation.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: fb269a0ec1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not approved: Cursor Bugbot still has unresolved findings that need human review, including one not covered by the later autofix. Human review is needed; reviewers were not assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

Two findings from the Codex connector were verified in the code before being
accepted, and both correct claims this study and the handover were making.

source_only does not imply section-less. applyProviderLabels tags any
model-less routingMode: "extractive" answer source_only, and
buildExtractiveAnswer passes answerSections straight through, so an extractive
answer can be source_only and still carry sections with support levels. Marks
are now gated on the sections themselves rather than on the quality tier --
one rule instead of a special case, and it fails closed: no sections, no
marks. The handover's section 1 carried the same invariant and is corrected in
place, as is the section 2b state table.

The evidence preview must not be numbered. buildEvidencePreviewUnit emits the
top slice of the retrieval results in retrieval order, while
buildAnswerRenderModel rebuilds primarySources from citations, quote cards,
section citation ids and core source links, then dedupes and caps by trust.
Different sets in a different order, so a number assigned at preview time can
point at a different document once the answer lands -- the exact wrong-page
attribution this design forbids everywhere else. Preview cards now render
unnumbered and numbering is what arrival buys; the panel three caption said
the opposite and is rewritten.

Support is scoped to a claim, not to a source. The drawer now carries the
section whose mark opened it, so one document cited by two claims can read
direct for one and partial for the other. Opened from the rail or the pager
there is no claim, and the drawer says so rather than inventing one -- the
earlier fallback to "direct" (and the autofix's fallback to "unsupported")
both asserted support the payload never established. Both cases are drawn
side by side in panel four.

Also, from the Cursor Bugbot pass: the drawer panel is keyed on the open
source so overflow-menu state cannot leak across pager steps, and the
source_only verification notice no longer tells a reader to check numbers on
an answer that has none.

Partially reverts one autofix change. Dropping the source_only banner outright
was too far -- production does render a source-only disclosure
(source-only-disclosure in answer-content.tsx). What it must not do is restate
the verification notice sitting directly above it, so it comes back in the
compact expand-on-tap form production actually uses.

Verified: lint, typecheck, and Chromium at 390px and 1440px against every
changed frame. Mockup-only plus docs; no production surface touched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AP3MXGx1bGeEBmFKYkeLA8

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not approved: Cursor Bugbot still has unresolved findings that need human review on the current head. Human review is needed; reviewers were not assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved: Cursor Bugbot is not running on this head, and its earlier findings are all resolved. Reviewers were not assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@BigSimmo
BigSimmo enabled auto-merge (squash) August 24, 2026 18:34
@BigSimmo
BigSimmo merged commit c4e4196 into main Aug 24, 2026
29 checks passed
@BigSimmo
BigSimmo deleted the claude/answer-page-redesign-review-4ufdl5 branch August 24, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants