Skip to content

feat(studio): Timing inspector section + fix mixed-content text editing#893

Closed
miguel-heygen wants to merge 2 commits into
perf/studio-preview-reloadfrom
feat/studio-copy-paste
Closed

feat(studio): Timing inspector section + fix mixed-content text editing#893
miguel-heygen wants to merge 2 commits into
perf/studio-preview-reloadfrom
feat/studio-copy-paste

Conversation

@miguel-heygen
Copy link
Copy Markdown
Collaborator

Summary

Stacked on #892.

  • Timing section: Adds Start, End, and Duration fields to the Design panel when the selected element has data-start/data-duration attributes. Editing End adjusts duration accordingly. Uses the attribute patch pipeline.
  • Mixed-content text fix: collectDomEditTextFields now captures bare text nodes alongside child elements. Previously, selecting an element like If you're <span>turning 65</span> soon... and changing the font destroyed the surrounding text because only the <span> was serialized. Now all text nodes are preserved during serialization.

Test plan

  • Build passes, all 42 domEditing tests pass, lint clean
  • Manual: select .headline with mixed content, change font — full text preserved
  • Manual: Timing section shows Start/End/Duration for timed elements

Adds Start, End, and Duration fields to the Design panel when the
selected element has data-start/data-duration attributes. Editing
any field commits via the attribute patch pipeline (same as timeline
edits) and refreshes the preview. End is computed from start+duration
and writing End adjusts duration accordingly.
collectDomEditTextFields only captured child HTML elements, ignoring
bare text nodes. For elements like:
  <div class="headline">If you're <span>turning 65</span> soon...</div>
only the <span> was collected as a text field. When commitDomTextFields
serialized back, "If you're " and " soon..." were lost.

Now walks childNodes and creates text-node fields for bare text nodes
alongside child element fields. serializeDomEditTextFields emits bare
text for text-node fields, preserving the complete mixed content.
@miguel-heygen
Copy link
Copy Markdown
Collaborator Author

Moving to Graphite stack

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.

1 participant