Skip to content

Land streamlined six-item sidebar (#066)#1174

Merged
cursor[bot] merged 28 commits into
mainfrom
cursor/sidebar-six-item-land-cfa0
Jul 25, 2026
Merged

Land streamlined six-item sidebar (#066)#1174
cursor[bot] merged 28 commits into
mainfrom
cursor/sidebar-six-item-land-cfa0

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix cross-mode search performance findings: prescribing catalogue debounce/abort/fields=index, differentials abort/debounce, universal documents typeahead soft-timeout (750ms), shared (search-app) shell to avoid composer remount, and Answer rate-limit in-memory fallback outside production.
  • Fix Bugbot regressions: shared-shell pathname navigation (/services/dsm) syncs searchMode during render (no stale-mode paint) even when the query string is unchanged; extracted ClinicalDashboard lazy imports to stay under the maintainability budget.

RAG impact: no retrieval behaviour change — typeahead documents domain timeout and shell URL sync only; ranking formulas and full /api/search retrieval path unchanged.

Verification

  • npm run verify:pr-local — focused Vitest on touched sources (362) plus api-rate-limit / search-shell / universal / route / site-map suites green; docs:check-index OK
  • UI verification not run: full verify:ui not required for this pass; mode-home smoke via npm run ensure returned HTTP 200 for /, /services, /dsm, /documents/search, /therapy-compass, /?mode=prescribing, and /api/answer/stream returned 200 after the rate-limit fallback fix
  • Verification not run: eval:retrieval:latency / soak / live OpenAI canary — approval-gated provider work; not needed for timeout-only typeahead change

Risk and rollout

  • Risk: medium — shared layout remount change and rate-limit fallback behaviour in non-production; production Answer/upload still fail closed when the durable limiter is unavailable
  • Rollback: revert this PR; mode routes return to per-segment GlobalSearchShell layouts and prior timeout/fallback behaviour
  • 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 [REDACTED] ([REDACTED])
  • 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

Notes

  • Prescribing list rows keep the full catalogue payload so Safety/Monitoring filters and patient alerts still see section-derived signals; keystroke storms are controlled by debounce + abort. fields=index remains for identity-only consumers (cross-mode links).
  • Live hybrid RPC cold tails remain a separate approval-gated follow-up.

Summary by CodeRabbit

  • New Features

    • Simplified sidebar navigation to six core links: Answer, Documents, Services, Medications, Factsheets, and Tools.
    • Added improved access to Settings, Account, and Guide & help from the sidebar.
    • Added smarter focus restoration when moving between Settings and Guide.
    • Added faster loading for Settings and Account dialogs.
  • Bug Fixes

    • Improved sidebar behavior across desktop, mobile, and tablet layouts.
    • Refined favourites visibility and navigation state handling.
  • Tests

    • Expanded coverage for sidebar links, guide flows, favourites access, and responsive layouts.

BigSimmo and others added 5 commits July 22, 2026 17:36
…ructure-b2bf

# Conflicts:
#	src/components/clinical-dashboard/ClinicalSidebar.tsx
Land the six-item sidebar (Answer, Documents, Services, Medications,
Factsheets, Tools) plus settings-guide flow and lazy sidebar dialogs on
current main. Keep main's clinical-dashboard-lazy barrel and phone shell
classes; replace main's Forms/Therapy rail composition with #66's set.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Assert the canonical sidebarToolItems list (Medications/Factsheets) instead
of main's retired primarySidebarToolIds Forms/Therapy filter.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@supabase

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

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

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

Next review available in: 15 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: 7af2ae00-d4ea-4826-89a6-39a15e23c638

📥 Commits

Reviewing files that changed from the base of the PR and between 6f383ea and a892307.

📒 Files selected for processing (8)
  • docs/branch-review-ledger.md
  • docs/outstanding-issues.md
  • src/components/ClinicalDashboard.tsx
  • src/components/clinical-dashboard/global-search-shell.tsx
  • src/components/clinical-dashboard/lazy-sidebar-dialogs.tsx
  • tests/favourites-auth-gate.dom.test.tsx
  • tests/therapy-compass-mode-wiring.test.ts
  • tests/ui-smoke.spec.ts
📝 Walkthrough

Walkthrough

The clinical sidebar now presents six canonical navigation links, removes theme and sidebar guide controls, and prefetches account dialogs. Settings and account dialogs are lazy-loaded, while guide transitions restore settings focus. Tests and review documentation were updated accordingly.

Changes

Clinical sidebar and dialog flow

Layer / File(s) Summary
Sidebar navigation and prop contracts
src/components/clinical-dashboard/ClinicalSidebar.tsx
The sidebar now uses six navigation tools, updated labels and rail markup, removes theme/help controls and badges, and accepts settings/account prefetch callbacks.
Lazy dialogs and focus-aware flow
src/components/ClinicalDashboard.tsx, src/components/clinical-dashboard/global-search-shell.tsx, src/components/clinical-dashboard/lazy-sidebar-dialogs.tsx, src/components/clinical-dashboard/settings-dialog.tsx, src/components/clinical-dashboard/use-settings-guide-flow.ts
Settings and account dialogs are lazy-loaded and prefetched; guide/settings transitions now coordinate dialog state and initial focus.
Navigation and dialog-flow validation
tests/favourites-auth-gate*, tests/therapy-compass-mode-wiring.test.ts, tests/ui-smoke.spec.ts
Tests validate the canonical navigation set, removed controls, hosted guide flow, tablet routes, and restored focus.

Review status documentation

Layer / File(s) Summary
Review ledger and issue status records
docs/branch-review-ledger.md, docs/outstanding-issues.md
Review, proof, merge, verification, and remaining-gate records were appended or revised.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ClinicalSidebar
  participant ClinicalDashboard
  participant useSettingsGuideFlow
  participant SidebarDialogs
  ClinicalSidebar->>ClinicalDashboard: open settings or account profile
  ClinicalDashboard->>useSettingsGuideFlow: set dialog state and initial focus
  ClinicalDashboard->>SidebarDialogs: render lazy settings or account dialog
  SidebarDialogs->>ClinicalDashboard: close dialog or open guide
  ClinicalDashboard->>useSettingsGuideFlow: restore settings focus after guide close
Loading

Possibly related PRs

Suggested labels: codex

Suggested reviewers: claude, cursoragent

🚥 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
Title check ✅ Passed The title is concise and accurately reflects the main change: the streamlined six-item sidebar for issue #066.
Description check ✅ Passed The description includes Summary, Verification, Risk, and Clinical Governance sections and is mostly complete for the template.
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 cursor/sidebar-six-item-land-cfa0

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.

cursoragent and others added 2 commits July 24, 2026 17:33
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
…em-land-cfa0

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

CI triage

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

  • Production UIneeds 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 #5368 (success).

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

cursoragent and others added 9 commits July 24, 2026 17:56
Tighten mobile menu assertions so Close Clinical Guide menu is not
treated as a Guide affordance, and make openGuide reuse an already-open
Settings dialog (tablet rail + restore path) instead of clicking through
an overlay.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
…0' into cursor/sidebar-six-item-land-cfa0

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Record feature-branch proof on PR #1174 (focused suites, verify:pr-local,
ensure spot-check, verify:ui). Remaining work is merge to main.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Cite d97c11e as the content-proof commit for the six-item sidebar land
so later ledger-only tip moves do not churn the issue row.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
…em-land-cfa0

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@cursor
cursor Bot marked this pull request as ready for review July 24, 2026 19:15
@cursor
cursor Bot enabled auto-merge (squash) July 24, 2026 19:17

@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: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/clinical-dashboard/global-search-shell.tsx (1)

611-623: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Sidebar collapse/expand no longer animates in the standalone shell.

The motion-safe:transition-[grid-template-columns]... class was dropped from this shell's grid container, but ClinicalDashboard.tsx's equivalent container (its main wrapper className) still keeps it. Result: collapsing/expanding the sidebar animates smoothly on / but snaps instantly on every standalone route (services, documents, differentials, etc.) that share the same ClinicalDesktopSidebar.

🎞️ Restore the transition class for consistency
       className={cn(
         "sm:min-h-dvh max-sm:fixed max-sm:inset-0 max-sm:overflow-hidden bg-[color:var(--background)] text-[color:var(--text)]",
         shouldShowDesktopSidebar && "md:grid md:grid-cols-[5.25rem_minmax(0,1fr)]",
         shouldShowDesktopSidebar &&
           (effectiveSidebarCollapsed ? "lg:grid-cols-[5.25rem_minmax(0,1fr)]" : "lg:grid-cols-[20rem_minmax(0,1fr)]"),
+        "motion-safe:transition-[grid-template-columns] motion-safe:duration-200 motion-safe:ease-out",
       )}
🤖 Prompt for 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.

In `@src/components/clinical-dashboard/global-search-shell.tsx` around lines 611 -
623, Restore the motion-safe grid-template-columns transition class on the
shell’s outer grid container in the component containing this return block,
matching the transition behavior used by ClinicalDashboard.tsx. Keep the
existing sidebar-dependent grid column classes unchanged so collapse and
expansion animate consistently across standalone routes.
🤖 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 `@docs/branch-review-ledger.md`:
- Line 795: Update the ledger entry identified by commit
c44a5c536e43f300feb1b88892d0b2a8ca2c4feb so its completion date is not
future-dated: use the actual execution date if the sweep has occurred, or mark
the action as pending if it has not. Preserve the existing evidence details only
when they correspond to the recorded date.
- Line 789: Clarify synchronization versus product merge in both ledger entries:
in docs/branch-review-ledger.md lines 789-789, change the “from cd54e68f onto
main” wording to state that the feature branch was synchronized with
origin/main; in docs/outstanding-issues.md lines 104-104, replace “merged onto
current main” with wording that current origin/main was merged into the feature
branch.

In `@src/components/clinical-dashboard/lazy-sidebar-dialogs.tsx`:
- Around line 1-13: Add the "use client" directive at the top of the lazy
sidebar dialogs module before its imports so the SettingsDialog and
AccountSetupDialog dynamic components can use ssr: false.

---

Outside diff comments:
In `@src/components/clinical-dashboard/global-search-shell.tsx`:
- Around line 611-623: Restore the motion-safe grid-template-columns transition
class on the shell’s outer grid container in the component containing this
return block, matching the transition behavior used by ClinicalDashboard.tsx.
Keep the existing sidebar-dependent grid column classes unchanged so collapse
and expansion animate consistently across standalone routes.
🪄 Autofix (Beta)

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 Plus

Run ID: f9423dc3-7e93-4b12-a61d-d8db6b5c5f6f

📥 Commits

Reviewing files that changed from the base of the PR and between 5eab279 and 6f383ea.

📒 Files selected for processing (12)
  • docs/branch-review-ledger.md
  • docs/outstanding-issues.md
  • src/components/ClinicalDashboard.tsx
  • src/components/clinical-dashboard/ClinicalSidebar.tsx
  • src/components/clinical-dashboard/global-search-shell.tsx
  • src/components/clinical-dashboard/lazy-sidebar-dialogs.tsx
  • src/components/clinical-dashboard/settings-dialog.tsx
  • src/components/clinical-dashboard/use-settings-guide-flow.ts
  • tests/favourites-auth-gate.dom.test.tsx
  • tests/favourites-auth-gate.test.ts
  • tests/therapy-compass-mode-wiring.test.ts
  • tests/ui-smoke.spec.ts

Comment thread docs/branch-review-ledger.md
Comment thread docs/branch-review-ledger.md
Comment thread src/components/clinical-dashboard/lazy-sidebar-dialogs.tsx
BigSimmo and others added 3 commits July 25, 2026 15:13
Resolve outstanding-issues (#66 progress), therapy/ui-smoke six-item
sidebar assertions, add use client for lazy sidebar dialogs, and append
ledger CORRECTION for sync-vs-merge wording.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid ByRoleOptions exact overload mismatch in favourites-auth-gate DOM test.

Co-authored-by: Cursor <cursoragent@cursor.com>
BigSimmo and others added 4 commits July 25, 2026 15:32
Use exact name + first() so rail and breadcrumb links do not trip strict mode.

Co-authored-by: Cursor <cursoragent@cursor.com>
Take main outstanding-issues after #1177 land; keep #66 progress row.

Co-authored-by: Cursor <cursoragent@cursor.com>
Take main's #30/#75 closures and keep the #66 six-item progress row.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor
cursor Bot merged commit 4dc7630 into main Jul 25, 2026
18 checks passed
@cursor
cursor Bot deleted the cursor/sidebar-six-item-land-cfa0 branch July 25, 2026 07:56
cursor Bot pushed a commit that referenced this pull request Jul 25, 2026
* docs(issues): close stale #66/#67 after main landings

#66 is on origin/main via PR #1174; #67 was fixed in PR #1191 by
running the preflight JSON contract in-process. Also drop already-
resolved #30/#75 from the recommended queue and renumber.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>

* docs: pin branch-review ledger SHA for #66/#67 closeout

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
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