Skip to content

Improve Safety Snapshot density on phone diagnosis detail - #1758

Merged
cursor[bot] merged 16 commits into
mainfrom
cursor/safety-snapshot-mobile-4ab3
Aug 9, 2026
Merged

Improve Safety Snapshot density on phone diagnosis detail#1758
cursor[bot] merged 16 commits into
mainfrom
cursor/safety-snapshot-mobile-4ab3

Conversation

@BigSimmo

@BigSimmoBigSimmo commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Redesign the diagnosis-detail Safety Snapshot for denser mobile scanning: flat header row, Watch-for tags preferred over redundant summary copy, and equal value-first metric cells (no empty 2-col hole).
  • Add isRedundantSafetySummary so comma-list summaries that overlap tags (e.g. Dementia apathy) do not repeat the same content.
  • Keep status-themed soft washes, soft surface CTA with min-h-tap, and existing must-not-miss wiring.
  • Tighten Watch-for so the label sits above chips (cleaner wrap on phone).

Verification

  • npm run test -- tests/differential-detail.test.ts21 passed
  • npm run format:changed — All matched files use Prettier code style
  • npm run check:rag:fixtures — Offline RAG fixture and manifest validation passed (36 golden cases, 23 suites)
  • npm run verify:pr-local — lint/typecheck/full unit suite passed (529 files / 5716 tests); initial build blocked by running npm run ensure server; rebuilt with ALLOW_BUILD_WITH_DEV_SERVER=1build PASS (client bundle secret surface check passed)
  • Phone visual at 390×844 on /differentials/diagnoses/dementia-apathy-neurocognitive-disorder — flat header, no duplicate summary, compact labels (High-risk / Actions / Related), equal 3-col value-first metrics, full-width CTA

Safety Snapshot phone 390

Risk and rollout

  • Risk: Low — presentation-only layout/density change on differentials diagnosis detail; no clinical content, retrieval, or API contract changes.
  • Rollback: Revert this PR.
  • Provider or production effects: None

Notes

  • Presentation-workflow Safety Snapshot left unchanged (already a simpler summary+tags card).
  • verify:ui not run: change is scoped to one diagnosis-detail card; phone visual proof covered the owner journey.

To show artifacts inline, enable in settings.

Open in WebOpen in Cursor

Summary by CodeRabbit

  • New Features

    • Redesigned the Differential Safety Snapshot with clearer “Watch for” tags, responsive layouts, compact mobile labels, and improved visual hierarchy.
    • Safety summaries are now automatically hidden when empty or fully represented by the displayed safety tags.
    • Added accessible labels so condensed mobile text retains its full meaning.
    • Improved the review call-to-action layout for small screens.
  • Documentation

    • Updated review records covering recent navigation, document viewing, search, forms, differential, and design-system work.

Flatten the header, prefer Watch-for tags over redundant summaries, and
render equal value-first metric cells so the emergent card no longer
leaves empty grid holes or duplicate copy on mobile.
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@coderabbitai

coderabbitaiBot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The differential detail page now provides a responsive Safety Snapshot with redundancy filtering, compact labels, cleaned tags, accessible fact lists, and responsive review actions. The branch review ledger also contains additional and reordered review records from August 7–8, 2026.

Changes

Safety Snapshot redesign

Layer / File(s)Summary
Safety summary helpers and validation
src/lib/differential-detail.ts, tests/differential-detail.test.ts
Added compact safety labels, token normalization, redundant-summary detection, and behavioral tests.
Responsive Safety Snapshot rendering
src/components/differentials/differential-detail-page.tsx, tests/differential-detail.test.ts
Updated summary, tag, fact, accessibility, and review CTA rendering for responsive layouts.

Branch review ledger maintenance

Layer / File(s)Summary
Review ledger record updates
docs/branch-review-ledger.md
Added, reordered, restored, and deduplicated review, synchronization, handoff, and verification records.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
participant DifferentialDetailPage
participant differential_detail_helpers
participant SafetySnapshot_DOM
DifferentialDetailPage->>differential_detail_helpers: Check summary against Watch-for tags
differential_detail_helpers-->>DifferentialDetailPage: Return redundancy result and compact labels
DifferentialDetailPage->>SafetySnapshot_DOM: Render responsive summary, tags, facts, and review CTA
Loading

Possibly related PRs

Suggested reviewers:claude

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly summarizes the main change: improving Safety Snapshot density on the phone diagnosis detail page.
Description check✅ PassedThe description covers the changes, verification results, risk, rollback, production effects, and the reason UI verification was not run.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/safety-snapshot-mobile-4ab3

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

@supabase

supabaseBot commented Aug 8, 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 ↗︎.

@BigSimmo
BigSimmo marked this pull request as ready for review August 8, 2026 19:03
Comment threadsrc/lib/differential-detail.ts Outdated

@chatgpt-codex-connectorchatgpt-codex-connectorBot 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:7e672224fa

ℹ️ 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 threadsrc/lib/differential-detail.ts Outdated
Comment threadsrc/components/differentials/differential-detail-page.tsx Outdated
cursoragentand others added 5 commits August 8, 2026 19:14
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
…om/BigSimmo/Database into cursor/safety-snapshot-mobile-4ab3
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Keep the Watch-for label on its own row so chips wrap cleanly without
leaving a sparse first-line gap beside the label.
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@cursor
cursorBot enabled auto-merge (squash) August 8, 2026 20:26
cursoragentand others added 9 commits August 8, 2026 22:34
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
isRedundantSafetySummary only treated the summary as redundant when every
summary token is already covered by Watch-for tags. Tags being a subset of
the summary no longer hides unique risks such as unsafe living.
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Compact visual labels stay abbreviated below sm, but the metric row keeps
fact.label via aria-label so screen readers are not limited to short names.
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>

@coderabbitaicoderabbitaiBot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/branch-review-ledger.md`:
- Around line 703-716: The ledger changes must preserve append-only history:
restore all existing rows and their original ordering in the affected sections,
including the ranges around the referenced entries, and retain the merge driver.
Add only genuinely new records via the ledger command; after synchronizing with
main, run deduplication and then check:branch-review-ledger.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7ec767d2-1674-4899-b259-e9940fdbc098

📥 Commits

Reviewing files that changed from the base of the PR and between ff43ed9 and 52fe96e.

📒 Files selected for processing (4)
  • docs/branch-review-ledger.md
  • src/components/differentials/differential-detail-page.tsx
  • src/lib/differential-detail.ts
  • tests/differential-detail.test.ts

Comment threaddocs/branch-review-ledger.md
@cursor
cursorBot merged commit f4a51fd into mainAug 9, 2026
37 checks passed
@cursor
cursorBot deleted the cursor/safety-snapshot-mobile-4ab3 branch August 9, 2026 00:18
Sign up for freeto 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

@BigSimmo@cursoragent