Skip to content

fix(studio): disable the rotation field when the element can't be rotated#1412

Merged
miguel-heygen merged 1 commit into
heygen-com:mainfrom
calcarazgre646:fix/studio-rotation-field-disabled-guard
Jun 13, 2026
Merged

fix(studio): disable the rotation field when the element can't be rotated#1412
miguel-heygen merged 1 commit into
heygen-com:mainfrom
calcarazgre646:fix/studio-rotation-field-disabled-guard

Conversation

@calcarazgre646

Copy link
Copy Markdown
Contributor

Problem

In the PropertyPanel transform section, X/Y and W/H disable themselves when the element lacks the matching capability:

<MetricField label="X" disabled={manualOffsetEditingDisabled} ... />
<MetricField label="W" disabled={manualSizeEditingDisabled} ... />

The rotation field "R" had no disabled guard at all. So on an element where canApplyManualRotation is false (locked composition, script-generated, composition root/host), you could still type a rotation into the R field, even though that same capability already gates:

  • the rotate gesture (domEditOverlayStartGesture.ts:110), and
  • the overlay rotate button (DomEditOverlay.tsx:414).

Fix

Add manualRotationEditingDisabled = !element.capabilities.canApplyManualRotation and apply it to the R field, matching the sibling fields and the gesture/overlay gating.

Notes

  • Scope is the manual rotation field only. The rotation keyframe path below it (KeyframeNavigation) is a separate concern, already gated by STUDIO_KEYFRAMES_ENABLED && gsapAnimId.
  • No test added: the existing PropertyPanel.test.ts covers pure style helpers only; the X/Y/W/H disabled props have no render-test coverage either, and this mirrors them exactly.

…ated

The PropertyPanel transform fields X/Y and W/H disable themselves when the
element lacks the matching capability (`canApplyManualOffset` /
`canApplyManualSize`), but the rotation field "R" had no `disabled` guard. So
on an element where `canApplyManualRotation` is false (locked composition,
script-generated, composition root/host) you could still type a rotation into
the R field, even though the rotate gesture and the overlay rotate button are
both already gated by that same capability.

Add `manualRotationEditingDisabled` and apply it to the R field, matching the
sibling fields and the gesture/overlay gating.

@miguel-heygen miguel-heygen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed real bug — the R field was the only transform field in PropertyPanel without a disabled guard. The overlay rotation handle and gesture are already gated by canApplyManualRotation, so this was the only unguarded path.

Fix is correct and minimal: adds manualRotationEditingDisabled following the exact same pattern as manualOffsetEditingDisabled and manualSizeEditingDisabled.

@miguel-heygen miguel-heygen merged commit 3c56070 into heygen-com:main Jun 13, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants