Answer page: second-pass design study and handover errata - #2356
Conversation
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
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Warning Review limit reachedNext included review available in 16 minutes. View limit detailsLimit 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. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (4)
Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 4 potential issues.
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.
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
There was a problem hiding this comment.
💡 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".
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.
|
@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. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
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



Summary
/mockups/answer-chat-perfected-v2. The handover settles direction A and points at/mockups/answer-chat-perfectedas the design to build. That page draws one answer — model-written, confident, three sources, every claim numbered.AnswerStatehas five kinds, and on the only measurement the handover itself cites (30 blinded pairs, 2026-08-18) twenty weresource_only: assembled without the model, carrying noanswerSectionsand 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 forAnswerSection.supportLevelinstead of two, headed sections, a pager that degrades to a counter above four sources, and one drawer menu item mapping to thewrong_sourcefeedback type the taxonomy inevidence-panels.tsxalready ships.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 placementanswer-result-surface.tsxrecords (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'sinset -14px -6pxtap 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 (abox-shadow) and the claim wash (abackground) 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, whichanswer-stream-contract.tsexcludes by name because token events would re-expose unvalidated clinical prose.VerifiedEvidencePreviewUnitlands 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.tsxgainsexportkeywords only — no render change — so v2 extends the approved design rather than forking a copy of it. Chrome suppression inmockups-layout-client.tsxcovers both routes;docs/site-map.mdregenerated.No production surface changed. Nothing under
src/lib/rag/**,src/app/(search-app)orsrc/components/clinical-dashboardwas touched.Verification
npm run verify:pr-local— all gates passed exceptbuild, 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 buildre-run after stopping the dev server and clearing.next— passed, endingClient bundle secret surface check passed.npm run check:bundle-budgetagainst 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 -- lintbefore running it —RUN "lint" — rag scope never defers — CI's own routing treats it as heavy.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 apartialmark treatment that turned out not to be drawn at all — a dottedtext-decorationand a 1px bottom border are both invisible under a0.7emglyph withline-height: 0, so the treatment is a glyph instead.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.npm run verify:uiwas 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
mockups-layout-client.tsxextending chrome suppression to the new path; everything else is additive orexport-keyword-only. Mockups 404 in production.classifyPullRequestFilesreturnsclinicalRisk: false, operationalRisk: false, ragRanking: false, ui: truefor 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.
classifyPullRequestFilesreturnsclinicalRisk: falsefor this file set. All clinical copy on the new route is synthetic and nothing is wired to retrieval.Notes
/mockups/answer-chat-perfectedis deliberately left as the record of what was approved, so the two can be compared side by side before anything is costed.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-v2that keeps direction A (numbered marks, single-source drawer) but illustrates the answer states v1 skipped—ready,source_only,stale_evidence,partial_retrieval—plus foursupportLeveltreatments, 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 newanswer-chat-perfected-v2-mockups.tsx, which imports shared chrome from v1 afteranswer-chat-perfected-mockups.tsxis 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.mdlists the new mockup route;mockups-layout-client.tsxextends 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.