-
Notifications
You must be signed in to change notification settings - Fork 452
allow Vue nodes to be resized from all 4 corners #6187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
e983786
cfe0676
78b3ef4
4e1168f
1a6171e
b3fcf8a
68255c9
fc4a43d
b54e919
27222a0
feda4d9
320ede5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -150,7 +150,6 @@ import { | |
| } from '@/utils/graphTraversalUtil' | ||
| import { cn } from '@/utils/tailwindUtil' | ||
|
|
||
| import { cornerResizeHandles } from '../interactions/resize/resizeHandlePresets' | ||
| import type { ResizeHandleDirection } from '../interactions/resize/resizeMath' | ||
| import { useNodeResize } from '../interactions/resize/useNodeResize' | ||
| import { calculateIntrinsicSize } from '../utils/calculateIntrinsicSize' | ||
|
|
@@ -295,6 +294,33 @@ const baseResizeHandleClasses = | |
| 'absolute h-3 w-3 opacity-0 pointer-events-auto focus-visible:outline focus-visible:outline-2 focus-visible:outline-white/40' | ||
| const POSITION_EPSILON = 0.01 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [quality] low Priority Issue: Magic number POSITION_EPSILON without explanation
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Skipping - unclear rationale for the threshold |
||
|
|
||
| const cornerResizeHandles = [ | ||
| { | ||
| id: 'se', | ||
| direction: { horizontal: 'right', vertical: 'bottom' } as const, | ||
| classes: 'right-0 bottom-0 cursor-se-resize' | ||
| }, | ||
| { | ||
| id: 'ne', | ||
| direction: { horizontal: 'right', vertical: 'top' } as const, | ||
| classes: 'right-0 top-0 cursor-ne-resize' | ||
| }, | ||
| { | ||
| id: 'sw', | ||
| direction: { horizontal: 'left', vertical: 'bottom' } as const, | ||
| classes: 'left-0 bottom-0 cursor-sw-resize' | ||
| }, | ||
| { | ||
| id: 'nw', | ||
| direction: { horizontal: 'left', vertical: 'top' } as const, | ||
| classes: 'left-0 top-0 cursor-nw-resize' | ||
| } | ||
| ] satisfies Array<{ | ||
| id: string | ||
| direction: ResizeHandleDirection | ||
| classes: string | ||
| }> | ||
christian-byrne marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| const { startResize } = useNodeResize( | ||
| (result, element) => { | ||
| if (isCollapsed.value) return | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[performance] low Priority
Issue: Resize handles always rendered but invisible by default
Context: All 4 handles are rendered in DOM with opacity-0, which creates unnecessary DOM nodes
Suggestion: Consider using v-show or CSS-only hover reveal to avoid DOM overhead when not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://tailwindcss.com/docs/hover-focus-and-other-states#styling-based-on-parent-state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented in 68255c9 (removed in feda4d9 to keep handles invisible)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed (handles remain invisible with cursor-only indication)