Skip to content

feat(ui): make side detail panels resizable in Ownership and Reactivity - #42

Merged
lxsmnsyc merged 7 commits into
solidjs:mainfrom
Xoppyc:feat/resizable-detail-panels
Nov 4, 2026
Merged

lxsmnsyc merged 7 commits into
solidjs:mainfrom
Xoppyc:feat/resizable-detail-panels

Conversation

@Xoppyc

@Xoppyc Xoppyc commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Makes the side detail panes in both the Ownership Tree (component details) and the Reactivity Graph (node details) horizontally resizable.

Changes

  1. ResizeHandle & useResizableDetail primitive:

    • Built a reusable ResizeHandle in src/ui.
    • Uses ::before for a generous 12px invisible grab hitbox, and ::after for the visual indicator.
    • Clean visual states: subtle semi-transparent line on hover (opacity: 0.6), expanding to a solid 3px accent line while dragging (no glow/blur).
    • Double-clicking the resize handle resets width back to default (320px).
    • Width is clamped between 240px and 70% viewport width and persisted in localStorage.
  2. Panel Integrations:

    • Wired into <aside data-solid-ownership-detail> in OwnershipViewer.
    • Wired into <aside data-solid-reactivity-detail> in ReactivityViewer.
  3. Tests & Changeset:

    • Added unit test in use-resizable-detail.test.ts.
    • Added E2E test in devtools.spec.ts verifying drag resize and double-click reset.
    • Added changeset.

@lxsmnsyc lxsmnsyc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is small and fits the existing panels. CI passed. One behavior issue and a few nits.

Should fix

  1. The edge drifts away from the pointer after hitting a limit. ResizeHandle reports the delta since the last pointermove, and onResizeDelta adds it to the already clamped width. Drag 100px past the minimum, then back 50px: the panel grows 50px while the pointer is still 50px past the edge. Fix: record the start width and start X on pointerdown and set width = startWidth + (startX - clientX), clamped.

Nits

  • The maximum is 70% of window.innerWidth, but the panel also has the 11rem sidebar. At a 1000px window the tree gets about 120px. Clamping to the panel's own width would keep the tree usable. A window resize also does not re-clamp the saved width.
  • Both panels share one storage key, so resizing one resizes the other. If that is intended, a short comment would help.
  • The Reactivity detail was 19rem (304px) and now defaults to 320px.
  • role="separator" without tabindex and aria-valuenow cannot be used from the keyboard. Arrow-key resizing would fix that.

This PR and #41 both change src/dev-toolbar/ownership/index.tsx and conflict there; whichever merges second needs a rebase.

@lxsmnsyc
lxsmnsyc force-pushed the feat/resizable-detail-panels branch from 012d987 to e932c9b Compare November 4, 2026 01:08
Xoppyc and others added 7 commits November 4, 2026 09:27
The handle now reports the offset from where the drag started, and the
pane width is the start width plus that offset, clamped. Before, it added
each move to the clamped width, so the edge drifted away from the pointer
after passing a limit.

The widest a pane gets is the panel width minus 240px for the tree or
graph, and a CSS max-width keeps that when the window shrinks. Each pane
saves its own width, and the Reactivity pane keeps its old 304px default.
The handle is focusable, reports aria-valuenow, and moves 16px per arrow
key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lxsmnsyc
lxsmnsyc force-pushed the feat/resizable-detail-panels branch from e932c9b to ce60577 Compare November 4, 2026 01:29
@lxsmnsyc
lxsmnsyc merged commit ed9f773 into solidjs:main Nov 4, 2026
3 checks passed
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.

2 participants