Commit 3060daf
committed
fix(auto-align): handle MouseEvent leak + handle disconnected nodes
Auto-Align button bound onClick={onAutoAlign} leaked the MouseEvent as
the first positional arg into handleAutoAlign(customNodes?: Node[]).
Down the chain activeNodes.map() threw on MouseEvent and the error
was silently console.error()-ed inside the handler's try/catch —
outside, the click looked dead.
Fix: wrap onClick in () => onAutoAlign() so the event never lands as
a positional arg. Adds ELK options for separateConnectedComponents +
PREFER_EDGES strategy so disconnected adapter nodes land somewhere
reasonable instead of stacking on top of the main chain.
Tests: 1 new vitest pinning the zero-arg call site. Regression:
486/486 vitest green.1 parent 500e246 commit 3060daf
4 files changed
Lines changed: 99 additions & 48 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7293 | 7293 | | |
7294 | 7294 | | |
7295 | 7295 | | |
| 7296 | + | |
| 7297 | + | |
| 7298 | + | |
| 7299 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
808 | 809 | | |
809 | 810 | | |
810 | 811 | | |
811 | | - | |
812 | | - | |
813 | | - | |
814 | | - | |
| 812 | + | |
815 | 813 | | |
816 | 814 | | |
817 | | - | |
818 | | - | |
819 | | - | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
820 | 818 | | |
821 | 819 | | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | | - | |
828 | | - | |
829 | | - | |
830 | | - | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | | - | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
844 | | - | |
845 | | - | |
846 | | - | |
847 | | - | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | | - | |
856 | | - | |
857 | | - | |
858 | | - | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
859 | 829 | | |
860 | 830 | | |
861 | 831 | | |
| |||
988 | 958 | | |
989 | 959 | | |
990 | 960 | | |
| 961 | + | |
991 | 962 | | |
992 | 963 | | |
993 | 964 | | |
| |||
1043 | 1014 | | |
1044 | 1015 | | |
1045 | 1016 | | |
1046 | | - | |
| 1017 | + | |
1047 | 1018 | | |
1048 | 1019 | | |
1049 | 1020 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
| 285 | + | |
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| |||
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
488 | 535 | | |
489 | 536 | | |
490 | 537 | | |
491 | 538 | | |
492 | 539 | | |
493 | | - | |
494 | | - | |
| |||
| 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 | + | |
0 commit comments