Skip to content

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

Open
Xoppyc wants to merge 6 commits into
solidjs:mainfrom
Xoppyc:feat/resizable-detail-panels
Open

Xoppyc wants to merge 6 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.

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