Skip to content

feat: add a resizable panel group - #77

Merged
Shewart merged 4 commits into
mainfrom
feat/resizable-panels
Oct 23, 2026
Merged

Shewart merged 4 commits into
mainfrom
feat/resizable-panels

Conversation

@Shewart

@Shewart Shewart commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #67.

Neither copy of Resizable resized anything. This adds shadcn's ResizablePanelGroup, ResizablePanel and ResizableHandle:

  • Groups: horizontal or vertical, and they nest.
  • Panels: DefaultSize, MinSize and MaxSize in percent. Panels without a default share what's left.
  • Handles: role="separator" with aria-orientation and aria-valuenow. Drag with the pointer, or focus one and use the arrow keys (KeyboardStep, default 10%), Home and End. WithHandle shows a grip.
  • OnLayout gives every panel's size after a drag or key press, and Layout reads the current sizes.

Why it feels instant on Blazor Server: the new initResizeHandle in shellui.js (both the package and template copies) moves the panels in the browser during a drag or key press and reports the sizes to .NET once. A drag never waits on a round trip.

CLI: shellui add resizable now installs the panel group and its two hidden parts. The old Resizable (a plain flex container) stays in the package, marked deprecated, so nothing that uses it breaks. resizable is out of AllowedDrift. Registry: 254 entries (98 direct, 156 hidden).

Demo (/components/new): three panels with a nested vertical split and a live layout readout. The demo's shellui.js is refreshed from the template; it was an unmodified older copy.

Tests: 532 passing on net8.0 and net10.0, 0 warnings. Checked in the demo with real input:

  • Dragging stops at MaxSize (35%) and reports 35 / 40 / 25.
  • Two ArrowLeft presses move the handle 20%, and Home stops at the next panel's MinSize.
  • The vertical handle drags, and the cursor and dragging state reset on release.

ResizablePanelGroup, ResizablePanel and ResizableHandle follow shadcn:
horizontal or vertical groups, DefaultSize, MinSize and MaxSize per
panel in percent (panels without a default share what's left), and an
OnLayout callback with every panel's size. Handles are separators with
aria-valuenow; they drag with the pointer, and arrow keys, Home and End
move a focused handle by KeyboardStep.

The browser moves the panels during a drag or key press and reports
the sizes once, through initResizeHandle in both shellui.js copies, so
dragging never waits on a Blazor Server round trip.

shellui add resizable now installs the panel group. The old Resizable,
a plain flex container, stays in the package marked deprecated, and
resizable leaves AllowedDrift.

Fixes #67
Sync-checks the three parts and tests the initial sizes, the separator attributes and JS wiring, and applying a layout the browser reports.
The registry has 254 entries (98 direct, 156 hidden).
Three panels with a nested vertical split and a live layout readout. shellui.js is refreshed from the template and app.css rebuilt.
Copilot AI balanced review requested due to automatic review settings October 23, 2026 04:18

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@Shewart
Shewart merged commit b90755d into main Oct 23, 2026
1 check passed
@Shewart
Shewart deleted the feat/resizable-panels branch October 23, 2026 04:56
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.

Resizable: implement a real resizable panel group

2 participants