Skip to content

refactor: centralize search route ownership#792

Merged
cursor[bot] merged 3 commits into
mainfrom
cursor/search-route-ownership-db17
Jul 17, 2026
Merged

refactor: centralize search route ownership#792
cursor[bot] merged 3 commits into
mainfrom
cursor/search-route-ownership-db17

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Centralizes the dashboard-vs-route submitted-search decision into src/lib/search-route-ownership.ts, removing duplicated routing logic that caused recurring regressions when modes changed.
  • Rebased onto current main after conflict resolution in the review ledger.
  • Supersedes refactor: centralize search route ownership #752.

Verification

  • Focused vitest for search-route-ownership and therapy-compass-mode-wiring passed (7/7).
  • ESLint/typecheck on touched files passed after rebase.
  • UI verification not run: hosted CI UI gate required after rebase.

Risk and rollout

  • Risk: low; the routing boundary is a pure function with unit coverage; no data or clinical content changes.
  • Rollback: revert this PR; search shell reverts to prior routing ownership logic.
  • Provider or production effects: None

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
Open in Web Open in Cursor 

Summary by CodeRabbit

  • Bug Fixes

    • Improved search routing so submitted searches remain within workflows that own their routes.
    • Prevented the Clinical Dashboard from replacing medication detail pages and document-search mockups.
    • Corrected Therapy Compass search behavior to keep results within its dedicated workflow.
  • Tests

    • Added coverage for route ownership and search rendering across supported workflows.

@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 ↗︎.

@cursor
cursor Bot enabled auto-merge (squash) July 17, 2026 20:36
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change centralizes submitted-search route ownership in pure helpers, updates GlobalSearchShell to use them, adds route-specific tests, adjusts Therapy Compass wiring validation, and documents the new routing boundary.

Changes

Search route ownership

Layer / File(s) Summary
Route ownership rules
src/lib/search-route-ownership.ts
Defines dashboard-search and ClinicalDashboard eligibility using submitted-search state, mode ownership, and pathname exclusions.
Global search shell integration
src/components/clinical-dashboard/global-search-shell.tsx
Uses the centralized helpers for dashboard rendering and standalone-mode home detection.
Ownership validation and documentation
tests/search-route-ownership.test.ts, tests/therapy-compass-mode-wiring.test.ts, docs/frontend-architecture.md
Adds route-ownership coverage, replaces shell-source assertions with production helper checks, and documents the routing boundary.

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

Possibly related PRs

Suggested labels: codex

Suggested reviewers: claude

🚥 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
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.
Title check ✅ Passed The title clearly summarizes the main change: centralizing search route ownership logic in a refactor.
Description check ✅ Passed The description matches the required template and covers summary, verification, risk, and clinical governance; only the Notes section is missing.
✨ 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 cursor/search-route-ownership-db17

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

@cursor
cursor Bot merged commit 1822b34 into main Jul 17, 2026
15 checks passed
@cursor
cursor Bot deleted the cursor/search-route-ownership-db17 branch July 17, 2026 20:45
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.

2 participants