Commit 4befe38
committed
refactor(ui): derive three values instead of storing or memoizing them
- import-modal: browserId and profileId were state corrected by two effects
when a reload dropped the selection. That commits and paints one frame in
which the profile still belongs to the previously selected browser — and
Import is enabled during it, submitting via a `profiles.find` that searches
every browser's profiles. Both now fall back during render, and `selected`
searches only the current browser's profiles. Covered by the existing
'never leaves a profile selected that belongs to another browser' test.
- workflow.tsx: isWorkflowEmpty was a second useMemo over the same [blocks]
dep computing exactly !hasBlocks, allocating its own Object.keys array.
Both feed primitives, so neither memo bought identity stability.
- thinking-loader: an effect seeding cycleVariant whenever variant is defined,
which `shown = variant ?? cycleVariant` can never read. On the one
transition where cycleVariant becomes visible (variant going undefined) the
cycling effect assigns it in every branch — settle, reduced-motion, and
tick — in the same flush, so the seed was never observable.1 parent 9cd4bbf commit 4befe38
3 files changed
Lines changed: 20 additions & 26 deletions
File tree
- apps/sim
- app/workspace/[workspaceId]
- settings/components/browser/components/import-modal
- w/[workflowId]
- components/ui
Lines changed: 19 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
43 | 53 | | |
44 | 54 | | |
45 | 55 | | |
46 | 56 | | |
47 | 57 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 58 | + | |
57 | 59 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
577 | | - | |
| 577 | + | |
578 | 578 | | |
579 | 579 | | |
580 | 580 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | 323 | | |
330 | 324 | | |
331 | 325 | | |
| |||
0 commit comments