Skip to content

feat(ui): handle-wide click-to-collapse + suppressible hover on resize handles#1028

Merged
backnotprop merged 3 commits into
mainfrom
feat/resize-handler-ux
Jul 9, 2026
Merged

feat(ui): handle-wide click-to-collapse + suppressible hover on resize handles#1028
backnotprop merged 3 commits into
mainfrom
feat/resize-handler-ux

Conversation

@backnotprop

Copy link
Copy Markdown
Owner

What

Reworks the sidebar/panel resize-handle interaction across the plan editor and review editor, and adds host-facing seams to @plannotator/ui so the commercial Workspaces app can drive its own edge UX.

New UX (Plannotator, all handles)

  • No hover highlight on the track bar.
  • Cursor-following tooltip: "Click to close · Drag to resize".
  • Single click anywhere on the handle collapses the panel (drag still resizes).
  • Double-click reset is now unreachable (the single click collapses first).
  • Collapse chevron retained on hover.

New seams in @plannotator/ui (default-off, Plannotator opt-in)

  • useResizablePanel({ onClick, clickThreshold }) — the hook owns the pointer-capture drag state machine, so this is the only reliable way to distinguish a click from a drag-start. onClick fires on pointer-up only when travel stayed under clickThreshold (default 4px). Not fired on snap-close.
  • ResizeHandle props: hideHoverTrack, tooltip, trackClassName, plus a [data-resize-track] attribute (same host-CSS pattern as [data-collapse]).

Why

Workspaces is reworking sidebar-edge interactions (no hover reveal, tooltip, click-to-collapse). Two capabilities couldn't be done cleanly from the host side — targeting/suppressing the hardcoded hover track, and telling a click apart from a drag. Both now have seams; Workspaces builds its own tooltip and double-click removal on top.

Compatibility

  • New options/props are all optional and default to today's behavior. When nothing is passed, existing consumers are unchanged (the click-vs-commit branch is gated on onClick being present).
  • No version bump — that happens at release time.

Test

  • Plan editor + review editor dev servers: hover a divider (no highlight, tooltip follows cursor), single-click (collapses), drag (resizes), chevron on hover.
  • packages/ui typecheck + strict-consumer typecheck pass; ui test suite green (349 pass / 0 fail).

…e handles

Rework the sidebar/panel resize-handle interaction:

- useResizablePanel: new `onClick` option that fires on pointer-up only when
  the pointer never traveled past `clickThreshold` (4px default), so a genuine
  click on the handle can be told apart from a drag-start. Plannotator is
  unchanged unless `onClick` is passed.
- ResizeHandle: `hideHoverTrack` to suppress the hover color-change, a
  cursor-following `tooltip`, a `trackClassName` prop, and a
  `[data-resize-track]` attribute (mirrors `[data-collapse]`) so a host can
  restyle/suppress the hover reveal from plain CSS.
- Wire all plan-editor and review-editor handles to the new UX: no track
  highlight, cursor tooltip ("Click to close · Drag to resize"), single-click
  collapse (double-click reset becomes unreachable), chevron retained.
- README: document the new resize-handle host seams.
- Skip tooltip-position state updates while dragging (they were hidden anyway).
- Extract the repeated resize-handle tooltip string into a per-app constant
  (RESIZE_HANDLE_TOOLTIP) instead of 7 inline literals.
pointercancel fires when the browser aborts a gesture (palm rejection, system
gesture, focus loss). It was routed through the same onUp path as pointerup, so
a no-move cancel with onClick set would collapse the panel. Skip the onClick
branch on cancel — only clean up drag state (a real in-progress drag still
commits its width, matching prior behavior).
@backnotprop backnotprop merged commit f4f6bdb into main Jul 9, 2026
13 checks passed
backnotprop added a commit that referenced this pull request Jul 9, 2026
…OFF notes + version bump

The published 0.25.0 tarball predates the file-browser filtering
(1267cd5) and resize-handle click-to-collapse seams (f4f6bdb, #1028);
bump so those ship as 0.26.0.

Claude-Session: https://claude.ai/code/session_01SFy9fY27SA8g5BtotWPi1G
@backnotprop

Copy link
Copy Markdown
Owner Author

This is now released in version 0.23.0

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.

1 participant