Commit 21f2022
committed
fix(workflow): correct two regressions in the canvas perf pass
Gating `toolBlocks` on the picker's open state also emptied it for the
always-visible selected-tool chips, which silently fell through to their
`getBlock` fallback — the branch documented as the exception for types
hidden from the picker. Only `toolGroups`, where the expensive group build
lives, is gated now.
Re-invoking the find shortcut while the panel was already open stopped
re-selecting the query: `open()` is a no-op when the panel is mounted, so
the mount-time focus effect never re-ran. The panel publishes its focus
callback so the shortcut can drive it either way.
A saturated `slice` also allocated a fresh array once the limit covered a
whole group, re-rendering the memoized "All blocks" group on every tools
page-in — the frame cost the change set out to remove.
Alongside those: fold the two reconcilers into one generic and decide reuse
by identity rather than a three-write `changed` flag; record why the node
comparison is deliberately asymmetric (React Flow augments node objects in
place, so a symmetric `isEqual` would never reuse anything); give the
browse pagination its own constant instead of borrowing the search-result
cap; drop a redundant clamp and the deps it needed; inline the
single-consumer `sliceGroupsToLimit`; and split the bundled ref so the
hottest component stops allocating an object per render.1 parent 480294a commit 21f2022
7 files changed
Lines changed: 112 additions & 96 deletions
File tree
- apps/sim/app/workspace/[workspaceId]/w
- [workflowId]
- components
- connection-block-selector
- panel/components/editor/components/sub-block/components/tool-input
- search-replace
- utils
- components/sidebar/components/search-modal
Lines changed: 19 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
| |||
56 | 54 | | |
57 | 55 | | |
58 | 56 | | |
| 57 | + | |
59 | 58 | | |
60 | 59 | | |
61 | 60 | | |
| |||
65 | 64 | | |
66 | 65 | | |
67 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
| |||
151 | 155 | | |
152 | 156 | | |
153 | 157 | | |
154 | | - | |
| 158 | + | |
155 | 159 | | |
156 | 160 | | |
157 | 161 | | |
| |||
273 | 277 | | |
274 | 278 | | |
275 | 279 | | |
276 | | - | |
277 | | - | |
278 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
279 | 287 | | |
280 | 288 | | |
281 | 289 | | |
282 | 290 | | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
288 | 294 | | |
289 | 295 | | |
290 | 296 | | |
291 | 297 | | |
292 | 298 | | |
293 | 299 | | |
294 | | - | |
295 | 300 | | |
296 | 301 | | |
297 | 302 | | |
298 | 303 | | |
299 | | - | |
| 304 | + | |
300 | 305 | | |
301 | 306 | | |
302 | 307 | | |
| |||
307 | 312 | | |
308 | 313 | | |
309 | 314 | | |
310 | | - | |
| 315 | + | |
311 | 316 | | |
312 | 317 | | |
313 | 318 | | |
| |||
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
467 | 470 | | |
468 | 471 | | |
469 | 472 | | |
| |||
697 | 700 | | |
698 | 701 | | |
699 | 702 | | |
700 | | - | |
701 | 703 | | |
702 | 704 | | |
703 | 705 | | |
| |||
706 | 708 | | |
707 | 709 | | |
708 | 710 | | |
709 | | - | |
| 711 | + | |
710 | 712 | | |
711 | 713 | | |
712 | 714 | | |
| |||
1404 | 1406 | | |
1405 | 1407 | | |
1406 | 1408 | | |
1407 | | - | |
| 1409 | + | |
1408 | 1410 | | |
1409 | 1411 | | |
1410 | 1412 | | |
| |||
1708 | 1710 | | |
1709 | 1711 | | |
1710 | 1712 | | |
1711 | | - | |
| 1713 | + | |
1712 | 1714 | | |
1713 | 1715 | | |
1714 | 1716 | | |
| |||
Lines changed: 25 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
120 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
121 | 125 | | |
122 | 126 | | |
123 | 127 | | |
124 | | - | |
| 128 | + | |
125 | 129 | | |
126 | 130 | | |
127 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
128 | 137 | | |
129 | 138 | | |
130 | 139 | | |
| |||
180 | 189 | | |
181 | 190 | | |
182 | 191 | | |
183 | | - | |
184 | | - | |
| 192 | + | |
185 | 193 | | |
186 | 194 | | |
187 | 195 | | |
| |||
265 | 273 | | |
266 | 274 | | |
267 | 275 | | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
274 | 284 | | |
275 | | - | |
276 | | - | |
277 | | - | |
| 285 | + | |
| 286 | + | |
278 | 287 | | |
279 | 288 | | |
280 | 289 | | |
| |||
388 | 397 | | |
389 | 398 | | |
390 | 399 | | |
391 | | - | |
392 | | - | |
393 | 400 | | |
394 | 401 | | |
395 | 402 | | |
| |||
404 | 411 | | |
405 | 412 | | |
406 | 413 | | |
407 | | - | |
| 414 | + | |
408 | 415 | | |
409 | 416 | | |
410 | 417 | | |
| |||
Lines changed: 52 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
18 | 14 | | |
19 | 15 | | |
20 | 16 | | |
| |||
23 | 19 | | |
24 | 20 | | |
25 | 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 | + | |
26 | 55 | | |
27 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
28 | 60 | | |
29 | 61 | | |
30 | 62 | | |
31 | 63 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
44 | 70 | | |
45 | 71 | | |
46 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
47 | 76 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 77 | + | |
59 | 78 | | |
60 | 79 | | |
61 | 80 | | |
| |||
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4638 | 4638 | | |
4639 | 4639 | | |
4640 | 4640 | | |
| 4641 | + | |
| 4642 | + | |
| 4643 | + | |
| 4644 | + | |
4641 | 4645 | | |
4642 | | - | |
4643 | | - | |
4644 | 4646 | | |
4645 | 4647 | | |
4646 | | - | |
4647 | 4648 | | |
4648 | | - | |
4649 | | - | |
| 4649 | + | |
| 4650 | + | |
4650 | 4651 | | |
4651 | 4652 | | |
4652 | 4653 | | |
| |||
4777 | 4778 | | |
4778 | 4779 | | |
4779 | 4780 | | |
| 4781 | + | |
| 4782 | + | |
| 4783 | + | |
| 4784 | + | |
4780 | 4785 | | |
4781 | 4786 | | |
4782 | 4787 | | |
| |||
Lines changed: 0 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | 19 | | |
32 | 20 | | |
33 | 21 | | |
| |||
0 commit comments