Skip to content

Place 'Also matches in other modes' panel after primary results#749

Closed
BigSimmo wants to merge 7 commits into
mainfrom
codex/fix-related-options-placement-bug
Closed

Place 'Also matches in other modes' panel after primary results#749
BigSimmo wants to merge 7 commits into
mainfrom
codex/fix-related-options-placement-bug

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Motivation

  • The cross-mode "Also matches in other modes" panel was rendering before primary search results on several mode pages, causing visual/topical confusion and broken layout on some sites.
  • Make the panel consistently appear after the owning-mode result list so it follows the primary content and avoids overlapping/positioning bugs.
  • Add a focused regression assertion to prevent regressions in DOM placement.

Description

  • Moved the UniversalSearchAlsoMatches component to render after primary results across the following mode pages: documents, services, forms, prescribing (medications), differentials, favourites, and formulation. Files updated: src/components/clinical-dashboard/document-search-results.tsx, src/components/services/services-navigator-page.tsx, src/components/forms/forms-search-results-page.tsx, src/components/clinical-dashboard/medication-prescribing-workspace.tsx, src/components/clinical-dashboard/differentials-home.tsx, src/components/clinical-dashboard/favourites-command-library-page.tsx, and src/components/formulation/formulation-home-page.tsx.
  • Ensured the Answer-mode placement remains unchanged.
  • Added a Playwright regression test that asserts the universal-also-matches panel appears after the owning mode results in the DOM for the services page: tests/ui-universal-search.spec.ts (new test: places submitted cross-mode matches after the owning mode results).

Testing

  • Ran npm ci to install dependencies; install completed successfully.
  • Ran type checking via npm run typecheck and a focused ESLint invocation against changed files; both tsc and eslint passed with no errors.
  • Ran the repo PR-local verification dry-run (npm run verify:pr-local -- --dry-run --files ...) and the dry-run succeeded.
  • Executed the targeted Playwright test locally (npm run test:e2e for the new assertion), but the isolated Next.js build failed to fetch Google Geist font files from fonts.gstatic.com, causing the browser-based verification to be blocked; the regression assertion was added but could not be validated under the build environment due to remote font fetch errors.
  • git branch/worktree: changes were made on branch codex/fix-related-options-placement and the worktree is clean; diffs include the files listed above.

Remaining risk: the Playwright UI run could not complete due to external font fetches during Next build; re-run npm run test:e2e (or npm run verify:ui) in an environment with outbound access to fonts.gstatic.com or with fonts cached/available to Next to fully validate the end-to-end UI behavior.


Codex Task

Summary by CodeRabbit

  • Improvements

    • Repositioned the “Also matches” search suggestions across clinical, documents, favourites, medication, forms, formulation, and services result pages.
    • The “Also matches” panel now appears later in the page layout (conditionally tied to the same scenarios as before), aligning it more consistently with the primary results content rather than the header area.
  • Tests

    • Added a Playwright UI test for the services flow to verify the “Also matches” DOM order relative to the primary service results.

@supabase

supabase Bot commented Jul 17, 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 17, 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: 35 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: d2444930-ebb4-484c-ad5a-becd6ba2b1ec

📥 Commits

Reviewing files that changed from the base of the PR and between 7c0952e and 6b1fcdc.

📒 Files selected for processing (2)
  • src/components/clinical-dashboard/favourites-command-library-page.tsx
  • src/components/services/services-navigator-page.tsx
📝 Walkthrough

Walkthrough

Changes

Universal matches placement

Layer / File(s) Summary
Result layout placement and validation
src/components/clinical-dashboard/*, src/components/forms/forms-search-results-page.tsx, src/components/formulation/formulation-home-page.tsx, src/components/services/services-navigator-page.tsx, tests/ui-universal-search.spec.ts
UniversalSearchAlsoMatches was moved from header areas to positions after primary result content across multiple pages. A services UI test verifies that the panel appears after the primary service results in DOM order.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • BigSimmo/Database#658: Introduces related UniversalSearchAlsoMatches behavior and mode-aware universal-search wiring.
  • BigSimmo/Database#688: Changes medication workspace layout and styling around UniversalSearchAlsoMatches.
  • BigSimmo/Database#745: Modifies the internal responsive behavior of UniversalSearchAlsoMatches.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is informative, but it does not follow the required template sections for Summary, Verification, Risk and rollout, Clinical Governance Preflight, and Notes. Reformat the PR description to match the repository template and add the missing Summary, Verification checklist, Risk/rollback, Clinical Governance Preflight, and Notes sections.
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 (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: moving the "Also matches in other modes" panel after primary results.
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/fix-related-options-placement-bug

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 3 failed job(s):

  • Production UIneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • Static PR checksneeds 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 #2920 (success).

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

@BigSimmo
BigSimmo marked this pull request as ready for review July 17, 2026 19:34
auto-merge was automatically disabled July 17, 2026 19:47

Head branch was pushed to by a user without write access

The placement test navigated to /services?q=acamprosate&run=1. Since
'acamprosate' matches no service fixtures, displayedMatches is empty
and the empty-state renders instead of the service-search-results div,
causing expect(results).toBeVisible() to time out.

Fix: route the test through an inline mock that echoes the request query
back as the universal-search response query (so universal-also-matches
renders), and navigate to q=13YARN which matches the demo service
fixture records so service-search-results is present.

Also fixes pre-existing TS2532: add ?? 0 fallback before the bitwise &
to resolve the 'Object is possibly undefined' error from optional chaining.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants