Commit 9a621bc
fix(workflow): prevent canvas slowdown cascades (#6881)
* fix(workflow): prevent canvas slowdown cascades
* fix(workflow): make connection picker scrolling seamless
* 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.
---------
Co-authored-by: Waleed Latif <walif6@gmail.com>1 parent e3a4874 commit 9a621bc
8 files changed
Lines changed: 406 additions & 66 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
- stores/workflows/workflow
Lines changed: 59 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
4 | 12 | | |
5 | 13 | | |
6 | 14 | | |
| |||
45 | 53 | | |
46 | 54 | | |
47 | 55 | | |
| 56 | + | |
| 57 | + | |
48 | 58 | | |
49 | 59 | | |
50 | 60 | | |
| |||
54 | 64 | | |
55 | 65 | | |
56 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
57 | 72 | | |
58 | 73 | | |
59 | 74 | | |
| |||
136 | 151 | | |
137 | 152 | | |
138 | 153 | | |
| 154 | + | |
139 | 155 | | |
140 | 156 | | |
141 | 157 | | |
| 158 | + | |
142 | 159 | | |
143 | 160 | | |
144 | 161 | | |
| |||
260 | 277 | | |
261 | 278 | | |
262 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
263 | 316 | | |
264 | 317 | | |
265 | 318 | | |
| |||
480 | 533 | | |
481 | 534 | | |
482 | 535 | | |
483 | | - | |
| 536 | + | |
484 | 537 | | |
485 | 538 | | |
486 | 539 | | |
487 | | - | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
488 | 544 | | |
489 | 545 | | |
490 | 546 | | |
| |||
Lines changed: 6 additions & 1 deletion
| 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 | | |
| |||
1403 | 1406 | | |
1404 | 1407 | | |
1405 | 1408 | | |
| 1409 | + | |
1406 | 1410 | | |
1407 | 1411 | | |
1408 | 1412 | | |
| |||
1681 | 1685 | | |
1682 | 1686 | | |
1683 | 1687 | | |
| 1688 | + | |
1684 | 1689 | | |
1685 | 1690 | | |
1686 | 1691 | | |
| |||
1705 | 1710 | | |
1706 | 1711 | | |
1707 | 1712 | | |
1708 | | - | |
| 1713 | + | |
1709 | 1714 | | |
1710 | 1715 | | |
1711 | 1716 | | |
| |||
Lines changed: 43 additions & 40 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
113 | 137 | | |
114 | 138 | | |
115 | 139 | | |
| |||
143 | 167 | | |
144 | 168 | | |
145 | 169 | | |
146 | | - | |
147 | 170 | | |
148 | 171 | | |
149 | 172 | | |
150 | 173 | | |
151 | 174 | | |
152 | | - | |
153 | 175 | | |
154 | 176 | | |
155 | 177 | | |
156 | 178 | | |
157 | 179 | | |
158 | 180 | | |
159 | | - | |
160 | 181 | | |
161 | 182 | | |
162 | 183 | | |
163 | 184 | | |
164 | 185 | | |
165 | | - | |
166 | 186 | | |
167 | 187 | | |
168 | 188 | | |
169 | 189 | | |
170 | 190 | | |
171 | 191 | | |
172 | | - | |
173 | | - | |
| 192 | + | |
174 | 193 | | |
175 | | - | |
176 | | - | |
177 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
178 | 197 | | |
179 | 198 | | |
180 | 199 | | |
| |||
183 | 202 | | |
184 | 203 | | |
185 | 204 | | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | 205 | | |
200 | 206 | | |
201 | 207 | | |
| |||
267 | 273 | | |
268 | 274 | | |
269 | 275 | | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
274 | 287 | | |
275 | 288 | | |
276 | 289 | | |
| |||
288 | 301 | | |
289 | 302 | | |
290 | 303 | | |
291 | | - | |
| 304 | + | |
292 | 305 | | |
293 | 306 | | |
294 | 307 | | |
| |||
384 | 397 | | |
385 | 398 | | |
386 | 399 | | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | 400 | | |
396 | 401 | | |
397 | 402 | | |
| |||
406 | 411 | | |
407 | 412 | | |
408 | 413 | | |
409 | | - | |
| 414 | + | |
410 | 415 | | |
411 | 416 | | |
412 | 417 | | |
| |||
422 | 427 | | |
423 | 428 | | |
424 | 429 | | |
425 | | - | |
426 | | - | |
427 | | - | |
| 430 | + | |
428 | 431 | | |
429 | 432 | | |
430 | 433 | | |
| |||
0 commit comments