feat: add PWA shell, redirects, and Playwright readiness fix#739
Conversation
…ific features - Port legacyHomeRedirectUrl to src/proxy.ts for mode alias sanitization - Add accessibility improvements to services-navigator-page.tsx (aria-pressed, comparison labels, animation key) - Update H1 in ClinicalDashboard.tsx to 'Clinical KB' - Upgrade supabase/schema.sql: bounded-probe correct_clinical_query_terms, document_title_words table, cleanup_registry_corpus_document trigger function - Update drift-manifest.json SHA for updated schema.sql - Regenerate docs/site-map.md for updated routes - Update audit-content-services-regressions.test.ts assertions to match main's form catalog - Update audit-navigation-auth-regressions.test.ts to match main's implementation patterns - All 279 test files pass, typecheck and lint clean
…ific features - Port legacyHomeRedirectUrl to src/proxy.ts for mode alias sanitization - Add accessibility improvements to services-navigator-page.tsx (aria-pressed, comparison labels, animation key) - Update H1 in ClinicalDashboard.tsx to 'Clinical KB' - Upgrade supabase/schema.sql: bounded-probe correct_clinical_query_terms, document_title_words table, cleanup_registry_corpus_document trigger function - Update drift-manifest.json SHA for updated schema.sql - Regenerate docs/site-map.md for updated routes - Update audit-content-services-regressions.test.ts assertions to match main's form catalog - Update audit-navigation-auth-regressions.test.ts to match main's implementation patterns - All 279 test files pass, typecheck and lint clean
…te schema, and sync drift manifest
Legacy /applications (and similar) route handlers return 307 with an empty body. waitForServer treated falsy bodies as unhealthy, so the server never passed smoke checks after Ready.
Re-export the PWA/readiness-fix branch for a PR with complete policy evidence after fixing Playwright empty-redirect readiness. Co-Authored-By: Cursor Agent <cursoragent@cursor.com>
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR updates legacy routing, dynamic metadata, RAG chunk hydration, responsive and accessible UI behavior, sitemap and codebase coverage checks, install configuration, regression tests, and WIP review documentation. ChangesApplication and repository updates
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Merge resolution changed the sr-only H1 to "Clinical KB", which broke ui-smoke overflow and offline-demo assertions that require heading level 1 "Clinical Guide" (matching main). Co-Authored-By: Cursor Agent <cursoragent@cursor.com>
Restore audit and accessibility assertions to expect the sr-only dashboard H1 "Clinical Guide", matching main and ui-smoke. Co-Authored-By: Cursor Agent <cursoragent@cursor.com>
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 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/site-map.md`:
- Around line 840-843: Move the `/applications`, `/differentials/presentations`,
`/medications`, and `/auth/callback` entries out of the `## API routes` section
into the appropriate route-handler/legacy-route section. Mark the first three as
redirects and document each redirect’s canonical target, while preserving
`/auth/callback` as a user-facing route handler.
In `@src/components/services/services-navigator-page.tsx`:
- Line 523: Remove the cardinality-derived key from the RightRail render in
src/components/services/services-navigator-page.tsx:522-526 so selection-count
changes update it without remounting. In
tests/audit-content-services-regressions.test.ts:74-76, replace the
source-string assertion with an interaction regression that verifies keyboard
focus remains functional after deselecting a service.
In `@supabase/migrations/20260714180000_patch_rag_and_corrector_scalability.sql`:
- Around line 33-40: Add the document_title_words_document_id_idx index on
document_title_words(document_id) in both
supabase/migrations/20260714180000_patch_rag_and_corrector_scalability.sql lines
33-40 and supabase/schema.sql lines 855-862, keeping the migration and schema
definition consistent.
- Around line 46-79: Restrict the global correction vocabulary to public
documents by adding d.owner_id is null to the backfill and NEW.owner_id is null
to the indexed-document synchronization logic in
public.sync_document_title_words within
supabase/migrations/20260714180000_patch_rag_and_corrector_scalability.sql.
Apply the same public-only filters in supabase/schema.sql at lines 868-900, and
remove any previously populated private document_title_words rows there.
In `@supabase/migrations/20260717010000_harden_rag_scalability_patch.sql`:
- Around line 63-96: Update the alias candidate branches in the RAG matching
query so aliases return lower(canonical) as term while retaining
similarity(lower(alias), tok) as the match score; project that score as
match_sim, and order the combined candidates by the stored match_sim before
term. Apply the corresponding term/match_sim projection and ordering in
supabase/migrations/20260717010000_harden_rag_scalability_patch.sql:63-96 and
supabase/schema.sql:3564-3599, leaving canonical and document-title matching
behavior unchanged.
In `@tests/audit-navigation-auth-regressions.test.ts`:
- Around line 125-128: Restore the required sr-only Clinical KB H1 in the
ClinicalDashboard component so it matches the existing test assertion exactly,
including the heading text and accessibility class. Keep the audit test contract
unchanged and ensure the dashboard contains only the expected root H1.
🪄 Autofix (Beta)
❌ Autofix failed (check again to retry)
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: 856d65ff-9ca5-4fd1-9977-7b392c1574fa
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (46)
.npmrcdocs/branch-review-ledger.mddocs/rag-scalability-wip-review-handover-2026-07-15.mddocs/site-map.mdpackage.jsonscripts/check-codebase-index-coverage.mjsscripts/check-m13-migration.tsscripts/run-playwright.mjssrc/app/applications/page.tsxsrc/app/applications/route.tssrc/app/differentials/presentations/page.tsxsrc/app/differentials/presentations/route.tssrc/app/forms/[slug]/page.tsxsrc/app/medications/page.tsxsrc/app/medications/route.tssrc/app/services/[slug]/page.tsxsrc/components/clinical-dashboard/answer-status.tsxsrc/components/clinical-dashboard/favourites-command-library-page.tsxsrc/components/clinical-dashboard/master-search-header.tsxsrc/components/differentials/differential-presentation-workflow-page.tsxsrc/components/differentials/differential-stream-page.tsxsrc/components/forms/form-detail-page.tsxsrc/components/privacy-input-notice.tsxsrc/components/services/service-detail-page.tsxsrc/components/services/services-navigator-page.tsxsrc/lib/legacy-home-redirect.tssrc/lib/rag-candidate-sources.tssrc/lib/rag.tssrc/lib/service-navigator-metrics.tssrc/proxy.tssupabase/drift-manifest.jsonsupabase/migrations/20260714180000_patch_rag_and_corrector_scalability.sqlsupabase/migrations/20260714190000_document_table_facts_trgm_idx.sqlsupabase/migrations/20260717010000_harden_rag_scalability_patch.sqlsupabase/schema.sqltests/audit-content-services-regressions.test.tstests/audit-navigation-auth-regressions.test.tstests/codebase-index-coverage.test.tstests/mobile-interaction-regressions.test.tstests/pwa-service-worker.test.tstests/rag-chunk-load-cache.test.tstests/registry-corpus.test.tstests/retrieval-hydration-scope.test.tstests/supabase-schema.test.tstests/test-runner-safety.test.tstests/ui-accessibility.spec.ts
💤 Files with no reviewable changes (3)
- src/app/medications/page.tsx
- src/app/differentials/presentations/page.tsx
- src/app/applications/page.tsx
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Remove the July 14/17 scalability SQL that would reintroduce unscoped document_title_words seeding and alias correction after main's public-only corrector. Keep schema/drift aligned with main, classify legacy redirect route handlers outside the API sitemap section, and stop remounting the services RightRail on selection-count changes. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Keep /api listings API-only, document legacy redirect handlers under Redirects, and avoid remounting services RightRail on selection cardinality. 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>
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/site-map.test.ts (1)
60-61: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert section placement, not just route presence.
These checks only search the entire document for each route, so they would pass if a redirect remained under
API routesor an app handler appeared under the wrong heading. Assert thatappRouteHandlersare insideApp route handlersand redirects are insideRedirects, including their targets.🤖 Prompt for 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. In `@tests/site-map.test.ts` around lines 60 - 61, Update the checks around expectDocumentedRoute so appRouteHandlers are asserted under the “App route handlers” section and redirects under “Redirects,” verifying both each route and its target within the correct section rather than searching the entire document. Preserve the existing iteration over data.appRouteHandlers and data.redirects.
🤖 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 `@scripts/generate-site-map.ts`:
- Around line 209-212: Update the empty-state message in renderSiteMapRaw() from
“No page-level redirects discovered.” to “No redirects discovered” to reflect
redirects collected from both pageRoutes and nonApiHandlers.
---
Nitpick comments:
In `@tests/site-map.test.ts`:
- Around line 60-61: Update the checks around expectDocumentedRoute so
appRouteHandlers are asserted under the “App route handlers” section and
redirects under “Redirects,” verifying both each route and its target within the
correct section rather than searching the entire document. Preserve the existing
iteration over data.appRouteHandlers and data.redirects.
🪄 Autofix (Beta)
❌ Autofix failed (check again to retry)
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: 722d91bb-e96a-4321-ab29-025dde72519e
📒 Files selected for processing (5)
docs/site-map.mdscripts/generate-site-map.tssrc/components/services/services-navigator-page.tsxtests/audit-content-services-regressions.test.tstests/site-map.test.ts
💤 Files with no reviewable changes (1)
- src/components/services/services-navigator-page.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- tests/audit-content-services-regressions.test.ts
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
CI triageCI failed on this PR. Automated classification of the 2 failed job(s):
Compared with main CI run #2910 (success). Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger. |
The Production UI failure came from focus=1's hydration retry reclaiming the search input after the mode menu opened, which tripped blur-to-dismiss and detached the Forms option before Playwright could click it. Skip the retry when focus already left the search field, and harden mode-menu pointer activation so blur-dismiss cannot unmount options mid-click.
The Production UI flake timed out waiting for Forms in the mode menu on /services?focus=1 because the 300ms composer focus retry stole focus after the menu opened and blur-dismiss closed it. Skip reclaim while the menu is open, close the command dropdown when opening the mode control, and align the tools mode-switch assertions with the sibling wait helper. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Resolve services navigator conflict by taking main's size-tap floor while preserving comparison aria-pressed labels required by the PWA audit tests. 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>
Co-Authored-By: Cursor Agent <cursoragent@cursor.com>
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found. |
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found. |
Capture merge-readiness outcomes for the screenshot PR queue and keep the historical ledger out of Prettier realignment. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Capture merge-readiness outcomes for the screenshot PR queue and keep the historical ledger out of Prettier realignment. Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Summary
Adds Progressive Web App shell/offline service worker support, dashboard interaction updates, legacy mode redirect route handlers, and a Playwright readiness fix so empty 307 redirect bodies from
/applications(and similar) no longer false-fail CI Production UI.This supersedes PR #721 with the readiness/H1 contract fixes + complete PR-policy evidence body (the cloud token cannot edit existing PR descriptions).
Verification
npm run verify:pr-localscope covered by CI static/unit/build on this PRnext start+ identity/smoke paths —/applications307 empty-body no longer fails readinessnpx vitest run tests/test-runner-safety.test.ts(12/12)npx vitest run tests/audit-navigation-auth-regressions.test.ts(5/5) after H1 contract restorenpm run verify:uimatrix not re-run in this agent session; CI Production UI / Advisory UI are the authoritative browser gatesRisk and rollout
/applications,/medications, presentations), Playwright readiness smoke semantics, and dashboard H1 contract alignment with main.Clinical Governance Preflight
Clinical KB Database(sjrfecxgysukkwxsowpy)Notes
waitForServertreated empty 307 redirect bodies from legacy/applicationsroute handlers as unhealthy (!body). Fixed to treat onlybody === nullas failure.Clinical Guide(matching main/ui-smoke) after a merge resolution had changed it toClinical KB.Summary by CodeRabbit
New Features
modevalues.Bug Fixes
Documentation
Tests
Chores