Skip to content

fix: land design-audit remediation with Production UI fixes#814

Merged
cursor[bot] merged 18 commits into
mainfrom
cursor/design-audit-production-ui-5ca9
Jul 18, 2026
Merged

fix: land design-audit remediation with Production UI fixes#814
cursor[bot] merged 18 commits into
mainfrom
cursor/design-audit-production-ui-5ca9

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

Verification

Risk and rollout

  • Risk: medium — RAG retrieval helpers, services navigator UX, and Supabase migrations for scalability indexes/functions
  • Rollback: revert this squash merge; do not leave partial migrations applied without operator review
  • Provider or production effects: migrations add/harden retrieval indexes and SQL helpers; requires operator migration apply on the live Supabase project after merge

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

Open in Web Open in Cursor 

Summary by CodeRabbit

  • New Features
    • Enhanced service comparison controls with better expand/collapse, selection clearing, and structured comparison results.
    • Improved mobile service-detail search-dock behavior (it clears when reaching the page end).
    • More accurate clinical query term correction and improved document/title vocabulary lookup.
  • Bug Fixes
    • Empty/whitespace presentation search queries now correctly fall back to legacy query values.
    • Updated session-expired and unauthorized guidance messaging on the Forms home page.
  • Documentation
    • Refreshed sitemap and route documentation, including updated site map sections and review-record notes.

BigSimmo and others added 12 commits July 18, 2026 06:07
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>
…lback

Suite-wide reducedMotion collapses CSS transition duration, so the
phone dock duration assertion could not pass in Production UI. Prefer
whitespace-empty presentations `query` falling through to `q`. Drop the
Chromium no-preference override again now that the duration assert is gone.

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

supabase Bot commented Jul 18, 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 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@cursor[bot], you've reached your PR review limit, so we couldn't start this review.

Next review available in: 1 minute

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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 Plus

Run ID: b0f69135-fd51-4511-8e8b-fc0ae78020ee

📥 Commits

Reviewing files that changed from the base of the PR and between d0ff161 and 44555ab.

📒 Files selected for processing (3)
  • src/components/services/services-navigator-page.tsx
  • tests/audit-content-services-regressions.test.ts
  • tests/ui-smoke.spec.ts
📝 Walkthrough

Walkthrough

The PR updates RAG retrieval and query-correction infrastructure, adds database cleanup and indexing migrations, revises sitemap route classification, changes service/forms UI behavior, and refreshes navigation, schema, UI, and regression-test coverage.

Changes

Route inventory and repository tooling

Layer / File(s) Summary
Route discovery and sitemap rendering
scripts/generate-site-map.ts, docs/site-map.md, tests/site-map.test.ts
Handler discovery includes route.tsx, separates public handlers from API routes, simplifies redirect extraction, and updates sitemap documentation and assertions.
Repository documentation and checks
docs/codebase-index.md, docs/branch-review-ledger.md, scripts/check-github-action-pins.mjs, tsconfig.json
Route/schema indexes, review-ledger data, workflow-file discovery, and TypeScript exclusions are updated.

RAG database hardening

Layer / File(s) Summary
Cleanup, indexing, and correction SQL
supabase/migrations/*, supabase/schema.sql, supabase/drift-manifest.json
Registry cleanup triggers, indexed document-title words, trigram indexes, query correction functions, and execution permissions are added or revised.
Schema replay validation
tests/supabase-schema.test.ts
Migration fixtures and assertions cover title-word synchronization, cleanup behavior, bounded correction probes, ACLs, and index alignment.

RAG retrieval and abort wiring

Layer / File(s) Summary
Candidate sources and RPC execution
src/lib/rag-candidate-sources.ts
RPC calls use Supabase abort hooks where supported, while retrieval surfaces remove signal threading from most candidate and row-loading paths.
Main retrieval pipeline
src/lib/rag.ts, tests/rag-variant-early-exit.test.ts
Classifier fallback, metadata enrichment, visual evidence attachment, and retrieval stages are rewired around caller-signal handling and direct Supabase queries.

Service and forms UI behavior

Layer / File(s) Summary
Service navigator interactions
src/components/services/services-navigator-page.tsx, tests/audit-content-services-regressions.test.ts
Checklist, source-confidence, selection removal, and comparison panels gain stateful accessible interactions and updated metrics wiring.
Forms content and UI fixtures
src/components/forms/forms-home-page.tsx, tests/ui-tools.spec.ts, tests/ui-smoke.spec.ts
Forms copy and unauthorized messaging change, registry mocks use service records, mobile scrolling is covered, and UI assertion/error checks are updated.

Navigation and page contracts

Layer / File(s) Summary
Redirect and page contracts
src/app/differentials/presentations/route.ts, src/app/page.tsx, src/app/layout.tsx, tests/audit-navigation-auth-regressions.test.ts
Whitespace query fallback, generic home search parameters, import ordering, authorization polling checks, and dashboard heading assertions are updated.

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

Possibly related PRs

Suggested labels: codex

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 51.52% 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 change: design-audit remediation with production UI fixes, though it omits the RAG and migration work.
Description check ✅ Passed The template is followed with all major sections filled in; verification is present but could be more explicit about the required gates.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/design-audit-production-ui-5ca9

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

@cursor
cursor Bot marked this pull request as ready for review July 18, 2026 06:36
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@cursor
cursor Bot enabled auto-merge (squash) July 18, 2026 06:41

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

Caution

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

⚠️ Outside diff range comments (2)
src/components/services/services-navigator-page.tsx (1)

297-309: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Compute checklist metrics from the selected services.

counts summarizes every search match, while “Review details” renders only selected. The checklist can therefore report criteria belonging to services the user did not select. Keep separate selected-service checklist counts and match-wide confidence counts.

Proposed fix
-  const counts = serviceNavigatorMetrics(matches);
+  const matchCounts = serviceNavigatorMetrics(matches);
+  const selectedCounts = serviceNavigatorMetrics(selected);
...
-  const confidenceTotal = counts.high + counts.medium + counts.low + counts.unknown;
+  const confidenceTotal =
+    matchCounts.high + matchCounts.medium + matchCounts.low + matchCounts.unknown;
...
-    ["Meets", counts.meets, CircleCheck, ...],
+    ["Meets", selectedCounts.meets, CircleCheck, ...],

Use matchCounts throughout the source-confidence section.

🤖 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/components/services/services-navigator-page.tsx` around lines 297 - 309,
Update the metrics setup in the service navigator component to compute separate
checklist counts from selected services while retaining match-wide counts for
confidence metrics. Use the selected-service counts for the checklist rows and
related checklist display logic, and use matchCounts throughout the
source-confidence section; locate the affected logic around
serviceNavigatorMetrics, the rows array, and confidenceTotal.
src/lib/rag-candidate-sources.ts (1)

185-207: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Thread signal through retrieval helpers. searchChunksWithTelemetry already has args.signal, but searchTextChunkCandidates and the other candidate loaders drop it, so in-flight RPCs and table queries keep running after the request is aborted. Pass signal through these helper signatures, forward it into callVersionedRetrievalRpc, and apply .abortSignal(signal) on direct query builders. Add a regression test that aborts while a query is pending.

🤖 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-candidate-sources.ts` around lines 185 - 207, Thread args.signal
through searchTextChunkCandidates and all other candidate-loader helper
signatures, forwarding it to callVersionedRetrievalRpc and applying
abortSignal(signal) to direct query builders. Preserve existing retrieval
behavior when no signal is provided, and add a regression test covering
cancellation while a query is pending.
🤖 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/services/services-navigator-page.tsx`:
- Line 608: The RightRail remount key should be removed so toggles such as
showConfidenceDetails persist across selection-count changes; in
src/components/services/services-navigator-page.tsx lines 607-608, keep
RightRail mounted and explicitly reset only invalid selection-dependent panel
state. In tests/audit-content-services-regressions.test.ts line 75, replace the
key-string assertion with regression coverage that verifies this behavior.

In `@supabase/migrations/20260714180000_patch_rag_and_corrector_scalability.sql`:
- Around line 63-78: Update the document title word trigger logic around the
DELETE/UPDATE cleanup and INSERT/UPDATE indexing conditions to use NULL-safe IS
DISTINCT FROM comparisons for status and title transitions. Preserve cleanup for
indexed-to-NULL changes and insertion for NULL-to-indexed or NULL-to-title
changes, then add regression coverage for each NULL transition.

In `@supabase/migrations/20260714190000_document_table_facts_trgm_idx.sql`:
- Around line 2-11: Replace the CREATE INDEX statement for
document_table_facts_text_trgm_idx with a no-op so fresh installations do not
build an index immediately removed by the later scalability migration. Preserve
forward cleanup for environments where the index already exists by updating the
later migration’s cleanup around document_table_facts_text_trgm_idx to use a
runner-compatible nonblocking operation, such as a concurrent drop, while
retaining the existing conditional behavior.

---

Outside diff comments:
In `@src/components/services/services-navigator-page.tsx`:
- Around line 297-309: Update the metrics setup in the service navigator
component to compute separate checklist counts from selected services while
retaining match-wide counts for confidence metrics. Use the selected-service
counts for the checklist rows and related checklist display logic, and use
matchCounts throughout the source-confidence section; locate the affected logic
around serviceNavigatorMetrics, the rows array, and confidenceTotal.

In `@src/lib/rag-candidate-sources.ts`:
- Around line 185-207: Thread args.signal through searchTextChunkCandidates and
all other candidate-loader helper signatures, forwarding it to
callVersionedRetrievalRpc and applying abortSignal(signal) to direct query
builders. Preserve existing retrieval behavior when no signal is provided, and
add a regression test covering cancellation while a query is pending.
🪄 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: b5b0fd54-6e60-4387-a615-6bfaec96cc65

📥 Commits

Reviewing files that changed from the base of the PR and between bf3c855 and df3e418.

📒 Files selected for processing (25)
  • docs/branch-review-ledger.md
  • docs/codebase-index.md
  • docs/site-map.md
  • scripts/check-github-action-pins.mjs
  • scripts/generate-site-map.ts
  • src/app/differentials/presentations/route.ts
  • src/app/layout.tsx
  • src/app/page.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/rag-variant-early-exit.test.ts
  • tests/site-map.test.ts
  • tests/supabase-schema.test.ts
  • tests/ui-smoke.spec.ts
  • tests/ui-tools.spec.ts
  • tsconfig.json

Comment thread src/components/services/services-navigator-page.tsx Outdated
Comment thread supabase/migrations/20260714180000_patch_rag_and_corrector_scalability.sql Outdated
Comment thread supabase/migrations/20260714190000_document_table_facts_trgm_idx.sql Outdated
Keep the services RightRail mounted across selection-count changes, use
IS DISTINCT FROM for title-word sync NULL transitions, and make the
immediately-dropped table-facts trigram migration a no-op so fresh
replays skip write-blocking create/drop churn.

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: 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/services/services-navigator-page.tsx`:
- Line 22: Move the invalid-selection panel reset currently performed in the
useEffect near the services navigator selection logic into the selection update
path. Update the handler or state transition that changes the selection to clear
the local panel state immediately when the new selection is invalid, then remove
the corresponding state update from useEffect while preserving valid-selection
behavior.
🪄 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: 00a0f19e-e1cb-42a4-b765-31a46ac7e0d2

📥 Commits

Reviewing files that changed from the base of the PR and between df3e418 and d0ff161.

📒 Files selected for processing (5)
  • src/components/services/services-navigator-page.tsx
  • supabase/migrations/20260714180000_patch_rag_and_corrector_scalability.sql
  • supabase/migrations/20260714190000_document_table_facts_trgm_idx.sql
  • tests/audit-content-services-regressions.test.ts
  • tests/supabase-schema.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • supabase/migrations/20260714180000_patch_rag_and_corrector_scalability.sql
  • tests/audit-content-services-regressions.test.ts
  • tests/supabase-schema.test.ts

Comment thread src/components/services/services-navigator-page.tsx Outdated
cursoragent and others added 4 commits July 18, 2026 06:54
Derived checklist/comparison expanded flags already hide invalid panels
when selection size changes, so the effect that reset toggle state is
unnecessary and trips react-hooks/set-state-in-effect.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
The remount key stays gone and panel validity is gated by derived
expanded flags plus selection handlers, so drop the stale useEffect
source expectations that broke Unit coverage.

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
cursor Bot merged commit cd0717c into main Jul 18, 2026
15 checks passed
@cursor
cursor Bot deleted the cursor/design-audit-production-ui-5ca9 branch July 18, 2026 07:17
cursor Bot pushed a commit that referenced this pull request Jul 18, 2026
Capture the #808/#812/#814 consolidation and closed superseding heads so
future branch-review passes skip the unchanged closed screenshot PRs.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Jul 18, 2026
Capture the #808/#812/#814 consolidation and closed superseding heads so
future branch-review passes skip the unchanged closed screenshot PRs.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
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