Skip to content

fix: land remaining PR cleanup batch onto main - #798

Merged
cursor[bot] merged 2 commits into
mainfrom
cursor/batch-remaining-pr-cleanup-40ad
Jul 17, 2026
Merged

fix: land remaining PR cleanup batch onto main#798
cursor[bot] merged 2 commits into
mainfrom
cursor/batch-remaining-pr-cleanup-40ad

Conversation

@BigSimmo

@BigSimmoBigSimmo commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

Verification

  • npm run verify:pr-local — covered by CI Static PR checks / Unit coverage / Build on this PR
  • npm run verify:ui — CI Production UI / Advisory UI gates are the evidence path

Risk and rollout

  • Risk: medium; bundles UI recovery, Therapy Compass mockup recovery, favourites presentation, and document-viewer load-path changes
  • Rollback: revert this squash merge to restore prior UI/recovery behavior for the four surfaces
  • 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

Notes

  • Batch created because concurrent main merges repeatedly invalidated individual PR CI before auto-merge could land.
Open in WebOpen in Cursor

Summary by CodeRabbit

  • New Features
    • Added mobile quick views for favourites (All, Source-backed, Pinned, Recently used).
    • Added Therapy Compass retry support with an assertive unavailable error state.
    • Added a dedicated “Loading PDF reader…” state for client-side PDF viewing.
  • Bug Fixes
    • Improved accessibility by moving keyboard focus to error headings on failures.
    • Updated fallback error styling to use semantic system colors.
  • UI Improvements
    • Enhanced empty states with optional actions, tone, and live-region behavior; standardized dashboard error/status screens.
    • Improved favourites layout (pin indicators, responsive table/card behavior).
  • Tests
    • Added DOM tests for empty-state live regions and a PDF lazy-loading test.

@supabase

supabaseBot commented Jul 17, 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
cursorBot enabled auto-merge (squash) July 17, 2026 20:54
@coderabbitai

coderabbitaiBot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c3259351-f789-48f2-970b-b4d43ab1634e

📥 Commits

Reviewing files that changed from the base of the PR and between 1db742c and 802adb7.

📒 Files selected for processing (13)
  • src/app/global-error.tsx
  • src/components/ClinicalDashboard.tsx
  • src/components/DocumentViewer.tsx
  • src/components/clinical-dashboard/favourites-command-library-page.tsx
  • src/components/clinical-dashboard/favourites-library-nav.tsx
  • src/components/route-error-boundary.tsx
  • src/components/therapy-compass/bindings.tsx
  • src/components/therapy-compass/data/use-therapy-data.ts
  • src/components/therapy-compass/therapy-card.tsx
  • src/components/therapy-compass/therapy-compass-page.tsx
  • src/components/ui-primitives.tsx
  • tests/document-viewer-pdf-reader-lazy.test.ts
  • tests/ui-primitives.dom.test.tsx
🚧 Files skipped from review as they are similar to previous changes (10)
  • tests/ui-primitives.dom.test.tsx
  • src/components/therapy-compass/bindings.tsx
  • src/components/clinical-dashboard/favourites-library-nav.tsx
  • tests/document-viewer-pdf-reader-lazy.test.ts
  • src/app/global-error.tsx
  • src/components/therapy-compass/therapy-compass-page.tsx
  • src/components/ClinicalDashboard.tsx
  • src/components/ui-primitives.tsx
  • src/components/route-error-boundary.tsx
  • src/components/clinical-dashboard/favourites-command-library-page.tsx

📝 Walkthrough

Walkthrough

The PR standardizes error-state accessibility, lazy-loads PDF readers, adds responsive favourites quick views and pinned indicators, and introduces retryable Therapy Compass catalogue loading with a retryable error screen.

Changes

Error and state surfaces

Layer / File(s)Summary
Standardized answer states
src/components/ui-primitives.tsx, src/components/ClinicalDashboard.tsx, tests/ui-primitives.dom.test.tsx
EmptyState now supports live regions, tones, actions, and test IDs; dashboard answer states use the shared component.
Error boundary focus and styling
src/app/global-error.tsx, src/components/route-error-boundary.tsx
Error headings receive focus, and fallback colors use semantic system tokens or focus-visible styling.

PDF reader loading

Layer / File(s)Summary
Client-only PDF loading
src/components/DocumentViewer.tsx, tests/document-viewer-pdf-reader-lazy.test.ts
PDF readers are dynamically imported without SSR and display a loading fallback while loading.

Responsive favourites UI

Layer / File(s)Summary
Mobile quick-view navigation
src/components/clinical-dashboard/favourites-library-nav.tsx, src/components/clinical-dashboard/favourites-command-library-page.tsx
Mobile quick-view chips expose All, Source-backed, Pinned, and Recently used selections with counts and navigation callbacks.
Pinned cards and responsive table
src/components/clinical-dashboard/favourites-command-library-page.tsx
Mobile and desktop favourites use shared icon tiles, pinned indicators, responsive table columns, and breakpoint-aware evidence styling.

Therapy Compass retry handling

Layer / File(s)Summary
Retryable therapy data loading
src/components/therapy-compass/data/use-therapy-data.ts
The data hook adds cache-reset retry behavior, attempt-based refetching, and stale-request protection.
Catalogue error and retry UI
src/components/therapy-compass/bindings.tsx, src/components/therapy-compass/therapy-compass-page.tsx
retryData is exposed through bindings and powers a loading-aware unavailable-catalogue fallback.
Favourite control placeholder
src/components/therapy-compass/therapy-card.tsx
The result-card favourite control is disabled and labeled as coming soon.

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

Sequence Diagram(s)

sequenceDiagram
participant TherapyCompassShell
participant TcProvider
participant useTherapyData
TherapyCompassShell->>TcProvider: invoke retryData
TcProvider->>useTherapyData: invoke retry
useTherapyData->>useTherapyData: clear cache and start next attempt
useTherapyData-->>TcProvider: update loading and error state
TcProvider-->>TherapyCompassShell: render retryable catalogue state
Loading

Possibly related PRs

Suggested labels:codex

Suggested reviewers:claude

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 27.78% 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 nameStatusExplanation
Title check✅ PassedThe title accurately summarizes the main change: landing the remaining PR cleanup batch onto main.
Description check✅ PassedThe description matches the template well, including Summary, Verification, Risk and rollout, Clinical Governance Preflight, and Notes.
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/batch-remaining-pr-cleanup-40ad

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

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

🤖 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 `@src/app/global-error.tsx`:
- Around line 49-52: Update the error heading element in the global error
component by removing role="alert" while preserving its native h1 semantics and
existing ref/focus behavior.
In `@src/components/clinical-dashboard/favourites-command-library-page.tsx`:
- Around line 490-496: Update the mobile card selection button near the pinned
indicator to announce the item’s pinned state to screen readers. Prefer
incorporating “Pinned” into the button’s existing aria-label, or associate the
existing “Pinned” text via aria-describedby, while preserving the current
selection label for unpinned items.
In `@tests/document-viewer-pdf-reader-lazy.test.ts`:
- Around line 10-17: Strengthen the test in “DocumentViewer PDF reader loading”
to verify both NativePdfEmbed and PdfCanvasViewer are loaded via the PDF viewer
dynamic import, and that each retains its client-only ssr: false configuration.
Keep the existing static-import and loading-fallback assertions while adding
checks that prevent either export from becoming eagerly loaded or
server-rendered.
🪄 Autofix (Beta)

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 Plus

Run ID: 9cd5bf33-09e7-4dc6-ac58-c4bf6da57423

📥 Commits

Reviewing files that changed from the base of the PR and between d723aa2 and 5115955.

📒 Files selected for processing (13)
  • src/app/global-error.tsx
  • src/components/ClinicalDashboard.tsx
  • src/components/DocumentViewer.tsx
  • src/components/clinical-dashboard/favourites-command-library-page.tsx
  • src/components/clinical-dashboard/favourites-library-nav.tsx
  • src/components/route-error-boundary.tsx
  • src/components/therapy-compass/bindings.tsx
  • src/components/therapy-compass/data/use-therapy-data.ts
  • src/components/therapy-compass/therapy-card.tsx
  • src/components/therapy-compass/therapy-compass-page.tsx
  • src/components/ui-primitives.tsx
  • tests/document-viewer-pdf-reader-lazy.test.ts
  • tests/ui-primitives.dom.test.tsx

Comment threadsrc/app/global-error.tsx Outdated
Comment threadsrc/components/clinical-dashboard/favourites-command-library-page.tsx Outdated
Comment threadtests/document-viewer-pdf-reader-lazy.test.ts
@cursor
cursorBotforce-pushed the cursor/batch-remaining-pr-cleanup-40ad branch from 94c15aa to 72fdcc4CompareJuly 17, 2026 21:10

@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 `@src/components/clinical-dashboard/favourites-command-library-page.tsx`:
- Around line 731-734: Update the empty-state column-span configuration in the
favourites command library page to use five columns when selectedItemId hides
the Evidence column at 2xl, while preserving the existing responsive spans for
layouts where Evidence remains visible. Align the configuration near the
empty-state rendering with the selectedItemId column visibility logic.
🪄 Autofix (Beta)

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 Plus

Run ID: 0664cf8f-a8ec-41e3-9efa-c30ed50914bb

📥 Commits

Reviewing files that changed from the base of the PR and between 5115955 and 2995c7d.

📒 Files selected for processing (13)
  • src/app/global-error.tsx
  • src/components/ClinicalDashboard.tsx
  • src/components/DocumentViewer.tsx
  • src/components/clinical-dashboard/favourites-command-library-page.tsx
  • src/components/clinical-dashboard/favourites-library-nav.tsx
  • src/components/route-error-boundary.tsx
  • src/components/therapy-compass/bindings.tsx
  • src/components/therapy-compass/data/use-therapy-data.ts
  • src/components/therapy-compass/therapy-card.tsx
  • src/components/therapy-compass/therapy-compass-page.tsx
  • src/components/ui-primitives.tsx
  • tests/document-viewer-pdf-reader-lazy.test.ts
  • tests/ui-primitives.dom.test.tsx
🚧 Files skipped from review as they are similar to previous changes (12)
  • src/components/therapy-compass/therapy-card.tsx
  • tests/document-viewer-pdf-reader-lazy.test.ts
  • src/components/therapy-compass/therapy-compass-page.tsx
  • src/components/ui-primitives.tsx
  • src/components/DocumentViewer.tsx
  • src/app/global-error.tsx
  • src/components/therapy-compass/data/use-therapy-data.ts
  • src/components/therapy-compass/bindings.tsx
  • src/components/route-error-boundary.tsx
  • src/components/clinical-dashboard/favourites-library-nav.tsx
  • tests/ui-primitives.dom.test.tsx
  • src/components/ClinicalDashboard.tsx

@cursor
cursorBotforce-pushed the cursor/batch-remaining-pr-cleanup-40ad branch from 2995c7d to 1db742cCompareJuly 17, 2026 21:24
cursoragentand others added 2 commits July 17, 2026 21:36
Combine the still-open cleanup work onto current main: lazy PDF reader,
answer EmptyState recovery, Therapy Compass recovery/a11y, and favourites
command-library redesign. Replaces PRs #775, #776, #778, and #779.
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Keep the global error heading as a real heading, include pinned state in
the mobile favourites select label, and assert both PDF lazy-load wrappers.
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
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