OpenProgram Docs

Sidebar widths and collapsed state

StateWidthBehavior
Left expanded180–480px, and at most 30% of a window wider than 900pxDrag from the right edge; stops at the limit. A narrower window limits what is drawn, not the stored width, so widening it brings the width back
Right expanded240–800px, and at most 55% of a window wider than 900pxDrag from the left edge; stops at the limit. A narrower window limits what is drawn, not the stored width, so widening it brings the width back
Collapsed62px: a 46px card inside the 8px guttersSame 200ms width animation on both sides
Expand againThe valid width from before collapseSame animation; keeps the most recently adjusted width
Phone, 760px and belowLeft: a min(86vw, 320px) drawer; right: the whole screen. No collapsed rail, no handleThey slide in and out instead (phone layout)

Width behavior

components/layout/use-resizable-rail.ts is the only implementation: saves expanded widths, enforces limits, handles pointer capture, generates expanded and collapsed styles, controls transitions. Each sidebar passes its limits and growth direction.

AspectRule
Handle.rail-resize-handle, hit area about 8px either side of the divider, no effect on layout width. The shell permits its overflow; the inner content stays clipped.
DragPrimary button only; touch panning and text selection on the handle disabled. Hovering shows the same short grip as a split's divider, centred in the 8px gap between the cards; dragging makes it solid, and it turns the accent colour while the width rests on the default.
Back to the defaultEither rail: a double-click on the handle, or Enter with the handle focused, returns to 288px over 280ms, easing out. The width is walked a frame at a time, as in a drag, so what is inside the rail moves with its edge. At the default nothing is stored.
SnapsA drag within 8px of a snap rests on it, and the handle turns blue. The left rail's only snap is 288px. The right rail's are 288, 544 and 800px, where one, two and three columns of the Activity time chart fit whole.
Drag endsRelease, pointer cancel or window blur. Window-level end events back up the captured handle events; a move that sees a released button also ends it. The collapse animation is restored each time.

Opening and closing

Every part exists in both states: opening and closing never mount, unmount or change display inside the rail, in either direction or when toggled mid-move. The shell's width starts in the click's frame; .collapsed changes in that render. Rules: app/styles/base/layout.css, "Opening and closing".

KindPartsHow it moves
One placeThe left sidebar's New chat chip and link iconsLaid out against the left edge, which stays put. Each row's box rides the card's moving edge 8px in.
Two placesBoth toggles, the right panel's view rows, the left footer's avatarToggles sit 8px in from the moving edge, open and centred in the collapsed card. The right panel's rows are one column riding its moving left edge. The avatar's left padding glides from 16px to 5px, its right from 16px to 27px, so the name keeps one width.
Open onlyWordmark, labels, the Ability refresh action, favourites, the conversation list, the scroll divider, the footer's name and chevron, the right panel's views (Files, Activity, Resources, Detail, Context)Laid out at the open width in both states and clipped by the card, so nothing re-wraps. Faded by opacity alone on the width's duration and curve (the footer's name on its own 160ms curve). Inert from a close's settle to an open's settle. Labels and the footer's name stay reachable inside the rows the collapsed rail keeps.
Why no inherited property changes

A move changes no inherited property (pointer-events, visibility, color, custom properties). The browser restyles the whole subtree under such a change, which in the click's frame is the whole conversation list: 1,764 elements for pointer-events, 1,946 for visibility, 1 for opacity (traced).

use-resizable-rail.ts writes inert on the outermost open-only parts itself at the settle (the width's transitionend, or a timer), so that restyle lands after the move. A part that mounts while the rail is at rest collapsed becomes inert with it.

Settled state and first paint
  • The toggle's two glyphs (hide, show) stay mounted and cross-fade.
  • data-rail-closed marks a settled close. Only what cannot be seen keys on it: the narrow layout's return to the flow beside a split canvas, the left list's scroll reset, paused running markers in the hidden list.
  • A left sidebar closed while scrolled slides its links to the top with the width (one Web Animation on transform) and resets the scroll at the settle in the same frame.
  • The right panel's views work only while it is open: Activity, Resources' processes, page pictures and terminal reads pause while collapsed.
  • A stored closed left sidebar paints collapsed in the first frame under html[data-sidebar-closed], no transition, its open-only parts out of reach by interactivity: inert until the mounted rail makes them inert.

Components

FileResponsibility
sidebar/sidebar.tsxLeft shell, persisted toggle, New chat, favorites and session composition
sidebar/sidebar-primary-nav.tsxFixed navigation, route highlighting, navigation icon animation, Programs refresh
right-sidebar/right-sidebar.tsxRight shell, file entry, view container
right-sidebar/detail-panel.tsxDetails and Context switching, detail rendering for the selected DAG node

The session list and AppShell keep their own state and interaction boundaries, separate from the sidebar shells.

Acceptance
  • Drag each sidebar to its limit and collapse: it becomes 62px within 200ms, nothing vanishing or appearing in one frame.
  • Expanding restores the previous width.
  • Double-clicking a rail's handle returns it to 288px, and it stays there after a reload.
  • Dragging either rail with a long conversation open shows no scrollbar in the chat.
  • Dragging can begin within about 8px either side of the divider, shows the short grip, and continues after the pointer leaves the handle.

Implementation status

Implemented. Both sidebars use the same width module; shell components only compose navigation and detail rendering.

Last updated · 2026-11-25