-
Notifications
You must be signed in to change notification settings - Fork 376
feat(vue-nodes): snap link preview; connect on drop #5780
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
Open
benceruleanlu
wants to merge
65
commits into
main
Choose a base branch
from
bl-snap
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 62 commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
9a18d37
Add dragging test
benceruleanlu 939cbe0
Litegraph? Never heard if it
benceruleanlu e3e1d2e
Add more test cases
benceruleanlu 5c6c21c
Update test expectations [skip ci]
invalid-email-address f624940
Merge branch 'bl-tests' into bl-more-slots
benceruleanlu 48f5087
More test cases v1
benceruleanlu 369da53
review comments
benceruleanlu 22a1c61
Merge remote-tracking branch 'origin/bl-tests' into bl-more-slots
benceruleanlu 70651dc
Allow moving links and support reroutes
benceruleanlu c227d60
Add dragging input to input drags existing link test
benceruleanlu 9d668a1
Merge remote-tracking branch 'origin/main' into bl-more-slots
benceruleanlu b99d70d
nit
benceruleanlu 19c538c
Support dragging from output to output
benceruleanlu 263b280
Add snapshot
benceruleanlu bef712e
o-o shift test
benceruleanlu e7f0ee4
Update test expectation
benceruleanlu 20d136d
Switch to adapter approach
benceruleanlu 3f4a806
clean up onPointerDown
benceruleanlu e136b89
Add reroute anchor tests
benceruleanlu 6685e00
Fix double links
benceruleanlu 0aa971b
Merge remote-tracking branch 'origin/main' into bl-more-slots
benceruleanlu 9d32b4c
temp screenshots
benceruleanlu e879bd5
improve typing
benceruleanlu f348902
nit
benceruleanlu d780296
cleanup unused
benceruleanlu 8eec7fb
huh?
benceruleanlu f99d8c1
I am the one who knocks
benceruleanlu 65ec322
Those who type
benceruleanlu a2be36a
fix bad fallback and remove logging
benceruleanlu 88cd60f
nit
benceruleanlu 381d97a
nit
benceruleanlu e9ffce4
nit
benceruleanlu 99aaa4e
Merge remote-tracking branch 'origin/main' into bl-more-slots
benceruleanlu 57810b9
nit
benceruleanlu 9b39835
refactor linkInteraction.spec.ts
benceruleanlu c050115
those who know
benceruleanlu 839d8a5
sure
benceruleanlu 4f6eaea
get nodeid and slotkey
benceruleanlu 76c718e
Visually snap to node
benceruleanlu 0f46452
Remove debug logging
benceruleanlu 23f3e17
Try connecting to snapped first
benceruleanlu 0627a71
those who know cont
benceruleanlu 1ca3d75
nit
benceruleanlu ecc5bed
type
benceruleanlu 0e33672
Merge remote-tracking branch 'origin/bl-more-slots' into bl-snap
benceruleanlu 9de27ad
fix stale
benceruleanlu 18b4f56
refactor candidatefromnodetarget
benceruleanlu 4b95ef9
Implement caching and rAF
benceruleanlu 8da5ae3
Add tests
benceruleanlu 247e395
knip
benceruleanlu 1c11dcc
Merge remote-tracking branch 'origin/main' into bl-more-slots
benceruleanlu f13a45c
Merge remote-tracking branch 'origin/main' into bl-more-slots
benceruleanlu 21cc208
Merge remote-tracking branch 'origin/main' into bl-more-slots
benceruleanlu 066a755
Update test expectations [skip ci]
invalid-email-address 5e3c91f
Merge remote-tracking branch 'origin/bl-more-slots' into bl-snap
benceruleanlu a71b99d
Update test expectations [skip ci]
invalid-email-address d5a5621
Merge remote-tracking branch 'origin/main' into bl-snap
benceruleanlu d18a604
Merge remote-tracking branch 'origin/main' into bl-snap
benceruleanlu 87e410d
Remove duplicated playwright snapshots
benceruleanlu 35bc2f9
Update test expectations [skip ci]
invalid-email-address aed6a4e
ci sanity check
benceruleanlu 768b6e5
Align links to slots in subgraphs (#5876)
benceruleanlu 4d7c0d7
Merge origin/main into bl-snap: resolve conflicts
benceruleanlu d1f2734
[automated] Update test expectations
invalid-email-address 4c985f7
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+33 Bytes
(100%)
...nkInteraction.spec.ts-snapshots/vue-node-input-drag-ctrl-alt-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+52 Bytes
(100%)
...eraction.spec.ts-snapshots/vue-node-input-drag-reuses-origin-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+38 Bytes
(100%)
...inkInteraction.spec.ts-snapshots/vue-node-reroute-input-drag-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+31 Bytes
(100%)
...raction.spec.ts-snapshots/vue-node-reroute-output-shift-drag-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+36 Bytes
(100%)
...teraction.spec.ts-snapshots/vue-node-shift-output-multi-link-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+49.2 KB
...inks/linkInteraction.spec.ts-snapshots/vue-node-snap-to-node-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+48.2 KB
...inks/linkInteraction.spec.ts-snapshots/vue-node-snap-to-slot-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-53.5 KB
...des/linkInteraction.spec.ts-snapshots/vue-node-dragging-link-chromium-linux.png
Binary file not shown.
Binary file removed
BIN
-50.8 KB
...nkInteraction.spec.ts-snapshots/vue-node-input-drag-ctrl-alt-chromium-linux.png
Binary file not shown.
Binary file removed
BIN
-51.4 KB
...eraction.spec.ts-snapshots/vue-node-input-drag-reuses-origin-chromium-linux.png
Binary file not shown.
Binary file removed
BIN
-52.8 KB
...inkInteraction.spec.ts-snapshots/vue-node-reroute-input-drag-chromium-linux.png
Binary file not shown.
Binary file removed
BIN
-55.3 KB
...raction.spec.ts-snapshots/vue-node-reroute-output-shift-drag-chromium-linux.png
Binary file not shown.
Binary file removed
BIN
-53.3 KB
...teraction.spec.ts-snapshots/vue-node-shift-output-multi-link-chromium-linux.png
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/renderer/extensions/vueNodes/composables/slotLinkDragSession.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import type { SlotLayout } from '@/renderer/core/layout/types' | ||
|
||
interface PendingMoveData { | ||
clientX: number | ||
clientY: number | ||
target: EventTarget | null | ||
} | ||
|
||
interface SlotLinkDragSession { | ||
compatCache: Map<string, boolean> | ||
nodePreferred: Map< | ||
number, | ||
{ index: number; key: string; layout: SlotLayout } | null | ||
> | ||
lastHoverSlotKey: string | null | ||
lastHoverNodeId: number | null | ||
lastCandidateKey: string | null | ||
pendingMove: PendingMoveData | null | ||
reset: () => void | ||
dispose: () => void | ||
} | ||
|
||
export function createSlotLinkDragSession(): SlotLinkDragSession { | ||
const state: SlotLinkDragSession = { | ||
compatCache: new Map(), | ||
nodePreferred: new Map(), | ||
lastHoverSlotKey: null, | ||
lastHoverNodeId: null, | ||
lastCandidateKey: null, | ||
pendingMove: null, | ||
reset: () => { | ||
state.compatCache = new Map() | ||
state.nodePreferred = new Map() | ||
state.lastHoverSlotKey = null | ||
state.lastHoverNodeId = null | ||
state.lastCandidateKey = null | ||
state.pendingMove = null | ||
}, | ||
dispose: () => { | ||
state.reset() | ||
} | ||
} | ||
|
||
return state | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why would this persist and be reset instead of just being dropped and garbage collected?
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.
I think it's because it will be alive for the lifetime of the composable
it's called as const dragSession = createSlotLinkDragSession()