Skip to content

Fix: Implement audit design and error state remediation - #1263

Closed
BigSimmo wants to merge 3 commits into
mainfrom
implement-audit-design-fixes
Closed

Fix: Implement audit design and error state remediation#1263
BigSimmo wants to merge 3 commits into
mainfrom
implement-audit-design-fixes

Conversation

@BigSimmo

Copy link
Copy Markdown
Owner

Implements recommendations from the master empty and error state design report. Resolves regressions in tests and fixes failing type contracts.

BigSimmo added 3 commits July 26, 2026 11:09
- Removes errant prompt-perfector skill folder and catalog entry.

- Mocks next/navigation in privacy-ui unit tests to fix unmounted router.

- Increases reconciliation preflight timeout for heavily populated local environments.
@supabase

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

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@BigSimmo, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 52 minutes

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: 322d77ac-a345-4d4a-b612-fe420c724d00

📥 Commits

Reviewing files that changed from the base of the PR and between e20a775 and dda4a42.

📒 Files selected for processing (47)
  • .agents/skills/catalog.json
  • .agents/skills/prompt-perfector/SKILL.md
  • docs/audit/repo-wide-review-remediation-plan-2026-07-23.md
  • docs/outstanding-issues.md
  • docs/search-chrome-behaviour.md
  • scripts/check-github-action-pins.mjs
  • scripts/check-maintainability-budgets.mjs
  • scripts/design-system-contract-baseline.json
  • src/app/api/answer/route.ts
  • src/app/api/upload/route.ts
  • src/app/differentials/[id]/not-found.tsx
  • src/app/differentials/error.tsx
  • src/app/documents/[id]/not-found.tsx
  • src/app/documents/error.tsx
  • src/app/dsm/error.tsx
  • src/app/favourites/error.tsx
  • src/app/formulation/error.tsx
  • src/app/global-error.tsx
  • src/app/medications/error.tsx
  • src/app/therapy-compass/error.tsx
  • src/app/tools/error.tsx
  • src/components/ClinicalDashboard.tsx
  • src/components/DocumentViewer.tsx
  • src/components/account-data-provider.tsx
  • src/components/clinical-dashboard/answer-status.tsx
  • src/components/clinical-dashboard/document-search-results.tsx
  • src/components/clinical-dashboard/evidence-panels.tsx
  • src/components/clinical-dashboard/image-lightbox.tsx
  • src/components/clinical-dashboard/search-utils.ts
  • src/components/clinical-dashboard/settings-dialog.tsx
  • src/components/clinical-dashboard/signed-image.tsx
  • src/components/clinical-dashboard/source-actions.tsx
  • src/components/clinical-dashboard/use-app-preferences.ts
  • src/components/mode-home-page-skeleton.tsx
  • src/components/mode-home-template.tsx
  • src/components/route-error-boundary.tsx
  • src/components/services/service-detail-page.tsx
  • src/components/services/services-navigator-page.tsx
  • src/components/ui-primitives.tsx
  • src/lib/offline-queue.ts
  • src/lib/service-catalog-mapper.ts
  • tests/privacy-ui.test.ts
  • tests/private-access-routes.test.ts
  • tests/reconciliation-preflight.test.ts
  • tests/ui-tools.spec.ts
  • tests/visual-evidence-tabs.dom.test.tsx
  • worker/main.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch implement-audit-design-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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: dda4a42baa

ℹ️ 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 on lines +83 to +87
query,
documentId: source.document_id,
chunkId: source.id,
fileName: source.file_name,
title: source.title,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Stop persisting raw clinical queries in IndexedDB

When the interaction POST rejects while offline, these fields—including the raw clinical query—are passed to enqueueOfflineAction, which stores the request body in persistent IndexedDB without expiry or logout cleanup. This bypasses the server-side queryTextForStorage redaction and reverses the explicit deferral in docs/pwa.md:330; on a shared device, potential PHI can remain after the session ends. Do not queue telemetry containing raw queries, or redact it and add an approved lifecycle before persistence.

Useful? React with 👍 / 👎.

Comment thread src/lib/offline-queue.ts
Comment on lines +78 to +81
const response = await fetch(action.endpoint, {
method: action.method,
headers: { "Content-Type": "application/json", ...getAuthHeaders() },
body: action.body,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Bind queued actions to the authenticated owner

When user A queues a preference or favourite mutation offline and signs out before reconnecting, the stored action has no owner binding and this loop sends it with whichever authorization header is current when user B authenticates. Because the account APIs assign writes to the bearer owner, A's preferences/favourites can be applied to B, and A's interaction telemetry can be attributed to B. Store an immutable owner fingerprint and drain or discard only entries belonging to the current user.

Useful? React with 👍 / 👎.

Comment on lines 197 to +201
fetch("/api/account/preferences", {
method: "PUT",
headers: { "Content-Type": "application/json", ...authorizationHeader },
body: JSON.stringify(next),
})
.then((response) => {
if (response.status === 401) markSessionExpired();
})
.catch(() => undefined);
body,
}).catch(() => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle resolved 401 responses from preference writes

When the access token expires while saving a preference, fetch resolves with a 401 rather than rejecting, so this .catch never runs. The previous response handler called markSessionExpired; after its removal, the UI remains apparently authenticated and silently treats a locally changed preference as synced even though the server rejected it. Inspect the response status and expire the session on 401, while handling retriable non-OK statuses explicitly.

Useful? React with 👍 / 👎.

Comment on lines +163 to +164
setError("You are offline. Changes will sync when reconnected.");
return true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Confirm queue persistence before reporting a saved change

When the network request throws but IndexedDB is unavailable, blocked, over quota, or its transaction fails, enqueueOfflineAction is fire-and-forget and swallows the failure, yet these lines still promise later synchronization and return success. The optimistic favourite then disappears on reload with no indication that it was lost. Await a queue operation that reports failure and roll back or return false unless persistence actually succeeds.

Useful? React with 👍 / 👎.

@cursor

cursor Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Closing without merge after the 2026-07-27 open-PR review + Bugbot sweep.

Why: Same unsafe dirty-checkpoint lineage as closed #1255/#1253, ~526 behind main, tip carries literal conflict markers, and merge-tree conflicts include answer/upload routes plus pre-(search-app) file-location moves. Confirmed P1s on the tip: raw clinical query persistence into the offline queue, and offline-queue drain without owner binding.

Do not sync this tip onto main. Rebuild any remaining empty/error-state work on current main under src/app/(search-app)/… if still needed.

@BigSimmo BigSimmo closed this Jul 27, 2026
@BigSimmo
BigSimmo deleted the implement-audit-design-fixes branch July 30, 2026 09:10
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.

1 participant