Commit 25bad2e
authored
Improvements to IO Node Ghosts & Quick-Place (#1440)
## Description
<!-- Please provide a brief description of the changes made in this pull request. Include any relevant context or reasoning for the changes. -->
IO Ghost nodes now:
- Measure their own size and position themselves correctly (instead of working with an assumed default)
- End up in the same position when placed
- Have the connection line drawn to their handle, not the top of the node
- No longer append "Input" or "Output" to the name when placed
To enable this a custom connection line component was added. This component renders for all in-progress connections, except when a GhostNode is active. This is used in conjunction with a GhostEdge to draw the line to the ghost node's handle instead of the cursor.
Additionally, Edges:
- The default drawn edge is now similar in style to our placed edges (i.e. thicker)
- Now color a slight green whilst drawn when valid (e.g. task -> task)
- Now color a slight red whilst drawn when invalid (e.g. input -> output)
- Now color a dashed blue whilst drawn when placing a ghost Input
- Now color a dashed purple whilst drawn when placing a ghost Output
Finally, some additional code improvements were made to the Ghost Node logic. e.g. consolidating refs and removing and expensive `nodes.find` statement.
Note: due to our existing connection architecture the IO Node handles cannot have ids, but for the ghost node connections they need an id. Hence, there is a ternary to separate the two cases. In future we should revise (e.g. as per node manager stack) and all handles should have ids.
## Related Issue and Pull requests
<!-- Link to any related issues using the format #<issue-number> -->
## Type of Change
<!-- Please delete options that are not relevant -->
- [x] Bug fix
- [x] Improvement
## Checklist
<!-- Please ensure the following are completed before submitting the PR -->
- [ ] I have tested this does not break current pipelines / runs functionality
- [ ] I have tested the changes on staging
## Screenshots (if applicable)
<!-- Include any screenshots that might help explain the changes or provide visual context -->
## Test Instructions
<!-- Detail steps and prerequisites for testing the changes in this PR -->
Confirm that edges can still be drawn as expected
Confirm that ghost nodes position and move and behave as expected
Confirm that ghost nodes place in the same location as they were when dropped
Confirm that drawing a connection goes green when valid and red when invalid
## Additional Comments
<!-- Add any additional context or information that reviewers might need to know regarding this PR -->1 parent 4e580c1 commit 25bad2e
9 files changed
+240
-75
lines changedLines changed: 99 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | | - | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
Lines changed: 42 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | | - | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
59 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
60 | 65 | | |
61 | 66 | | |
62 | 67 | | |
| |||
134 | 139 | | |
135 | 140 | | |
136 | 141 | | |
137 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
138 | 145 | | |
| 146 | + | |
139 | 147 | | |
140 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
141 | 152 | | |
142 | 153 | | |
143 | 154 | | |
| |||
150 | 161 | | |
151 | 162 | | |
152 | 163 | | |
153 | | - | |
154 | | - | |
| 164 | + | |
155 | 165 | | |
156 | 166 | | |
157 | 167 | | |
| |||
263 | 273 | | |
264 | 274 | | |
265 | 275 | | |
266 | | - | |
| 276 | + | |
267 | 277 | | |
268 | 278 | | |
269 | 279 | | |
270 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
271 | 292 | | |
272 | 293 | | |
273 | 294 | | |
| |||
278 | 299 | | |
279 | 300 | | |
280 | 301 | | |
281 | | - | |
282 | | - | |
| 302 | + | |
283 | 303 | | |
284 | 304 | | |
285 | 305 | | |
| |||
392 | 412 | | |
393 | 413 | | |
394 | 414 | | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
402 | 424 | | |
403 | 425 | | |
404 | 426 | | |
405 | 427 | | |
406 | | - | |
| 428 | + | |
407 | 429 | | |
408 | | - | |
409 | 430 | | |
| 431 | + | |
410 | 432 | | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | 433 | | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
| 434 | + | |
421 | 435 | | |
422 | 436 | | |
423 | 437 | | |
| |||
470 | 484 | | |
471 | 485 | | |
472 | 486 | | |
473 | | - | |
| 487 | + | |
474 | 488 | | |
475 | 489 | | |
476 | 490 | | |
| |||
948 | 962 | | |
949 | 963 | | |
950 | 964 | | |
951 | | - | |
952 | | - | |
953 | 965 | | |
954 | 966 | | |
955 | 967 | | |
| |||
1083 | 1095 | | |
1084 | 1096 | | |
1085 | 1097 | | |
| 1098 | + | |
1086 | 1099 | | |
1087 | 1100 | | |
1088 | 1101 | | |
| |||
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
0 commit comments