Skip to content

Make the nav density profile a required choice, and state review status on the two therapy listings that quote a record - #2728

Open
BigSimmo wants to merge 1 commit into
mainfrom
claude/awesome-lovelace-bzcest
Open

Make the nav density profile a required choice, and state review status on the two therapy listings that quote a record#2728
BigSimmo wants to merge 1 commit into
mainfrom
claude/awesome-lovelace-bzcest

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Summary

Two follow-ups from the PR #2686 session, each fixed at its root cause rather than patched at the symptom.

  • A rail could inherit a width profile it never chose. InPageSectionRail took density as an optional prop with a default, so medication's section rail sat on Therapy's extended profile without ever naming it. density is now required at both the rail and the header layer.
  • Two therapy listings quoted a record's clinical prose with no review state. Related therapies and linked pathway steps now render the same StatusBadge every other therapy surface renders, in a compact size added for dense rows.

Root cause 1: an optional prop with a default made a calibration decision inheritable

registryModeNavDensityProfiles lists the modes that render the top tab bar. Checking it says Therapy is the only extended consumer — and that is true of that registry. But InPageSectionRail declared density = "extended" as a default parameter, and medication-nav-header.tsx passed no density, so it inherited the profile through a code path no registry describes. Retuning extended for Therapy in #2686 therefore unfolded medication's counted labels early, and ui-smoke's prescribing journey was the only thing that caught it.

A default cannot be safe here. The value is a calibration against one label family's measured slot widths, so inheriting another family's is always a guess. The four-slot medication rail carries an icon, a label and a count badge per slot; Therapy's bar carries five plain wordmarks. They are not interchangeable and never were.

Making density required costs each call site one line and makes the consumer set answerable by git grep "density:". It is also self-demonstrating: the typecheck immediately found two further silent inheritors in tests/in-page-nav-header.dom.test.tsx that no one knew were there.

Call sites after the change:

Call site Profile Why
medication-nav-header.tsx extended-counted four slots of icon + label + count badge
therapy-record-nav-header.tsx balanced-four unchanged, already explicit
in-page-nav-header.dom.test.tsx ×2 balanced-four fixtures asserting layout and focus, not band widths

Root cause 2: the disclosure contract had two surfaces it did not reach

The contract is that every surface showing a record states its review state. RelatedTherapies and PathwayStepStack both print another record's name beside a sentence of its bestUsedFor or clinicalSummary, with nothing saying whether that record has been reviewed. The 2026-09-02 audit recorded this under L03c as a consistency gap.

It was a consistency gap while a catalogue-wide notice also stated the caveat. PR #2686 removed that notice at the owner's request, leaving the per-record badge as the whole disclosure — which turned these two into the only places in Therapy where a clinician can read treatment guidance with no review state at all. Same code, materially different consequence.

Both now carry the badge. An unlinked pathway step names no record and so states nothing. record-sections.tsx renders the current record's own body and its header already carries the badge, so it is untouched.

StatusBadge gains an optional size, defaulting to "standard", so no existing surface moves.

Worth the reviewer's attention: with 205 of 205 records unreviewed, every one of these badges currently reads "Needs source review". That is truthful and it is what the contract asks for, but it is repetitive today and will stay so until sign-off progresses (#SBKXZ7). It differs from the removed banner in the way that matters: the banner was a library-level claim repeated above every search regardless of what you were reading, whereas this is attached to the specific record whose words are on screen. If it reads as noise in practice, the honest lever is per-record sign-off, not hiding the state.

Verification

  • npm run verify:cheapexit 0. Test Files 1268 passed | 1 skipped (1269), Tests 18037 passed | 2 expected fail | 3 skipped (18042).
  • npm run typecheck — exit 0 (and is itself the enforcement mechanism for root cause 1).
  • npm run format — whole tree, no changes left.
  • Both new guards mutation-tested. Neither is vacuous:
    • restoring density = "extended-counted"mode-nav-contract goes red (1 failed | 25 passed)
    • deleting the badge from related-therapies.tsxtherapy-review-regressions goes red (1 failed | 6 passed)
  • Focused browser proof in Chromium, full suite left to CI:
    • tests/ui-therapy-pathways.spec.ts2 passed. The spec plan:browser attributes to pathway-step-stack.tsx, covering phone step scrolling and the desktop split view.
    • tests/ui-smoke.spec.ts --grep @critical10 passed, including prescribing workflow uses in-app medication routes, the exact test that caught the Therapy search: shared Filter button, no review banner, and a tab bar that fits a phone #2686 regression and the reason medication-nav-header.tsx is in this diff.
    • Visual check at 1280px: badges wrap correctly beside long therapy names in both listings, no overflow.
  • npm run verify:uinot run locally by choice. plan:browser fails closed to full because several changed files are unattributable to any spec, and CI runs the complete Chromium suite on a non-draft PR. Per AGENTS.md "Do not pay twice for the verdict GitHub is about to reach", the focused proof above is what was spent locally. Last time this call was right and my reading of what a focused run proved was wrong, so: the runs above cover the pathway steps and the medication rail, and say nothing about the other five changed files.
  • Not applicable: eval:retrieval:quality, eval:rag, check:production-readiness, check:deployment-readiness. No retrieval, ranking, ingestion, answer-generation, environment or deployment surface is touched.

Risk and rollout

  • Risk: Low. Root cause 1 is a type-level change with no runtime behaviour difference — every call site keeps the profile it already had. Root cause 2 adds a badge to two listings and changes no existing surface, since the new size prop defaults to the current value.
  • Rollback: The change is one commit and reverts cleanly. Reverting restores the optional prop and removes the two badges; nothing else depends on either.
  • Provider or production effects: None. No Supabase, OpenAI, migration, environment or deployment surface is touched.
  • RAG impact: none

Clinical Governance Preflight

This change increases clinical disclosure, so the section is completed.

  • Source-backed claims still require linked source verification before clinical use
  • No patient-identifiable document workflow was introduced or expanded
  • Supabase target remains Clinical KB Database (sjrfecxgysukkwxsowpy) — untouched
  • Service-role keys and private document access remain server-only — untouched
  • Demo/synthetic content remains clearly separated from real clinical sources
  • Source metadata, review status, and outdated/unknown-source behaviour remain conservative — this PR makes review status more visible, on the two surfaces that lacked it
  • Deployment classification/TGA SaMD impact checked — no decision-support behaviour changed

#SBKXZ7 (clinician sign-off outstanding for 205 therapy records) is unaffected and still open. This PR does not reduce that backlog; it makes the backlog visible everywhere a record's words appear.

Notes

🤖 Generated with Claude Code

https://claude.ai/code/session_01HUKKfk7hcKZ2UuqF3pwxMY


Generated by Claude Code


Note

Low Risk
Type-level nav calibration with explicit profiles at existing call sites, plus additive UI badges on two therapy listings—no auth, data, or backend changes.

Overview
In-page section rails can no longer inherit a default nav density profile. InPageSectionRail and InPageNavHeader's rail prop now require an explicit ModeNavDensityProfile, fixing silent coupling where medication's counted-label rail picked up Therapy's profile after #2686. Medication now names extended-counted; tests and a mode-nav-contract guard ensure every call site stays greppable.

Therapy disclosure: Related therapies and pathway step rows that quote another record's clinical text now show a compact StatusBadge for that record's review state (linked steps only). StatusBadge accepts an optional size (defaults unchanged for existing surfaces).

Reviewed by Cursor Bugbot for commit 253da4c. Configure here.

…te review status on the two listings that quote a record

Two root causes from the PR #2686 session, both small.

1. A rail could inherit a density profile it never chose.

InPageSectionRail took `density` as an optional prop with a default, so
medication's rail sat on Therapy's `extended` profile without naming it. That
coupling was invisible to `registryModeNavDensityProfiles`, which lists only
the modes that render the top bar, so checking that registry said the change
was Therapy-only when it was not. Retuning `extended` unfolded medication's
counted labels early, and only ui-smoke's prescribing journey caught it.

`density` is now required at both the rail and the header layer. A default
cannot be safe here: the value is calibrated against one label family's
measured widths, so inheriting another's is always a guess. Making it required
costs each call site one line and makes the consumer set answerable by
`git grep "density:"`. The compiler immediately found two more silent
inheritors in tests, which is the fix demonstrating itself.

2. Two listings quoted a record's clinical prose without its review state.

Related therapies and linked pathway steps both print another record's name
beside a sentence of its `bestUsedFor` or `clinicalSummary`, with nothing
saying whether that record has been reviewed. The 2026-09-02 audit recorded
this under L03c as a consistency gap, which it was while a catalogue-wide
notice also stated the caveat. PR #2686 removed that notice at the owner's
request, leaving the per-record badge as the whole disclosure, so these two
surfaces became the only places a clinician can read therapy guidance with no
review state at all.

Both now render the same StatusBadge every other therapy surface renders, in a
compact size added for dense rows. The default size is unchanged, so no
existing surface moves. An unlinked pathway step names no record and so states
nothing.

Both fixes are pinned: the disclosure contract test now covers the two
listings, and a new contract case asserts the profile is named rather than
defaulted.

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

coderabbitai Bot commented Sep 7, 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: Team

Run ID: f2f47e5b-07ac-4af2-bd69-321e172154c0


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.

@cursor

cursor Bot commented Sep 7, 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_8c053fd3-f513-4438-8eef-76a75bc3001a)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 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-09-07T11:01:03.411188Z 253da4c 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.

@supabase

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

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