Skip to content

fix: complete design-audit registry and forms-pathway UI fixes#858

Closed
BigSimmo wants to merge 13 commits into
mainfrom
codex/design-audit-main-safe-20260719-clean
Closed

fix: complete design-audit registry and forms-pathway UI fixes#858
BigSimmo wants to merge 13 commits into
mainfrom
codex/design-audit-main-safe-20260719-clean

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixed demo/e2e registry route fixture usage so non-form registry requests resolve service fixtures and form requests resolve form fixtures.
  • Reworked form search UI to hide unsupported pathway claims and unsupported counts until the underlying feature is fully supported.

Verification

  • Verification not run: npm run test:e2e -- tests/ui-tools.spec.ts --project=chromium --grep "forms mode shows registry-backed form records without unsupported pathway claims|forms search mockup is usable without horizontal overflow on mobile" (blocked by another active Playwright command in a sibling worktree: PID 89792).
  • UI verification not run: shared Playwright database lock prevented running npm run verify:ui safely.
  • No local runtime blockers were introduced; this branch is now pushed and CI is executing standard repo checks.

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

Risk and rollout

  • Risk: low; UI claim visibility and fixture alignment changes only, no production clinical logic introduced.
  • Rollback: revert this PR or cherry-pick away commits 115301998, 551767e6e, ef52a2539, 75d8ac3db, and 8f280b980 from main.

Summary by CodeRabbit

  • User Experience

    • Simplified forms search results by removing pathway, evidence, task, and source-verification interfaces.
    • Removed pathway/evidence/task tabs and related refine controls from desktop and mobile; shown only when supported.
    • Improved cancellation behavior for in-progress searches.
  • Bug Fixes

    • Refined form source details and source-link rendering to avoid unsupported page-count, date, and verification information.
    • Tightened navigation readiness gating for protected polling and updates.
  • Tests

    • Updated and strengthened regression and UI assertions for the simplified results experience, source links, updated migrations, and search dock animation behavior.

@supabase

supabase Bot commented Jul 18, 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 ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR adds abort propagation and coalescing metrics to RAG retrieval, disables unsupported pathway UI in forms search, widens Home query parameter typing, and updates provenance, navigation, schema, and browser regression assertions.

Changes

Application behavior updates

Layer / File(s) Summary
Abort-aware retrieval and coalescing
src/lib/rag.ts, src/lib/rag-candidate-sources.ts
Retrieval RPCs and classifier fallback accept caller abort signals, while answer coalescing records waiter and origination lifecycle metrics.
Search and forms rendering
src/components/forms/forms-search-results-page.tsx, tests/ui-tools.spec.ts
Pathway tabs, refinement controls, pathway panels, and verified footer rendering are disabled; UI tests assert the corresponding content is absent and verify dock transitions.

Contracts and validation

Layer / File(s) Summary
Page query contract
src/app/page.tsx
HomeProps.searchParams accepts any optional string or string-array query parameters.
Content, navigation, and schema regression contracts
tests/audit-content-services-regressions.test.ts, tests/audit-navigation-auth-regressions.test.ts, tests/supabase-schema.test.ts
Regression assertions are updated for provenance fields, source links, private API capability, polling guards, migration fixtures, and SQL behavior.

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

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant searchChunksWithTelemetry
  participant analyzeQueryWithClassifierFallback
  participant callVersionedRetrievalRpc
  participant SupabaseRPC
  Caller->>searchChunksWithTelemetry: provide AbortSignal
  searchChunksWithTelemetry->>analyzeQueryWithClassifierFallback: forward signal
  analyzeQueryWithClassifierFallback->>analyzeQueryWithClassifierFallback: await in-flight classifier work
  searchChunksWithTelemetry->>callVersionedRetrievalRpc: forward signal
  callVersionedRetrievalRpc->>SupabaseRPC: execute RPC with abortSignal
Loading

Possibly related PRs

🚥 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 is concise and matches the PR’s main changes to registry fixtures and forms-pathway UI behavior.
Description check ✅ Passed The description mostly follows the template with Summary, Verification, Risk, and Governance sections filled in, though a few optional fields are light or missing.
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 codex/design-audit-main-safe-20260719-clean

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

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

ℹ️ 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 tests/ui-tools.spec.ts
Comment thread playwright.config.ts Outdated
@BigSimmo

Copy link
Copy Markdown
Owner Author

@codex resolve actionable Codex review findings for this pull request and current head using the repository instructions. This is the pull request's single automatic repair pass: do not perform a fresh review, create new standalone findings, or request another review. Work only the existing unresolved Codex threads on the current head. Always fix P0 and P1 findings. For P2 and lower findings, fix only clear, scoped, low-risk issues; otherwise disposition them with a concise reason. After fixing or dispositioning a thread, reply in that thread with as the first line, followed by a concise summary; that marker authorizes the workflow to close that exact thread. If human input or new authorization is required, do not use the marker and leave the thread open with the blocker. Finish only after every actionable thread is fixed or dispositioned and closed, or explicitly left open for a human decision. Do not update the branch from main, address unrelated reviews, broaden scope, or create more than one scoped fix commit. Do not use external APIs, paid services, credentials, dependency changes, or broad refactors unless explicitly authorized. Add targeted tests where behavior changes and run the narrowest relevant validation.

@github-actions

github-actions Bot commented Jul 18, 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 #3300 (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: 5

🧹 Nitpick comments (1)
src/lib/rag-candidate-sources.ts (1)

47-53: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Model the RPC helper as a thenable builder
supabase.rpc() returns a PostgrestFilterBuilder, and abortSignal() returns this, so these local RPC types should be PromiseLike/builder-shaped instead of Promise-shaped.

🤖 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 47 - 53, Update RpcResult,
AbortableRpc, and SupabaseRpcClient.rpc to model the Supabase
PostgrestFilterBuilder as a thenable builder rather than a Promise-returning
value. Represent the RPC result with PromiseLike-compatible behavior and ensure
abortSignal returns the same builder instance while remaining awaitable.
🤖 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 47-49: Update the Chromium project configuration near the
suite-wide reduced-motion setting to preserve reduced-motion as "reduce" for
production Chromium specs; move the "no-preference" override from the top-level
contextOptions into only the narrower project or per-test configuration that
requires it, such as the reduced-motion accessibility spec.

In `@src/components/ClinicalDashboard.tsx`:
- Around line 3719-3721: The UniversalSearchAlsoMatches render in
ClinicalDashboard must appear after the owning mode’s primary results for tools
and favourites. Move the non-answer render from the current pre-results slot to
the existing post-results slot near the corresponding results components,
including the analogous branch around the second referenced location, while
preserving answer-mode behavior and avoiding duplicate rendering.

In `@src/components/route-error-boundary.tsx`:
- Line 62: Update the error heading’s focus styling in route-error-boundary so
its outline uses the focus state rather than only focus-visible. Preserve the
existing outline width, offset, and color, ensuring the recovery heading always
displays a ring when focused.

In `@src/lib/rag-candidate-sources.ts`:
- Around line 91-104: Update both call sites of callVersionedRetrievalRpc in
rag.ts, including the hybrid and vector-fallback retrieval paths, to pass the
available caller AbortSignal as the new final argument. Preserve all existing
RPC arguments and behavior while ensuring both retrieval flows can be cancelled.

In `@src/lib/rag.ts`:
- Around line 1390-1402: Update the catch block around awaitWithCallerSignal to
check opts?.signal?.aborted before existing error classification; when the
caller signal is aborted, rethrow opts.signal.reason regardless of its type or
name, while preserving the current AbortError handling and deterministic
analysis fallback for non-cancellation failures.

---

Nitpick comments:
In `@src/lib/rag-candidate-sources.ts`:
- Around line 47-53: Update RpcResult, AbortableRpc, and SupabaseRpcClient.rpc
to model the Supabase PostgrestFilterBuilder as a thenable builder rather than a
Promise-returning value. Represent the RPC result with PromiseLike-compatible
behavior and ensure abortSignal returns the same builder instance while
remaining awaitable.
🪄 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: 52fdc829-8118-4fed-811e-667414817e31

📥 Commits

Reviewing files that changed from the base of the PR and between 4057677 and 1153019.

📒 Files selected for processing (11)
  • playwright.config.ts
  • src/app/page.tsx
  • src/components/ClinicalDashboard.tsx
  • src/components/forms/forms-search-results-page.tsx
  • src/components/route-error-boundary.tsx
  • src/lib/rag-candidate-sources.ts
  • src/lib/rag.ts
  • tests/audit-content-services-regressions.test.ts
  • tests/audit-navigation-auth-regressions.test.ts
  • tests/supabase-schema.test.ts
  • tests/ui-tools.spec.ts

Comment thread playwright.config.ts Outdated
Comment thread src/components/ClinicalDashboard.tsx Outdated
Comment thread src/components/route-error-boundary.tsx Outdated
Comment thread src/lib/rag-candidate-sources.ts
Comment thread src/lib/rag.ts

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

ℹ️ 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 tests/ui-tools.spec.ts
cursoragent and others added 2 commits July 18, 2026 13:34
Gate the mock Refine bar/panel behind supportsPathwayClaims so forms
search no longer advertises coming-soon pathway filters in CI.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Keep the forms Refine gating fix on top of the merged sitemap/ledger
remediation so #858 can fast-forward merge cleanly.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@cursor
cursor Bot enabled auto-merge (squash) July 18, 2026 13:42
cursoragent and others added 3 commits July 18, 2026 13:51
Restore suite-wide Chromium reduced-motion, keep Also matches after
primary tools/favourites results, preserve programmatic error-heading
focus outlines, and thread AbortSignal through hybrid retrieval RPCs.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Keep suite-wide reducedMotion for Chromium stability, and only restore
motion in the phone dock scroll-hide journey that measures transition
duration.

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

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

ℹ️ 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/rag.ts
Copilot AI and others added 2 commits July 18, 2026 22:05
Do not treat AbortError as a recoverable hybrid-RPC failure when lexical
candidates exist; cancelled requests must stop instead of continuing
through metadata, memory, rerank, and cache work.

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

Copy link
Copy Markdown
Owner Author

Closing as superseded by merged PR #861, which contains the corrected reduced-motion handling, retrieval abort propagation, neutral Forms claims, and resolved review threads with green exact-head CI. Branch retained; no branch deletion performed.

@BigSimmo BigSimmo closed this Jul 18, 2026
auto-merge was automatically disabled July 18, 2026 14:11

Pull request was closed

@BigSimmo
BigSimmo deleted the codex/design-audit-main-safe-20260719-clean branch July 18, 2026 18:27
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.

3 participants