Skip to content

feat(sidebar): add opt-in sidebar resizing - #659

Draft
IzumiSy wants to merge 3 commits into
mainfrom
feat/resizable-sidebar
Draft

IzumiSy wants to merge 3 commits into
mainfrom
feat/resizable-sidebar

Conversation

@IzumiSy

@IzumiSy IzumiSy commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Navigation labels sometimes need more room, but the sidebar currently supports only expanding and collapsing. Make resizing a standard desktop interaction, including reopening a collapsed sidebar and continuing to resize without releasing the pointer.

Design Decision

Default-enabled desktop behavior

Resizing is enabled by default in <SidebarLayout /> and <GlobalHeaderLayout />; apps can opt out with resizable={false}. Mobile/tablet behavior remains unchanged. Only the central grip starts resizing, and the grip remains available when collapsed. Pointer gestures use position-based resistance and early collapse snapping rather than delayed mouse tracking or a jump to the default width. Click and keyboard expansion still restore 256px.

Live pixels outside React state

Keep pointer capture and interaction decisions in JavaScript, but apply live width and position through CSS custom properties with calc() and max(). React commits widths only at mode changes and gesture completion, avoiding per-move rerenders and Context updates while keeping ARIA values current. Content continues resizing live, so layout work remains; this is not a compositor-only animation.

Summary

  • Add default-enabled desktop resize/expand handles with continuous dragging, 192–480px expanded bounds, keyboard controls, and an explicit opt-out.
  • Cover defaults, opt-out, resistance, early collapse, pointer cleanup, live ARIA, CSS geometry, and the absence of per-move React renders with unit and browser tests.
  • Refresh browser dependency prebundles on each run so style contracts exercise the newly built package rather than stale JavaScript.
  • Update authored documentation and generated outputs, and include a minor changeset.

@github-actions

Copy link
Copy Markdown
Contributor

Code Metrics Report

main (b8ead52) #659 (8e49999) +/-
Coverage 89.5% 89.7% +0.2%
Test Execution Time 3m20s 2m15s -1m5s
Details
  |                     | main (b8ead52) | #659 (8e49999) |  +/-  |
  |---------------------|----------------|----------------|-------|
+ | Coverage            |          89.5% |          89.7% | +0.2% |
  |   Files             |            236 |            237 |    +1 |
  |   Lines             |           7517 |           7616 |   +99 |
+ |   Covered           |           6732 |           6837 |  +105 |
+ | Test Execution Time |          3m20s |          2m15s | -1m5s |

Code coverage of files in pull request scope (82.2% → 93.0%, patch 99.0%)

Files Coverage +/- Patch Coverage Status
packages/core/src/components/sidebar/global-header-layout.tsx 100.0% 0.0% 100.0% modified
packages/core/src/components/sidebar/primitives.tsx 86.7% +8.0% 100.0% modified
packages/core/src/components/sidebar/sidebar-layout.tsx 100.0% 0.0% 100.0% modified
packages/core/src/components/sidebar/sidebar-resize-handle.tsx 98.9% +98.9% 98.9% added

Reported by octocov

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