Skip to content

Hide cross-mode matches from unsubmitted mode homes - #1806

Merged
BigSimmo merged 12 commits into
mainfrom
codex/remove-erroneous-pattern-matching-section
Aug 11, 2026
Merged

Hide cross-mode matches from unsubmitted mode homes#1806
BigSimmo merged 12 commits into
mainfrom
codex/remove-erroneous-pattern-matching-section

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Motivation

  • The cross-mode "Also matches in other modes" card was appearing on the shared home surface when a user had only draft text (not a submitted search), which is confusing and unintended.
  • The change confines the cross-mode card to real result/answer surfaces so the shared home remains uncluttered by speculative cross-mode results.

Description

  • Guarded the showUniversalAlsoMatches flag in src/components/ClinicalDashboard.tsx to prevent rendering when the shared home is active by adding !showSharedHome to the predicate.
  • Added a Playwright regression test in tests/ui-universal-search.spec.ts that asserts the cross-mode card is not present on an unsubmitted Therapy home.
  • Preserved the Next.js-generated guidance block in AGENTS.md (commit included) so next dev does not recreate a dirty working tree.

Testing

  • Ran the repository setup smoke script npm run ensure, which completed successfully.
  • Performed a direct Chromium smoke check against the local app and confirmed the universal-also-matches card is absent on the Therapy home and captured a screenshot (/tmp/therapy-home-without-also-matches.png).
  • Ran formatting (npm run format) and git diff --check, both of which passed.
  • Attempted the Playwright e2e run for the new regression (npm run test:e2e / test:e2e wrapper), but the isolated production build/typecheck failed due to pre-existing malformed generated .next/dev/types declarations, blocking the full e2e gate (this is an environment/typecheck failure unrelated to the change).

Codex Task

Summary by CodeRabbit

  • New Features

    • Added “Also matches” results to Universal Search across Therapy, Services, Phones, Favourites, Tools, Forms, and Answer modes.
    • Results appear after a search is submitted, with Answer results shown once generation completes.
    • Improved mobile search behavior, including expansion and clearer result ordering.
    • Duplicate matches are removed for a cleaner experience.
  • Bug Fixes

    • Prevented cross-mode matches from appearing on the shared home surface or before a valid search is submitted.

@supabase

supabase Bot commented Aug 11, 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 Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The dashboard and search result pages now render UniversalSearchAlsoMatches for submitted searches and completed Answer results. Shared home, empty queries, and active Answer generation suppress the matches. End-to-end tests cover cross-mode and streaming behavior.

Changes

Universal search match rendering

Layer / File(s) Summary
Mode-aware match rendering
src/components/ClinicalDashboard.tsx
UniversalSearchAlsoMatches renders for submitted tools, favourites, documents, services, and forms searches, and for completed Answer results. Shared home, empty queries, and active Answer generation suppress rendering.
Result surface wiring
src/components/clinical-dashboard/favourites-command-library-page.tsx, src/components/forms/forms-search-results-page.tsx, src/components/services/services-navigator-page.tsx
Favourites, forms, and services pages render UniversalSearchAlsoMatches below their primary results content.
Cross-mode and streaming validation
tests/ui-universal-search.spec.ts
End-to-end tests cover visibility, ordering, filtering, mobile behavior, deduplication, completed Answer results, and delayed display during Answer streaming.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant ClinicalDashboard
  participant UniversalSearchAlsoMatches
  User->>ClinicalDashboard: Submit a non-empty search query
  ClinicalDashboard->>UniversalSearchAlsoMatches: Render matches for submitted mode
  User->>ClinicalDashboard: Complete Answer generation
  ClinicalDashboard->>UniversalSearchAlsoMatches: Render matches after final answer event
Loading

Possibly related PRs

  • BigSimmo/Database#658: Introduces the mode-aware UniversalSearchAlsoMatches behavior extended by this change.
  • BigSimmo/Database#749: Modifies UniversalSearchAlsoMatches placement in favourites, forms, and services components.
  • BigSimmo/Database#808: Modifies UniversalSearchAlsoMatches rendering and coverage in the same dashboard components and test file.

Suggested reviewers: claude

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change and testing, but it omits the required Summary, Verification, Risk and rollout, and Clinical Governance Preflight sections. Add the required template sections and document verification results, risk, rollback, provider effects, and applicable clinical governance checks.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes hiding cross-mode matches from unsubmitted mode homes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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/remove-erroneous-pattern-matching-section

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed: dependency version conflict. Check your lock file or package.json.


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

ℹ️ 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-universal-search.spec.ts Outdated

@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 `@tests/ui-universal-search.spec.ts`:
- Around line 281-287: Update the test “keeps submitted cross-mode matches off
the unsubmitted shared home” to first establish submitted or stale search
matches, then navigate back to `/?mode=therapy` with only draft text and assert
`universal-also-matches` is absent. Ensure the setup reaches the
`modeSearchSubmitted` path in `ClinicalDashboard` so the regression assertion
exercises the new `!showSharedHome` guard.
🪄 Autofix

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

Run ID: cb4f7398-4522-4ad1-b51c-5fb57c19a5e1

📥 Commits

Reviewing files that changed from the base of the PR and between e8b61d8 and ff88e1b.

📒 Files selected for processing (3)
  • AGENTS.md
  • src/components/ClinicalDashboard.tsx
  • tests/ui-universal-search.spec.ts

Comment thread tests/ui-universal-search.spec.ts
@BigSimmo
BigSimmo enabled auto-merge August 11, 2026 06:27
# Conflicts:
#	src/components/ClinicalDashboard.tsx
#	tests/ui-universal-search.spec.ts
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

CI triage

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

  • Production UI (3)needs 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 #9671 (failure).

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: 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 824: Move the UniversalSearchAlsoMatches component outside the primary
non-empty-results conditional in the services navigator page so it renders for
empty service results as well, while retaining the registryReady gate. Add a
regression test covering a valid query with no service-mode matches and
available cross-mode matches, asserting the panel is rendered.
🪄 Autofix

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

Run ID: 790fab34-cf0b-41c1-b529-d40484658840

📥 Commits

Reviewing files that changed from the base of the PR and between 1b02094 and 6340cd7.

📒 Files selected for processing (4)
  • src/components/ClinicalDashboard.tsx
  • src/components/clinical-dashboard/favourites-command-library-page.tsx
  • src/components/forms/forms-search-results-page.tsx
  • src/components/services/services-navigator-page.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/ClinicalDashboard.tsx

Comment thread src/components/services/services-navigator-page.tsx
@BigSimmo

Copy link
Copy Markdown
Owner Author

PR unblock snapshot (#1806)

  • GitHub head: 08552fff019a2eefbb18c50249918d60ab9addad
  • Head relative to main: ahead 10, behind 0 (compare status ahead)
  • Mergeability snapshot: mergeable=MERGEABLE, mergeStateStatus=BLOCKED
  • Merge-tree status: merge-tree clean after one sync from origin/main and blocker-fix commit
  • Required checks on current head: Build, Static PR checks, PR policy, PR mergeability, Safety and config checks, Unit coverage, PR required, Production UI critical, Production UI (1), Production UI (2), Production UI (3) all pass

What blocked and what was fixed

  • Unblocker: Production UI was failing due tests/ui-overlap.spec.ts asserting smart-search-phone-ticker after regression in ClinicalDashboard on shared home
  • Fix: restored showPhoneSuggestionTickerOnHome={showSharedHome} on MasterSearchHeader in src/components/ClinicalDashboard.tsx and pushed blocker-fix commit + one origin/main merge/sync

Residual risks / dispositions

  • mergeStateStatus remains BLOCKED even though checks are green; no reviewDecision is present and only comment-only bot reviews exist
  • Unresolved review thread(s) remain:
    • one outdated codex comment in tests/ui-universal-search.spec.ts
    • one open major coderabbitai comment in src/components/services/services-navigator-page.tsx:824 (service cross-mode panel placement)
  • I treated both as advisory for this unblock pass and did not change behavior further since neither is currently producing a required-CI failure

Ledger

  • Appended unblock/fix record for this PR/head with outcome unblocked.

Merge remains with you.

@BigSimmo

Copy link
Copy Markdown
Owner Author

Unblock sweep snapshot

  • PR: Hide cross-mode matches from unsubmitted mode homes #1806
  • Head: 87bd3bc315c899dd4de6968d4408d75514b56d53
  • Head update: one gh pr update-branch sync from origin/main completed.
  • Mergeability: mergeable=MERGEABLE, merge-tree clean between branch and origin/main.
  • Status: mergeStateStatus currently BLOCKED despite checks green.
  • Required checks: green (PR required, PR policy, CI, Production UI (1/2/3) and Production UI critical all pass).
  • Blocking items: no required-CI blockers; remaining open review threads are from CodeRabbit/Codex and are non-blocking by status.

What was fixed/dispositioned

  • Applied required unblock action only: branch synced with main.
  • No code-path changes made on this PR during this sweep.
  • Appended unblock ledger record for this head under scope=unblock.

Residual risks

  • Merge remains blocked by repository merge-state (likely review/owner gating rather than checks/merge-tree).

@BigSimmo
BigSimmo merged commit 891029d into main Aug 11, 2026
26 checks passed
@BigSimmo
BigSimmo deleted the codex/remove-erroneous-pattern-matching-section branch August 11, 2026 11:47
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.

1 participant