Skip to content

fix(ui/answer): keep answer-surface counts neutral and the safety tile amber - #2481

Merged
BigSimmo merged 4 commits into
mainfrom
claude/answer-page-handover-c2qlwy
Aug 31, 2026
Merged

fix(ui/answer): keep answer-surface counts neutral and the safety tile amber#2481
BigSimmo merged 4 commits into
mainfrom
claude/answer-page-handover-c2qlwy

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • The Evidence gaps count is neutral instead of amber. It was painted --warning-soft. §12.7 of docs/answer-page-redesign-handover.md settled this — "the evidence-gaps count is neutral, not amber. A count painted with a status colour is a status-coloured numeral, which the same contract holds at zero, and the icon beside it already says what state it is in" — and the approved specimen in answer-chat-perfected-v2-mockups.tsx ("Seven — What sits under the answer") draws it neutral, but the correction never reached production. It now matches the neutral count the safety row directly above it already used, so the two counts on one screen read as one treatment.
  • The safety-findings sheet no longer opens with an amber shield in a blue tile. The call site layered text-[color:var(--warning)] onto iconTilePremium, which recoloured only the glyph; the recipe's clinical-accent border and background stayed. Measured at 390px: card tile rgb(254,247,236) / rgb(245,217,168), sheet tile rgb(242,248,254) / rgb(207,226,246) — the same control drawn in two colours either side of one tap. The tile is now written out with the warning tones, identical to AnswerSupportSummaryCard's tile, which is what owner decision 3 means by colour living in the icon tile. iconTilePremium is no longer imported in that file.
  • That sheet's header count is neutral too, for the same reason as the first bullet, and because the card that opens it already drew its count neutral. Geometry unchanged; only the three colour classes moved.

Display only. No behaviour, no retrieval, no clinical wording, no copy changes. Two files, colour tokens and comments.

Verification

  • npm run verify:pr-local
PR-local verification summary:
- completed: check:runtime, check:installed-lock-parity, format:changed, lint, typecheck, test,
  check:repo-awareness-snapshot, build, eval:rag:offline, eval:rag:adversarial:offline,
  check:medication-interactions, check:medication-lexicon-report
- failed: (none)
- not reached: (none)

Also run directly, before the gate above:

  • npm run test:focused -- --files src/components/clinical-dashboard/evidence-panels.tsx,src/components/clinical-dashboard/answer-result-surface.tsxTest Files 6 passed (6) / Tests 62 passed (62).
  • npm run check:design-system-contractDesign-system contract passed (1084 production files; raw colors 0; literal shadows 0; legacy tap classes 0; sub-floor interactive min-heights 2; edge conflicts 5; 1px shadow spreads 0). and Status-colour boundary: colour-only status indicators 0; status-coloured numerals 0; image inversions 0.

UI verification not run: npm run verify:ui was not run because no shared answer-surface foundation changed — this is three colour classes on two components, with no geometry, layout, routing, motion or chrome change. In its place the changed surface itself was proved in Chromium at 390px: the answer page and the safety-findings sheet were rendered in light, dark and forced colours before and after, and the fix was confirmed by reading computed styles rather than by eye. After the change the sheet's icon tile resolves to exactly the card tile's rgb(254,247,236) / rgb(245,217,168) / rgb(138,77,5) in light and rgb(61,47,20) / rgb(114,94,35) / rgb(242,196,90) in dark, and both counts resolve to --surface-wash / --border / --text-muted in both themes.

npm run check:production-readiness was not run: no clinical workflow, privacy, environment, Supabase, source-governance or deployment behaviour is touched by a colour change. It is separately known to fail on pre-existing privacy debt tracked as #HVTYAT, which is unrelated to this branch and not chased here.

A note on the first gate run, for anyone reading the branch history: tests/privacy-readiness-contract.test.ts and tests/clinical-hazard-controls.test.ts failed with reviewedCommit is not an ancestor of HEAD. That was the container's shallow clone, not this change — after git fetch --deepen=2000 both pass, and the full verify:pr-local above is green on complete history.

Risk and rollout

  • Risk: Very low. Three colour classes on two components, display only. The realistic failure mode is aesthetic — a count that reads as less urgent than before — which is the intended change and the one §12.7 argued for, on the grounds that the icon and the words carry the state and the design-system contract holds colour-only status indicators at zero either way.
  • Rollback: Revert the single commit. Nothing else depends on it; no data, schema, contract or stored state is involved.
  • Provider or production effects: None.
  • RAG impact: no retrieval behaviour change — nothing under src/lib/rag/, clinical-search, retrieval-selection, ranking-config, answer-ranking, the retrieval RPCs, the eval harness or the golden fixture is touched. classifyPullRequestFiles returns ragRanking: false for both changed paths.

Clinical Governance Preflight

  • Source-backed claims still require linked source verification before clinical use
  • No patient-identifiable document workflow was introduced or expanded without explicit governance approval
  • Supabase target remains Clinical KB Database (sjrfecxgysukkwxsowpy)
  • Service-role keys and private document access remain server-only
  • Demo/synthetic content remains clearly separated from real clinical sources
  • Source metadata, review status, and outdated/unknown-source behavior remain conservative
  • Deployment classification/TGA SaMD impact was checked when clinical decision-support behavior changed

On the sixth item specifically, because it is the one a colour change could plausibly weaken: no status signal is removed. The safety row keeps its amber icon tile and its RED FLAG-style severity chip, the sheet header now carries the warning colour it was already trying to carry, and the Evidence gaps control keeps its amber CircleAlert icon and its word. Only the numerals stop being painted, which is what the design decision asked for. On the last item, no clinical decision-support behaviour changed — this alters rendering only.

Notes

  • classifyPullRequestFiles reports clinicalRisk: false, ui: true for these two paths, so the preflight above is not machine-required for this diff. It is completed in full anyway, because the answer surface is where clinical output is read.
  • Owner decisions 1 to 6 in the handover are untouched. In particular the safety card keeps no coloured top rail (decision 3), the merged single panel is unchanged (decision 4), and the follow-up rows remain visible on phones (decision 5).
  • Two things I looked at and deliberately did not change, both flagged in the handover as candidates for another pass: the safety card's overall layout and the merged "Also in your library" line. Both already match their approved specimens at 390px, and re-homing the action row into the safety card — as the specimen happens to draw it — would be a structural change the specimen was not drawn to settle. That is an owner call, not a defect.
  • The degraded source_only state was not inspected at phone width: the local demo server does not honour the response override the smoke suite uses to force it, so it could not be rendered here. Nothing in this diff is specific to that state, but it is an unverified surface and worth a look in a session that can drive it.

Generated by Claude Code


Note

Low Risk
Cosmetic styling only on answer-surface badges and sheet chrome; no auth, data, or clinical logic changes.

Overview
Aligns the clinical answer surface with the design contract: status lives in icons and labels, not in count numerals.

The Evidence gaps utility badge and the safety-findings sheet header count now use neutral --surface-wash / --border / --text-muted styling, matching the safety summary row and approved mockups instead of amber warning backgrounds on the numbers.

The safety sheet header icon tile no longer stacks warning text color on iconTilePremium (which left a blue clinical-accent tile with an amber glyph). It uses the same explicit warning border, background, and icon color as AnswerSupportSummaryCard, so the tile matches the card that opens the sheet.

Display-only token and class changes in two components; no behaviour, copy, or retrieval changes.

Reviewed by Cursor Bugbot for commit d1485d6. Configure here.

…e amber

Three colour defects found by opening the answer page at 390px in light, dark
and forced colours, all the same mistake — a status colour landing on a count
instead of on the icon that already carries the state.

- The `Evidence gaps` count was painted `--warning-soft`. §12.7 of the answer
  page handover settled this ("the evidence-gaps count is neutral, not amber. A
  count painted with a status colour is a status-coloured numeral, which the
  contract holds at zero, and the icon beside it already says what state it is
  in") and the approved specimen in answer-chat-perfected-v2-mockups.tsx draws
  it neutral, but the correction never reached production. It now matches the
  neutral count the safety row directly above it already used.

- The safety-findings sheet opened with an amber shield sitting in a *blue*
  tile. The call site passed `text-[color:var(--warning)]` on top of
  `iconTilePremium`, which recoloured only the glyph — the recipe's
  clinical-accent border and background stayed. The tile is now written out with
  the warning tones, identical to `AnswerSupportSummaryCard`'s tile, so the
  colour the design assigns to the icon tile is the same on both sides of the
  tap. `iconTilePremium` is no longer imported there.

- That sheet's header count was amber too, while the count on the card that
  opens it is neutral — the same number in two treatments. Now neutral, geometry
  unchanged.

Display only. No behaviour, no retrieval, no clinical wording changes.

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

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 98dcd6cc-7666-40d6-983a-f08e8e9db169


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@supabase

supabase Bot commented Aug 31, 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 ↗︎.

@cursor

cursor Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_102980e6-24bb-45b0-b3e1-6e243c7d6c7f)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T06:43:18.805716Z 8bfcfbf PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@BigSimmo
BigSimmo enabled auto-merge August 31, 2026 06:49
@github-actions

Copy link
Copy Markdown
Contributor

CI triage

CI failed on this PR. Automated classification of the 2 failed job(s):

  • Production UI (1)main-side: the same job also failed on the latest completed main CI run.
  • PR requiredmain-side: the same job also failed on the latest completed main CI run.

Compared with main CI run #14585 (failure).

Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger.

@cursor

cursor Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_802006cf-df00-49f8-9e3b-dd54a7fdb374)

Resolve conflicts: keep answer UI colour fixes from this PR; take main's ui-smoke.spec.ts (containment asserts from #2471).
@BigSimmo
BigSimmo disabled auto-merge August 31, 2026 09:03
@BigSimmo
BigSimmo enabled auto-merge (squash) August 31, 2026 09:03
@BigSimmo
BigSimmo merged commit e16d5f6 into main Aug 31, 2026
29 checks passed
@BigSimmo
BigSimmo deleted the claude/answer-page-handover-c2qlwy branch August 31, 2026 09:22
BigSimmo added a commit that referenced this pull request Aug 31, 2026
An agent push on PR #2481 rewrote tests/ui-smoke.spec.ts from 6,019 lines
to 1,081, dropping 74 of its 82 journey tests, under a commit message that
described a narrow comparison change. Squash auto-merge was armed at the
time and a gutted suite goes green trivially, so only an unrelated merge
conflict kept the deletion off main; the later merge of main restored the
file and the squash landed the intended two-file change.

No gate would have caught it: nothing asserts a floor on Playwright test
count or fails on a large test deletion, and the "never skip, disable, or
quarantine a test to get green" rule is agent policy rather than an
enforced check. The queued request proposes a per-path ratchet on test
counts, in the spirit of the bundle-budget baselines.


Claude-Session: https://claude.ai/code/session_01NkKHznd5E5KLnKbowRTLd8

Co-authored-by: Claude <noreply@anthropic.com>
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.

2 participants