Skip to content

Search: skip active domains in submitted matches#669

Merged
BigSimmo merged 1 commit into
mainfrom
codex/universal-search-domain-exclusions
Jul 14, 2026
Merged

Search: skip active domains in submitted matches#669
BigSimmo merged 1 commit into
mainfrom
codex/universal-search-domain-exclusions

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • exclude all domains owned by the active mode from submitted cross-mode search requests
  • include the normalized exclusion set in the client LRU cache key
  • assert that submitted Services results do not request the Services domain
  • make the Answer persistence test submit through its accessible action while the separate Enter-behavior test remains unchanged

Why

Follow-up to #658. GitHub squash-merged that PR just before the final review fix was pushed, so this carries only the three-file efficiency fix onto current main.

Verification

  • Prettier check: passed
  • focused ESLint with zero warnings: passed
  • TypeScript typecheck: passed on the exact patch before clean cherry-pick
  • focused Vitest: 3 files, 46 tests passed
  • universal-search Chromium: request-exclusion assertion passed; all 14 cases covered by the full run plus focused reruns of two cold-compilation timeouts
  • follow-up branch diff check: passed; 3 files, 13 insertions, 9 deletions

Checks not run

  • No live Supabase, OpenAI, or other provider-backed checks were run.
  • A combined current-main local gate timed out under machine-wide concurrent Database verification without emitting a diagnostic; protected PR checks remain required.

Risk

Low and bounded to client request fan-out/cache partitioning for the submitted cross-mode panel. The universal API contract is unchanged.

Summary by CodeRabbit

  • Bug Fixes
    • Improved cross-mode search results by excluding domains already preferred for the current mode.
    • Ensured “Also matches” results display only relevant results from other modes.
  • Tests
    • Updated universal search coverage to verify excluded domains and cross-mode links.
    • Updated answer-generation testing to reflect the current submission flow.

@supabase

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

@BigSimmo
BigSimmo enabled auto-merge (squash) July 14, 2026 15:03
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: eb07d8b6-2bf2-4e32-a1b4-e1ab518efd74

📥 Commits

Reviewing files that changed from the base of the PR and between 94a6c02 and 6b2c4ff.

📒 Files selected for processing (3)
  • src/components/clinical-dashboard/universal-search-also-matches.tsx
  • src/components/clinical-dashboard/use-universal-search.ts
  • tests/ui-universal-search.spec.ts

📝 Walkthrough

Walkthrough

Universal search now accepts multiple excluded domains, incorporates them into caching and requests, and excludes preferred domains from cross-mode matches. UI tests verify request filtering and updated Answer submission behavior.

Changes

Universal search exclusions

Layer / File(s) Summary
Multi-domain exclusion in universal search
src/components/clinical-dashboard/use-universal-search.ts
useUniversalSearch replaces its single excluded domain input with a readonly list, serializes that list for cache keys, filters all excluded domains from requests, and updates effect dependencies.
Preferred-domain cross-mode matching
src/components/clinical-dashboard/universal-search-also-matches.tsx, tests/ui-universal-search.spec.ts
Cross-mode matching excludes preferred domains for the active mode; tests verify the request omits the Services domain and use the source-backed answer generation flow.

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

Sequence Diagram(s)

sequenceDiagram
  participant AlsoMatches
  participant UniversalSearchHook
  participant UniversalSearchAPI
  AlsoMatches->>UniversalSearchHook: pass preferred domains as exclusions
  UniversalSearchHook->>UniversalSearchHook: build excluded-domains cache key
  UniversalSearchHook->>UniversalSearchAPI: request remaining search domains
  UniversalSearchAPI-->>UniversalSearchHook: return cross-mode results
  UniversalSearchHook-->>AlsoMatches: render eligible matches
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning It includes Summary, Verification, Checks not run, and Risk, but it omits the required Clinical Governance Preflight section for a search/ranking change. Add the Clinical Governance Preflight checklist and any required Notes section, then confirm the governance items relevant to this search change.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: excluding active-mode domains from submitted cross-mode search matches.
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/universal-search-domain-exclusions

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. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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

@BigSimmo
BigSimmo merged commit 25d7f73 into main Jul 14, 2026
16 checks passed
@BigSimmo
BigSimmo deleted the codex/universal-search-domain-exclusions branch July 17, 2026 06:54
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