Skip to content

feat(webkit): add a side prop so a trailing panel is Sidebar too - #901

Draft
gabriel-lisboa-azion wants to merge 2 commits into
mainfrom
feat/sidebar-side-prop
Draft

feat(webkit): add a side prop so a trailing panel is Sidebar too#901
gabriel-lisboa-azion wants to merge 2 commits into
mainfrom
feat/sidebar-side-prop

Conversation

@gabriel-lisboa-azion

Copy link
Copy Markdown
Collaborator

Summary

  • Adds side: 'start' | 'end' (default 'start', so every existing consumer is unaffected). An explorer layout — a log with a detail panel, a database browser with a schema panel — needs a resizable, hideable panel on the right.
  • useSidebarRail derives a direction() of +1/-1 and every horizontal decision multiplies by it, so the trailing panel inherits the same clamping, phase-aware transition, inert collapsed state and testids instead of being re-implemented beside the leading one.
  • Adds data-side on the root, a Trailing story putting both edges on one page, and spec + catalog updates.

How to test

  1. cd packages/webkit && npx vitest run src/components/layout/sidebar → passes.
  2. pnpm storybook:dev → Components/Layout/Sidebar → Trailing. The right-hand panel's border and drag handle are on its left edge; dragging left grows it; collapsing sends it out to the right; the collapse glyph and arrow keys mirror. The leading rail on the same page behaves exactly as before.
  3. Existing Sidebar stories are unchanged (no side passed → start).

Notes

  • Additive; no breaking change.

An explorer layout — a log with a detail panel, a database browser with a schema
panel — puts a resizable, hideable panel on the right. The only thing that
differs there is the direction of every horizontal decision: which edge the
border and the handle sit on, which way a drag grows the panel, which way it
leaves, and which way the collapse glyph points.

`side: 'end'` mirrors all of them from a single sign. `useSidebarRail` derives a
`direction()` of +1 or -1 and every place that reads a horizontal direction
multiplies by it, so a trailing panel inherits the same clamping, the same
phase-aware transition, the same `inert` collapsed state and the same testids
instead of being re-implemented beside the leading one — which is exactly how the
two would drift.

Defaults to `start`, so every existing consumer is unaffected. Adds `data-side`
on the root and a Trailing story that puts both edges on one page, since a mirror
is only demonstrable against the thing it mirrors.
@gabriel-lisboa-azion
gabriel-lisboa-azion requested a review from a team as a code owner August 17, 2026 09:49
@gabriel-lisboa-azion
gabriel-lisboa-azion marked this pull request as draft August 17, 2026 10:01
…story

Adds the 6 snapshots for the new Trailing story across the mode matrix.
Generated by the Storybook Regenerate Baseline workflow on this branch's HEAD —
baselines are ubuntu-only, so a local run would not match the folder the visual
gate compares against.

No existing snapshot is modified or deleted: `side` defaults to `start`, so the
other Sidebar stories render exactly as before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant