Skip to content

ui: Sidebar resizing improvements - #31119

Merged
ggerganov merged 6 commits into
masterfrom
allozaur/feat/ui-sidebar-resize
Oct 26, 2026
Merged

ggerganov merged 6 commits into
masterfrom
allozaur/feat/ui-sidebar-resize

Conversation

@allozaur

@allozaur allozaur commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Brings back drag-to-resize for the desktop sidebar (dropped with the shadcn sidebar in #24897), now with rubber-band resistance past the min/max width, drag-to-hide below 9rem, and a label/list fade that follows the live width. The sidebar's width and open state are also remembered across reloads.

Screen.Recording.2026-10-25.at.00.55.02.mp4

Requirements

@allozaur
allozaur marked this pull request as ready for review October 24, 2026 23:07
@allozaur
allozaur requested a review from a team as a code owner October 24, 2026 23:07
Copilot AI balanced review requested due to automatic review settings October 24, 2026 23:07

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 insufficient remaining quota.

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.

Bring back the desktop sidebar resize handle that was dropped with the
shadcn sidebar primitive. The width is clamped between 18rem and 32rem,
persists across reloads, and resets on a double-click of the handle. The
tab bar follows the same width so a wider sidebar never covers it.

Assisted by: Claude (Opus 5.5 Medium)
Past the max width the edge resists harder the further it is pulled, and
the same happens below the min width until the pull passes 9rem, where it
snaps to the pointer and letting go hides the sidebar. A release outside
the bounds springs the width back to the nearest one.

Assisted by: Claude (Opus 5.5 Medium)
…gging

The strip is clipped to the sidebar's rounded corners through its own
overlay, so the sidebar itself is never clipped.

Assisted by: Claude (Opus 5.5 Medium)
A phone opens the sidebar as an overlay, so it always starts closed there
and its toggling never overwrites the desktop preference.

Assisted by: Claude (Opus 5.5 Medium)
The fade follows the live width, so it tracks both the toggle's width
transition and a drag below the minimum width.

Assisted by: Claude (Opus 5.5 Medium)
@allozaur
allozaur force-pushed the allozaur/feat/ui-sidebar-resize branch from 5ca4d72 to 8af873e Compare October 24, 2026 23:19
@allozaur
allozaur changed the base branch from allozaur/ui/chat-landing-and-tabs to master October 24, 2026 23:20
@ServeurpersoCom

Copy link
Copy Markdown
Contributor

LGTM, mobile stays untouched (handle hidden below md, expanded state never read or written on phones).

Possible improvements:

  • setSidebarWidth() writes to localStorage on every pointermove, so at the display refresh rate during a drag. Persisting once on pointerup is enough.
  • loadSidebarWidth() doesn't clamp the restored value, so if the bounds ever change, a stale out-of-range width sticks until the next drag.

A drag now updates only the live width and writes it to localStorage once
when released. A width restored from localStorage is clamped to the
current bounds, so a value saved under older bounds does not stick.

Assisted-by: Claude (Opus 5.5 Medium)
@allozaur allozaur added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Oct 25, 2026
@ServeurpersoCom

Copy link
Copy Markdown
Contributor

Nice! Thanks

@ggerganov
ggerganov merged commit 69b3cc4 into master Oct 26, 2026
7 checks passed
@allozaur
allozaur deleted the allozaur/feat/ui-sidebar-resize branch October 26, 2026 12:54
auRose94 pushed a commit to auRose94/llama.cpp that referenced this pull request Oct 28, 2026
* ui : let the expanded sidebar be resized by dragging its edge

Bring back the desktop sidebar resize handle that was dropped with the
shadcn sidebar primitive. The width is clamped between 18rem and 32rem,
persists across reloads, and resets on a double-click of the handle. The
tab bar follows the same width so a wider sidebar never covers it.

Assisted by: Claude (Opus 5.5 Medium)

* ui : rubber-band the sidebar edge past its bounds and drag it shut

Past the max width the edge resists harder the further it is pulled, and
the same happens below the min width until the pull passes 9rem, where it
snaps to the pointer and letting go hides the sidebar. A release outside
the bounds springs the width back to the nearest one.

Assisted by: Claude (Opus 5.5 Medium)

* ui : show the sidebar edge strip faintly on hover and solid while dragging

The strip is clipped to the sidebar's rounded corners through its own
overlay, so the sidebar itself is never clipped.

Assisted by: Claude (Opus 5.5 Medium)

* ui : remember whether the desktop sidebar is open across reloads

A phone opens the sidebar as an overlay, so it always starts closed there
and its toggling never overwrites the desktop preference.

Assisted by: Claude (Opus 5.5 Medium)

* ui : fade the sidebar labels and conversation list with its width

The fade follows the live width, so it tracks both the toggle's width
transition and a drag below the minimum width.

Assisted by: Claude (Opus 5.5 Medium)

* ui : persist the sidebar width on release and clamp a restored one

A drag now updates only the live width and writes it to localStorage once
when released. A width restored from localStorage is clamped to the
current bounds, so a value saved under older bounds does not stick.

Assisted-by: Claude (Opus 5.5 Medium)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. server/ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants