Skip to content

fix: make Playwright reduced-motion config type-safe (policy clean)#807

Closed
BigSimmo wants to merge 8 commits into
mainfrom
codex/playwright-typecheck-hotfix
Closed

fix: make Playwright reduced-motion config type-safe (policy clean)#807
BigSimmo wants to merge 8 commits into
mainfrom
codex/playwright-typecheck-hotfix

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Make Playwright reduced-motion config options type-safe by moving reducedMotion into supported config contexts.
  • Align retrieval/schema unit test expectations with current code paths to match migration and variant telemetry behavior.

Verification

  • node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc -p .tmp-tsconfig-no-worktrees.json --noEmit
  • node scripts/run-vitest.mjs run tests/rag-abort-signal.test.ts tests/rag-classifier-memo.test.ts tests/rag-variant-early-exit.test.ts tests/supabase-schema.test.ts
  • UI verification not run: Playwright production build on this local environment scans sibling worktrees/* paths outside repo scope and surfaces unrelated type errors.

Risk and rollout

  • Risk: low and no user-facing runtime behavior was introduced; changes are constrained to configuration typing and unit tests.
  • Rollback: revert commit 4b98cea8c and re-run the verification commands above.

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

Summary by CodeRabbit

  • New Features

    • Added expandable service comparison and confidence details, with clearer selection controls.
    • Improved service navigator metrics and comparison availability.
    • Enhanced search handling, including more resilient query correction and visual evidence.
  • Bug Fixes

    • Improved cleanup of outdated registry-linked search content.
    • Refined forms messaging and removed outdated pathway actions.
    • Fixed mobile search dock behavior and strengthened navigation safeguards.
  • Documentation

    • Updated route and sitemap documentation, including public utility handlers and redirects.

@supabase

supabase Bot commented Jul 17, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy due to reaching the limit of concurrent preview branches.
Go to Project Integrations Settings ↗︎ if you wish to update this limit.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot 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: 59359b74-ad50-4aa9-ad34-92cb4a079d5c

📥 Commits

Reviewing files that changed from the base of the PR and between 425366f and 70e7fe8.

📒 Files selected for processing (6)
  • docs/site-map.md
  • scripts/generate-site-map.ts
  • tests/audit-navigation-auth-regressions.test.ts
  • tests/site-map.test.ts
  • tests/ui-smoke.spec.ts
  • tests/ui-tools.spec.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • tests/site-map.test.ts
  • docs/site-map.md
  • scripts/generate-site-map.ts
  • tests/ui-tools.spec.ts
  • tests/audit-navigation-auth-regressions.test.ts

📝 Walkthrough

Walkthrough

The changes reorganize sitemap generation and documentation, simplify RAG abort and enrichment flows, add Supabase cleanup and query-correction support, update forms and service navigator interactions, and revise related regression, browser, schema, and tooling tests.

Changes

Route discovery and sitemap

Layer / File(s) Summary
Route classification and rendering
scripts/generate-site-map.ts
Route handlers support route.ts and route.tsx, are split into public utility and API routes, and use revised redirect discovery and sitemap sections.
Route documentation and placement checks
docs/site-map.md, docs/codebase-index.md, tests/site-map.test.ts
Documentation and tests cover the revised route groups, redirects, API listings, and schema table references.

RAG retrieval and Supabase hardening

Layer / File(s) Summary
Retrieval RPC and hydration contracts
src/lib/rag-candidate-sources.ts
RPC execution is centralized for abortable calls, while public retrieval arguments and direct hydration queries no longer thread AbortSignal.
Classifier and enrichment orchestration
src/lib/rag.ts
Classifier abort behavior, memoization fallback, metadata enrichment, visual evidence, and retrieval fast paths are updated.
RAG cleanup and correction database objects
supabase/migrations/*, supabase/schema.sql, supabase/drift-manifest.json
Registry cleanup triggers, title-word indexing, trigram indexes, secured correction functions, and schema metadata are added or revised.
Schema and migration validation
tests/supabase-schema.test.ts
Migration fixtures and SQL assertions validate cleanup predicates, title-word synchronization, correction probes, ACLs, and index/RPC parity.

Dashboard and catalog UI

Layer / File(s) Summary
Forms and service navigator interactions
src/app/page.tsx, src/components/forms/forms-home-page.tsx, src/components/services/services-navigator-page.tsx, src/app/layout.tsx
Forms content and session messaging change, while service selection, expandable details, comparison, metrics, and sidebar remount behavior are updated.
UI source and browser regression coverage
tests/audit-*-regressions.test.ts, tests/ui-*.spec.ts
Regression and browser tests update source contracts, mocked registry data, mobile search dock behavior, service detail flows, and redirect error checks.

Repository and workflow tooling

Layer / File(s) Summary
Workflow discovery and repository configuration
scripts/check-github-action-pins.mjs, tsconfig.json
Workflow discovery handles absent directories and returns normalized paths; TypeScript excludes worktrees.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 48.57% 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 matches the main theme of type-safety work around reduced-motion config, though it omits the test and schema updates.
Description check ✅ Passed The description follows the template with Summary, Verification, Risk and rollout, Clinical Governance Preflight, and Notes filled in.
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
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/playwright-typecheck-hotfix

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

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

CI triage

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

  • Production UIneeds 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 #3145 (success).

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

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/rag.ts (1)

2514-2527: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Preserve caller cancellation during retrieval.

The caller’s signal is checked only after the uncancellable Supabase operation completes, so Stop/disconnect requests can remain blocked and continue database work.

  • src/lib/rag.ts#L2514-L2527: wrap the retrieval await with caller cancellation and retain a post-await abort check.
  • src/lib/rag-candidate-sources.ts#L185-L207: retain internal signal support so the underlying RPC receives abortSignal.
🤖 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 `@src/lib/rag.ts` around lines 2514 - 2527, Preserve caller cancellation in the
text candidate retrieval flow by wrapping the searchTextChunkCandidates await in
src/lib/rag.ts lines 2514-2527 with args.signal-aware cancellation, while
retaining the existing post-await throwIfAborted check and telemetry updates. In
src/lib/rag-candidate-sources.ts lines 185-207, retain internal signal
propagation so the underlying RPC continues receiving abortSignal; no direct
change is required there beyond preserving that support.
🤖 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 `@playwright.config.ts`:
- Around line 46-48: Remove the Chromium production project’s
contextOptions.reducedMotion override so it inherits the suite-wide "reduce"
setting. Keep any required "no-preference" coverage isolated to a separate
project rather than changing the production Chromium configuration.

In `@scripts/generate-site-map.ts`:
- Around line 42-45: Update documentedRedirectTargets in
scripts/generate-site-map.ts to use the actual
/differentials/presentations/[slug] route parameter. Regenerate docs/site-map.md
so the corresponding entry reflects [slug], and update the relevant assertion in
tests/site-map.test.ts to expect the corrected destination.

In `@supabase/migrations/20260714190000_document_table_facts_trgm_idx.sql`:
- Around line 2-11: Use concurrent index DDL for the GIN index in
supabase/migrations/20260714190000_document_table_facts_trgm_idx.sql (lines
2-11), the canonical-alias index in
supabase/migrations/20260717010000_harden_rag_scalability_patch.sql (lines 5-6),
and the obsolete index removal in
supabase/migrations/20260717010000_harden_rag_scalability_patch.sql (line 116).
Ensure these migrations use the repository’s non-transactional mechanism
required for concurrent operations.

In `@tests/audit-navigation-auth-regressions.test.ts`:
- Line 129: Align all dashboard H1 assertions to the canonical accessible name:
update tests/audit-navigation-auth-regressions.test.ts at lines 129-129,
tests/ui-accessibility.spec.ts at lines 51-51, and tests/ui-smoke.spec.ts at
lines 870-870 and 1265-1265 to consistently assert the same name, using the name
required by the dashboard contract.

In `@tests/supabase-schema.test.ts`:
- Around line 1219-1222: Update the latest migration assertion in the
migrationFiles test to expect
20260717173000_reassert_supabase_admin_default_privileges.sql, matching the
actual final migration returned by the existing sorted list.

In `@tests/ui-tools.spec.ts`:
- Line 1623: Update mockAnswerDashboardApi to return service-detail records for
13YARN and City East instead of 404 responses for non-form kinds. Add the 13YARN
response at tests/ui-tools.spec.ts lines 1623-1623, the City East record at
lines 1644-1645, and ensure the direct service entry resolves through this
detail mock at lines 1688-1688.

---

Outside diff comments:
In `@src/lib/rag.ts`:
- Around line 2514-2527: Preserve caller cancellation in the text candidate
retrieval flow by wrapping the searchTextChunkCandidates await in src/lib/rag.ts
lines 2514-2527 with args.signal-aware cancellation, while retaining the
existing post-await throwIfAborted check and telemetry updates. In
src/lib/rag-candidate-sources.ts lines 185-207, retain internal signal
propagation so the underlying RPC continues receiving abortSignal; no direct
change is required there beyond preserving that support.
🪄 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: 2ab7417a-cfb7-41a1-af1b-7cfdee0966ac

📥 Commits

Reviewing files that changed from the base of the PR and between 827c2f1 and 7e4ceb3.

📒 Files selected for processing (24)
  • docs/codebase-index.md
  • docs/site-map.md
  • playwright.config.ts
  • scripts/check-github-action-pins.mjs
  • scripts/generate-site-map.ts
  • src/app/layout.tsx
  • src/app/page.tsx
  • src/components/clinical-dashboard/master-search-header.tsx
  • src/components/forms/forms-home-page.tsx
  • src/components/services/services-navigator-page.tsx
  • src/lib/rag-candidate-sources.ts
  • src/lib/rag.ts
  • supabase/drift-manifest.json
  • supabase/migrations/20260714180000_patch_rag_and_corrector_scalability.sql
  • supabase/migrations/20260714190000_document_table_facts_trgm_idx.sql
  • supabase/migrations/20260717010000_harden_rag_scalability_patch.sql
  • supabase/schema.sql
  • tests/audit-content-services-regressions.test.ts
  • tests/audit-navigation-auth-regressions.test.ts
  • tests/site-map.test.ts
  • tests/supabase-schema.test.ts
  • tests/ui-accessibility.spec.ts
  • tests/ui-smoke.spec.ts
  • tests/ui-tools.spec.ts

Comment thread playwright.config.ts Outdated
Comment thread scripts/generate-site-map.ts
Comment on lines +2 to +11
create index if not exists document_table_facts_text_trgm_idx
on public.document_table_facts using gin (
lower(
coalesce(table_title, '') || ' ' ||
coalesce(row_label, '') || ' ' ||
coalesce(clinical_parameter, '') || ' ' ||
coalesce(threshold_value, '') || ' ' ||
coalesce(action, '')
) extensions.gin_trgm_ops
);

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.

🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Avoid blocking production writes with normal index DDL.

These GIN index operations can take strong locks on populated retrieval tables during deployment.

  • supabase/migrations/20260714190000_document_table_facts_trgm_idx.sql#L2-L11: create the index concurrently or use the repository’s non-transactional migration mechanism.
  • supabase/migrations/20260717010000_harden_rag_scalability_patch.sql#L5-L6: create the canonical-alias index concurrently.
  • supabase/migrations/20260717010000_harden_rag_scalability_patch.sql#L116-L116: drop the obsolete index concurrently.
🧰 Tools
🪛 Squawk (2.59.0)

[warning] 2-11: During normal index creation, table updates are blocked, but reads are still allowed. Use concurrently to avoid blocking writes.

(require-concurrent-index-creation)

📍 Affects 2 files
  • supabase/migrations/20260714190000_document_table_facts_trgm_idx.sql#L2-L11 (this comment)
  • supabase/migrations/20260717010000_harden_rag_scalability_patch.sql#L5-L6
  • supabase/migrations/20260717010000_harden_rag_scalability_patch.sql#L116-L116
🤖 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 `@supabase/migrations/20260714190000_document_table_facts_trgm_idx.sql` around
lines 2 - 11, Use concurrent index DDL for the GIN index in
supabase/migrations/20260714190000_document_table_facts_trgm_idx.sql (lines
2-11), the canonical-alias index in
supabase/migrations/20260717010000_harden_rag_scalability_patch.sql (lines 5-6),
and the obsolete index removal in
supabase/migrations/20260717010000_harden_rag_scalability_patch.sql (line 116).
Ensure these migrations use the repository’s non-transactional mechanism
required for concurrent operations.

Source: Linters/SAST tools

Comment thread tests/audit-navigation-auth-regressions.test.ts
Comment thread tests/supabase-schema.test.ts Outdated
Comment thread tests/ui-tools.spec.ts
@BigSimmo BigSimmo changed the title fix: make Playwright reduced-motion config type-safe fix: make Playwright reduced-motion config type-safe (policy clean) Jul 17, 2026
BigSimmo and others added 3 commits July 18, 2026 07:00
Restore dashboard H1 expectations to Clinical Guide, mock service-detail
registry records so 13YARN/City East load, drop forms assertions that
conflicted with the live Refine/pathway UI, restore mode-menu click
safety handlers, and correct the presentations redirect sitemap slug.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
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