Skip to content

fix(web): keep sidebar closable on narrow viewports - #2526

Merged
cursor[bot] merged 5 commits into
mainfrom
cursor/fix-mobile-sidebar-close-2b4a
Aug 1, 2026
Merged

fix(web): keep sidebar closable on narrow viewports#2526
cursor[bot] merged 5 commits into
mainfrom
cursor/fix-mobile-sidebar-close-2b4a

Conversation

@tyler-dane

@tyler-dane tyler-dane commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

On narrow viewports, opening the sidebar squeezed the main column so the calendar header's "Close sidebar" toggle was clipped by flex overflow — leaving no visible way to dismiss the panel.

  • Keep the header sidebar toggle in a shrink-0 column so left-side nav/title content yields first (without overflow-hidden, so the SelectView menu still paints).
  • Extract a shared SidebarToggleButton for the header.
  • Host a distinct in-sidebar Dismiss sidebar (X) control in SidebarShell below the auto-collapse breakpoint (1280px), including while Day/Week event details keep the panel open.
  • Dismiss closes the sidebar preference and discards any open event form, then returns focus to the header open control. Opening from the header on narrow moves focus to the dismiss control when present.

Simplicity

Reuse the existing toggle for the header; add a small dedicated dismiss control for the narrow in-sidebar case rather than remounting one control between header and sidebar (which caused focus/a11y issues).

Automated validation

Browser (http://localhost:9080/life):

  • 450px: open sidebar → Dismiss sidebar X visible → click closes sidebar; focus returns to header open control
  • Wide: SelectView Day/Week/Life dropdown fully visible (not clipped)

Independent review

Confirmed findings fixed:

  • SelectView clipping from header overflow-hidden — removed
  • Focus loss from remounting one toggle — replaced with dedicated dismiss + focus handoff
  • Dismiss leaving event-details panel open — also discards draft / keeps dismiss while form open
  • Focus stuck on clipped header after open — moves focus to dismiss when present

Test plan

  • bun test:web packages/web/src/components/Sidebar/SidebarShell.test.tsx packages/web/src/components/Sidebar/SidebarToggleButton.test.tsx packages/web/src/components/Sidebar/SidebarCloseButton.test.tsx packages/web/src/components/Sidebar/hooks/useIsNarrowSidebarLayout.test.ts packages/web/src/views/Life/LifeView.test.tsx
  • bun run lint
  • bun run type-check
Open in Web Open in Cursor 

cursoragent and others added 5 commits July 31, 2026 23:52
When the open sidebar squeezes the main column, the header toggle was
clipped by flex overflow. Keep that control shrink-wrapped, and host the
same toggle inside the sidebar below the auto-collapse breakpoint.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Hide the header toggle while the narrow in-sidebar close is shown, and
unmount that in-sidebar control as soon as the sidebar starts closing so
collapse transitions do not leave two "Open sidebar" buttons.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Address review findings: keep SelectView unclipped (no overflow-hidden on
the header cluster), and use a distinct in-sidebar dismiss control that
returns focus to the header open toggle after close.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Keep the in-sidebar dismiss control while Day/Week event details hold the
panel open, discard the draft on dismiss, and move focus to that control
after opening from the header on narrow layouts.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
@cursor
cursor Bot merged commit a15dd1d into main Aug 1, 2026
20 checks passed
@cursor
cursor Bot deleted the cursor/fix-mobile-sidebar-close-2b4a branch August 1, 2026 00:33
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