Commit bcc0c29
fix(studio): harden keyframe drag commit (review follow-ups)
- pickKeyframeTween no longer falls back to ALL animations on a selector
mismatch — it only picks among the dragged element's own tweens, so a
class/compound-selector mismatch can't edit a different element. No
match → no-op.
- computeKeyframeMovePlan bails to a no-op when a keyframe-array tween's
dragged keyframe can't be located (stale cache / precision drift) instead
of falling through to an end-point resize that silently rescaled the
whole tween and re-timed every keyframe.
- usePopulateKeyframeCacheForFile clipPct now uses 0.001% precision
(matching useGsapAnimationsForElement) so beat-snapped keyframes from the
file-wide cache also center on the dot and the two caches agree.
- The optimistic drag hold only releases once the cache reflects the
committed position (a keyframe near the held %), so an unrelated cache
rebuild no longer flashes the diamond back to its old spot.
- A drag's document listeners are cleaned up on unmount, so an unmount
mid-drag (clip delete / comp switch / zoom-out) no longer leaks them.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Miguel Ángel <miguel07alm@protonmail.com>1 parent 1cd55e6 commit bcc0c29
4 files changed
Lines changed: 56 additions & 6 deletions
File tree
- packages/studio/src
- components/editor
- hooks
- player/components
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
| |||
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
88 | 101 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
119 | 121 | | |
120 | 122 | | |
121 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
122 | 129 | | |
123 | 130 | | |
124 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
386 | 389 | | |
387 | 390 | | |
388 | | - | |
| 391 | + | |
389 | 392 | | |
390 | 393 | | |
391 | 394 | | |
| |||
Lines changed: 28 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
73 | 85 | | |
| 86 | + | |
74 | 87 | | |
75 | 88 | | |
76 | 89 | | |
77 | 90 | | |
78 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
79 | 98 | | |
80 | 99 | | |
81 | 100 | | |
| |||
119 | 138 | | |
120 | 139 | | |
121 | 140 | | |
| 141 | + | |
122 | 142 | | |
123 | 143 | | |
124 | 144 | | |
125 | 145 | | |
126 | 146 | | |
127 | 147 | | |
128 | 148 | | |
| 149 | + | |
129 | 150 | | |
130 | 151 | | |
131 | 152 | | |
132 | 153 | | |
| 154 | + | |
133 | 155 | | |
134 | 156 | | |
135 | 157 | | |
| |||
138 | 160 | | |
139 | 161 | | |
140 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
141 | 168 | | |
142 | 169 | | |
143 | 170 | | |
| |||
0 commit comments