Skip to content

FE-1541: Add a generic ResizeHandle and adopt it across the panels - #9429

Open
kube wants to merge 2 commits into
mainfrom
claude/fe-1541-resize-handle
Open

FE-1541: Add a generic ResizeHandle and adopt it across the panels#9429
kube wants to merge 2 commits into
mainfrom
claude/fe-1541-resize-handle

Conversation

@kube

@kube kube commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

🌟 What is the purpose of this PR?

One shared edge-resize implementation for the package. Adds the generic ResizeHandle primitive (a drag handle around the existing useResizeDrag, with min/max clamping and two visual appearances) and moves the package's two hand-rolled copies onto it. Bottom of the Notebook view stack, but independent of it: everything here is existing-UI refactoring plus one new component.

🔗 Related links

🔍 What does this change?

  • ui/resize/resize-handle.tsx: the primitive — edge (top/bottom/left/right), controlled size with min/max clamping, roving-tab-order-friendly (tabIndex={-1}), and an appearance prop: "hidden" tints the strip on hover, "line" shows a centred pill; both turn blue while resizing. It exposes data-resizing/data-resize-edge so ancestors can style themselves against an active drag with :has().
  • GlassPanel drops its inline handle (styles, positioning switch, drag wiring) and renders the primitive; its dragged-edge border highlight now derives from the handle's data attributes via :has(). The LeftSideBar, PropertiesPanel, and BottomPanel ride this unchanged.
  • The AI assistant panel drops its hand-rolled pointer-drag path for the primitive with the line appearance, keeping its hover-pill affordance. Its shell already clamps to the viewport in CSS, so a static maxSize replaces the per-drag window-width computation.
  • A layer declaration for ui/resize in the architecture docs.

Net −162 lines: three implementations become one.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing
    • behaviour-preserving refactor of unreleased-alongside code; the Notebook stack above carries the release changeset

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

🛡 What tests cover this?

No unit tests — the primitive is DOM-drag behaviour. Verified by driving the browser: all three GlassPanel-backed panels resize with the dragged-edge highlight reacting, and the AI panel resizes with exact pixel deltas through its new handle.

❓ How to test this?

  1. yarn workspace @hashintel/petrinaut storybook
  2. In any editor story, drag the sidebar, properties, and bottom panel edges — the panel border should highlight while dragging.
  3. In the WithAiAssistant story, open the assistant and drag its left edge — a pill line shows on hover and while resizing.

A reusable drag handle around the existing useResizeDrag hook, for
resizing a positioned ancestor from any edge with min/max clamping,
and a layer declaration for the resize folder.
@kube kube self-assigned this Aug 29, 2026
@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview Aug 29, 2026 2:18pm
petrinaut Ready Ready Preview Aug 29, 2026 2:18pm
petrinaut-docs Ready Ready Preview Aug 29, 2026 2:18pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview Aug 29, 2026 2:18pm

Request Review

@cursor

cursor Bot commented Aug 29, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Behavior-preserving UI refactor in unreleased petrinaut panels; no auth, data, or API surface changes.

Overview
Introduces a shared ResizeHandle primitive (built on useResizeDrag) with edge selection, min/max clamping, hidden vs line appearances, and data-resizing / data-resize-edge for parent styling.

GlassPanel drops its inline handle, drag wiring, and CVA-based border variants; it renders ResizeHandle and highlights the dragged edge via :has() on those data attributes. Sidebar, properties, and bottom panels inherit this path unchanged.

The AI assistant replaces a custom pointer-drag resize with ResizeHandle (appearance="line") on a zero-width anchor so the handle sits on the card’s left border; width limits use static 320–720 instead of per-drag viewport math (the shell already caps width in CSS).

Adds a ui.resize layer note on use-resize-drag. Net consolidation of three resize implementations into one.

Reviewed by Cursor Bugbot for commit f9fc0f5. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3d3e245. Configure here.

GlassPanel drops its inline copy of the handle: the primitive renders
it, and the panel's dragged-edge border highlight now derives from the
handle's data-resizing/data-resize-edge attributes via :has(), so the
three editor panels ride the shared implementation unchanged.

The AI assistant panel drops its hand-rolled pointer-drag path for the
same primitive with the new line appearance — a centred pill that shows
on hover and turns blue while resizing. Its shell already clamps to the
viewport in CSS, so the static maxSize replaces the per-drag
window-width computation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

1 participant