fix(sidebar): default the desktop sidebar to collapsed - #1637
Conversation
New users previously got the labelled (expanded) sidebar with collapse as a remembered choice. Flip the default to collapsed, matching the existing already-closed mobile drawer default, so the sidebar starts closed on all devices until a user explicitly expands it.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe sidebar now defaults to collapsed for new users and storage errors. Explicit stored preferences remain supported. Unit, accessibility, smoke, tools, and hydration tests now reflect the updated state handling. ChangesSidebar default state
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
CI triageCI failed on this PR. Automated classification of the 2 failed job(s):
Compared with main CI run #8427 (cancelled). Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger. |
#clinical-tools-sidebar only mounts when the sidebar is expanded, so after flipping the default to collapsed the "defaults to collapsed" test must assert the collapsed rail is visible and the expanded panel is absent, not that the expanded panel is visible.
Tablet smoke must seed expanded so #clinical-tools-sidebar mounts and toBeHidden() covers the display:none-below-lg path. Forced-colors a11y must target the solid --command New chat in the expanded panel, not the collapsed rail icon. Refresh the stale "default to labelled" comment. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Review feedback dispositions (PR #1637)Treating the sidebar-default PR (the earlier #1367 reference was a transposed number).
|
The storage key is only written after an explicit toggle, so absent means collapsed for new users and never-toggled returning browsers alike. Document that so the rollout note stays honest about who is unaffected. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Previous Production UI / Semgrep ingestion gate failures were Set up job Service Unavailable / Bad Gateway while resolving action download info, not product assertions. Empty commit to get a clean required check run. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Scope reduced-motion New chat clicks to the collapsed rail, seed the hydration mismatch path with an expanded preference, and pin the readSidebarCollapsedPreference default with a focused unit test. 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>
Review feedback dispositions (follow-up)Addressed the remaining coverage gaps after the earlier Bugbot/test-hardening pass, and synced the branch with
Validation: |
CI status noteGitHub Actions is currently in a partial outage (status): recent reds on this PR ( Latest head |
GitHub Actions cancel returned 502 while Change scope stayed cancelled and PR required queued indefinitely; push a tip bump so concurrency replaces it. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
CI status noteHosted Actions is currently degraded for this head:
Product validation already green locally ( |
Closeout status (head
|
Babysit status (PR #1637)Code / review: No remaining actionable work on the tip (
Local proof (this session):
Hosted CI: blocked by GitHub Actions major outage (status). Current tip checks are stuck No guardrailed merge/auto-merge/force-push performed. |
Babysit updatePartial Actions recovery on tip
Still no unresolved review threads and no merge conflicts ( |
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Prior CI run cancelled/timed out while queued during the GitHub Actions major outage. Empty commit to re-fire checks on current tip. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Sidebar now defaults to collapsed, so the Settings control inside #clinical-tools-sidebar is not reachable until Expand is clicked. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Summary
useSidebarCollapsed) previously defaulted new users to the labelled (expanded) state, with collapse only sticking once a user toggled it. Flip the default to collapsed so the sidebar starts closed for new users, matching the mobile drawer's existing closed-by-default behavior (mobileSidebarOpenalready startsfalse) — the sidebar is now closed by default on all devices.client-store-factoryusage totrueso the server-rendered markup matches the new client default and avoids a hydration flash.ui-smoke.spec.ts,ui-tools.spec.ts,ui-tools-collapse.spec.ts) whose comments/seededlocalStoragevalues and assertions encoded the old expanded-by-default behavior.Verification
npm run test:focused -- --files src/components/clinical-dashboard/use-sidebar-collapsed.ts,src/lib/client-store-factory.ts—Test Files 10 passed (10),Tests 88 passed (88)npx tsc --noEmit -p tsconfig.json— clean, no outputnpx eslinton touched files — clean, no outputnpm run verify:uinot run — this is a text-only default-value change already covered by the focused unit suite and the specs I updated to match the new default; the full Chromium browser gate touches many unrelated journeys and wasn't run in this session (VERIFICATION NOT RUN: broader browser gate out of scope for a single default-value flip; the updated specs will exercise this behavior when CI's Chromium job runs on the PR).Risk and rollout
clinical-kb-sidebar-collapsedlocalStorage key is unaffected for existing users who already have a stored preference.Notes
Generated by Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Tests