fix(studio): route rotation field edits through the animation like X/Y/W/H#1427
Open
calcarazgre646 wants to merge 2 commits into
Open
Conversation
…Y/W/H In the PropertyPanel transform section, typing into X/Y or W/H on a GSAP-animated element routes the value into the animation (via `onCommitAnimatedProperty`, or a new keyframe). `commitManualRotation` did not — it always went straight to `onSetManualRotation`, so typing a rotation on an animated element behaved differently from every other transform field, even though rotation is a supported animated property and both the rotate-drag gesture and the rotation keyframe button already route through the animation. Extract the shared animated-transform routing (animated property -> keyframe -> "no callbacks" toast) into `commitAnimatedTransformValue`, and have both `commitManualOffset` and `commitManualRotation` use it. Non-animated elements still fall through to the manual setter unchanged. `commitManualSize` keeps its own (keyframe-less) shape.
miguel-heygen
requested changes
Jun 14, 2026
miguel-heygen
left a comment
Collaborator
There was a problem hiding this comment.
Strengths:
PropertyPanel.tsx:164–183—commitAnimatedTransformValueis a clean extraction. The boolean return / early-return pattern reads clearly and the three callers (onCommitAnimatedProperty,onAddKeyframe,hasGsapAnimation-only toast) are correctly unified.- The bug is real.
commitManualOffsetalready routed through the animation;commitManualRotationsilently bypassed it."rotation"is already inSUPPORTED_PROPSand the drag gesture already routes throughonCommitAnimatedProperty, so this field was the one inconsistent path.
Blocker:
packages/studio/src/components/editor/PropertyPanel.tsx — 613 lines (max 600).
##[error]packages/studio/src/components/editor/PropertyPanel.tsx has 613 lines (max 600)
The File size check CI gate is failing. The refactor adds a net +27 lines, which pushed the file 13 lines over the limit. The fix logic is sound — the file just needs to shed those lines before merge.
Options:
- Move
commitAnimatedTransformValue(and possibly the existingcommitManualSizehelper) into a co-located util / hook (e.g.,usePropertyPanelCommit.ts). - Or trim equivalent lines elsewhere in the panel if there's dead weight.
Verdict: REQUEST CHANGES
Reasoning: One required CI gate failing (File size check). The bug fix and refactor are correct; the only issue is the file now exceeds the 600-line limit.
— Magi
Addresses review on heygen-com#1427: the inline `commitAnimatedTransformValue` extraction pushed PropertyPanel.tsx to 613 lines (over the 600 limit). Move the transform commit factory (`commitAnimatedTransformValue` + the X/Y, W/H and rotation handlers) into `propertyPanelTransformCommit.ts` and call it from the panel. PropertyPanel.tsx drops to 543 lines; behavior is unchanged. Co-authored-by: Miguel Ángel <miguel07alm@protonmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In the PropertyPanel transform section, typing into X/Y or W/H on a GSAP-animated element routes the value into the animation:
commitManualRotationdid not do this — it went straight toonSetManualRotation, so typing a rotation on an animated element behaved differently from every other transform field. Rotation is a supported animated property (SUPPORTED_PROPSincludes"rotation"), and both the rotate-drag gesture (tryGsapRotationIntercept) and the rotation keyframe button (onCommitAnimatedProperty(element, "rotation", ...)) already route through the animation — the panel field was the one path that bypassed it.Fix
Extract the shared animated-transform routing (animated property -> keyframe -> "no callbacks" toast) into
commitAnimatedTransformValue, and have bothcommitManualOffsetandcommitManualRotationgo through it. Non-animated elements still fall through to the manual setter unchanged.commitManualSizekeeps its own keyframe-less shape.Notes
PropertyPanel.test.tscovers pure helpers only, and the X/Y/W/H routing has no render-test coverage either; this mirrors them. Full studio suite stays green (796 passing).