Skip to content

Condense Form 1A priority facts and add Act section detail - #1752

Merged
BigSimmo merged 10 commits into
mainfrom
cursor/form-1a-priority-facts-dc36
Aug 8, 2026
Merged

Condense Form 1A priority facts and add Act section detail#1752
BigSimmo merged 10 commits into
mainfrom
cursor/form-1a-priority-facts-dc36

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Condenses Form 1A Priority facts to short, high-yield lines (clock, maker, criteria), with slightly more clinical cueing than the first pass.
  • Replaces the redundant Source status priority-fact card on Form 1A with Act sections (26 · 31 · 36 · 37 · 41 · 42) labelled as the MHA 2014 referral pathway.
  • Tapping a condensed fact or an Act section opens a detail sheet; source status remains on the form rail/overview.
  • Scoped to Form 1A only — other forms keep the existing Source status card until they opt into actSections.

Condensed card copy (Form 1A)

Card Title Detail
Clock Usually 72 hours from referral Within assessment window · 48h cue
Made by MP or AMHP (where Act permits) Psychiatrist examination only
Criteria Reasonable suspicion ITO criteria may be met Document illness · risk · capacity · least restrictive
Act sections MHA 2014 referral pathway Tap section chips for authority detail

Verification

  • npm run typecheck
  • npm run lint
  • npm run test530 files / 5704 passed | 4 skipped (pre-enrichment head)
  • Focused Vitest after copy enrichment: tests/forms.test.ts + tests/form-priority-facts.dom.test.tsx (8 passed)
  • Verification not run: npm run verify:pr-local full plan still includes build / check:rag:fixtures; offline unit + lint + typecheck already green for this scope
  • Verification not run: npm run verify:ui (DOM test covers the sheet interaction)
  • Verification not run: npm run verify:release (provider-backed; not requested)

Risk and rollout

  • Risk: Clinical reference wording for WA MHA 2014 sections is condensed; incorrect summaries could mislead form use. Mitigated by conservative disclaimer in the section sheet and by keeping full catalog fields/legal boundary intact.
  • Rollback: Revert this PR; Form 1A returns to previous four-card priority facts including Source status.
  • Provider or production effects: None

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 — reference-aid copy only; no decision-support behavior change

Notes

  • Act section summaries are condensed from the Mental Health Act 2014 (WA) section titles/operative effect for clinician quick reference, not legal advice.
  • Pattern is data-driven (priorityFacts / actSections on the form catalog) so later forms can opt in without another UI rewrite.
Open in Web Open in Cursor 

Summary by CodeRabbit

  • New Features

    • Added condensed priority facts for Form 1A, covering timing, authority, and criteria.
    • Added expandable Mental Health Act section cards with detailed information.
    • Added interactive detail sheets for priority facts and Act sections.
    • Form summaries now display relevant priority facts and Act sections when available.
  • Bug Fixes

    • Preserved source-status information for forms without priority facts or Act sections.

Replace the redundant Source status card on Form 1A with MHA Act
sections that open per-section detail sheets, and shorten the other
three priority-fact cards with tap-for-detail bodies.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 47 minutes

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

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cddda9e6-de3b-4da0-91f5-0fd607cf19ca

📥 Commits

Reviewing files that changed from the base of the PR and between b57239b and d623582.

📒 Files selected for processing (4)
  • docs/design-system/COMPONENTS.md
  • src/components/forms/form-detail-page.tsx
  • src/lib/registry-seed.ts
  • tests/registry-records-route.test.ts
📝 Walkthrough

Walkthrough

Form 1A now provides structured priority facts and Mental Health Act sections. The catalog parser exposes these details to form summaries and search. The form detail page renders expandable cards and detail sheets. Review-ledger records are reordered chronologically.

Changes

Form catalog and detail UI

Layer / File(s) Summary
Catalog data contracts and parsing
data/forms-catalog.json, src/lib/form-ranker.ts, src/lib/form-catalog.ts
Form 1A includes priority facts and Act sections. Catalog types, normalization, summary cards, and search text support the new data.
Priority fact and Act section detail interactions
src/components/forms/form-detail-page.tsx, docs/design-system/adoption-manifest.json
The form detail page renders interactive priority fact and Act section cards with bottom-sheet details. The Sheet adoption manifest includes the page.
Catalog and detail-page validation
tests/form-priority-facts.dom.test.tsx, tests/forms.test.ts
Tests cover rendered facts, Act sections, summary-card composition, source-status placement, and sheet interactions.

Review ledger reconciliation

Layer / File(s) Summary
Review ledger record reconciliation
docs/branch-review-ledger.md
The ledger adds and restores review records and reorders them into chronological positions.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant FormCatalogData
  participant formCatalog
  participant FormDetailPage
  participant Sheet
  FormCatalogData->>formCatalog: provide priorityFacts and actSections
  formCatalog->>FormDetailPage: return parsed form details
  FormDetailPage->>Sheet: open selected fact or Act section details
  Sheet->>FormDetailPage: close detail view
Loading

Possibly related PRs

Suggested reviewers: claude

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: condensed Form 1A priority facts and added Act section detail.
Description check ✅ Passed The description covers the required summary, verification results, risk, rollback, production effects, governance preflight, and notes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/form-1a-priority-facts-dc36

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

@supabase

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

@cursor
cursor Bot force-pushed the cursor/form-1a-priority-facts-dc36 branch from 7040b85 to 9db089a Compare August 8, 2026 17:44
Regenerate the adoption manifest after FormDetailPage mounts Sheet for
priority-fact and Act-section detail popovers.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/form-1a-priority-facts-dc36 branch from 9db089a to b8911fd Compare August 8, 2026 17:44
Add one high-yield cue to each condensed card so clock, maker, criteria,
and Act sections remain scannable without dropping the clinical essentials.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

CI triage

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

  • Static PR checksneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • PR requiredneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.

Compared with main CI run #9241 (cancelled).

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

@BigSimmo
BigSimmo marked this pull request as ready for review August 8, 2026 18:09
@BigSimmo
BigSimmo enabled auto-merge (squash) August 8, 2026 18:10
Comment thread src/components/forms/form-detail-page.tsx Outdated

@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: a7d2c8abcc

ℹ️ 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/lib/form-catalog.ts
cursoragent and others added 5 commits August 8, 2026 18:44
Use the file's outline focus pattern so design-system contract stays within
the form-detail edgeOwnershipConflicts budget.
Keep ConfirmCalloutText from main with DetailCardShell/Act sections
from the Form 1A priority-facts branch.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
…equence resume)

Regenerate design-system adoption manifest after merge conflict.
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>

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

Actionable comments posted: 4

🤖 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 `@data/forms-catalog.json`:
- Around line 82-130: Move the Form 1A prose currently embedded in the generated
catalog into the generator’s input/source data, add or update the generator
reference for this catalog, then regenerate data/forms-catalog.json so the
generated snapshot contains the same content. Use the generator and source
symbols defined by the repository rather than editing the generated JSON
directly.

In `@docs/branch-review-ledger.md`:
- Around line 761-763: Add the focused branch review ledger guard check to the
Checks section, preserving the reported validation result: 749 live records,
1206 archived records, 749 under the 2026-07-29 machine-readable contract,
active ledger merge, six cells per record, and no conflict markers, mojibake,
heading records, or duplicates.

In `@src/components/forms/form-detail-page.tsx`:
- Around line 146-155: Update the fallback title in fromCard to use the existing
card-label mapping for cardId instead of displayText(cardId), ensuring
detail-sheet headings show the readable card label when fact.title is missing.
- Around line 325-333: In the detail button within the DetailCardShell, replace
the undefined --focus-ring CSS variable in the focus-visible ring class with the
declared --focus variable, leaving the rest of the styling unchanged.
🪄 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: e7a38c1a-3a77-4672-87fa-17b62acbd44b

📥 Commits

Reviewing files that changed from the base of the PR and between 5155aca and b57239b.

📒 Files selected for processing (8)
  • data/forms-catalog.json
  • docs/branch-review-ledger.md
  • docs/design-system/adoption-manifest.json
  • src/components/forms/form-detail-page.tsx
  • src/lib/form-catalog.ts
  • src/lib/form-ranker.ts
  • tests/form-priority-facts.dom.test.tsx
  • tests/forms.test.ts

Comment thread data/forms-catalog.json
Comment thread docs/branch-review-ledger.md
Comment thread src/components/forms/form-detail-page.tsx
Comment thread src/components/forms/form-detail-page.tsx
cursoragent and others added 2 commits August 8, 2026 21:50
- Merge origin/main (5155aca, Align Forms results bar; 00cf695, Add
  Differentials Presentations tab) and regenerate adoption manifest with
  both forms/form-detail-page.tsx and forms/forms-search-results-page.tsx
  recorded as Sheet consumers.

- fix(forms): use human-readable label fallback in priorityFactBody
  Add PRIORITY_FACT_LABELS map so the detail Sheet title falls back to
  'Clock / review', 'Made by / authority', or 'Criteria' instead of the
  raw cardId string when a fact card has no configured title.
  Addresses Sentry thread PRRT_kwDOSh5Fis6XfzdQ.

- fix(registry): catalogue summaryCards win over pre-seeded form rows
  Skip the owner's stored summary_cards when merging form registry rows —
  form summaryCards are catalogue-derived and should always reflect the
  current catalogue layout. Pre-seeded Form 1A rows that stored the old
  full-length card layout will now correctly receive the new condensed
  priority-fact cards.
  Addresses Codex thread PRRT_kwDOSh5Fis6Xf1V7.
  Adds a focused regression test (19 tests pass).

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@BigSimmo
BigSimmo merged commit 7468122 into main Aug 8, 2026
26 checks passed
@BigSimmo
BigSimmo deleted the cursor/form-1a-priority-facts-dc36 branch August 8, 2026 22:08
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