Skip to content

fix: producer inlining should add data-hf-authored-root-id to host element #969

@miguel-heygen

Description

@miguel-heygen

Context

When the producer path inlines a sub-composition (inlineSubCompositions.ts:307), it takes innerRoot.innerHTML when compId matches, stripping the wrapper div and its id attribute. The CSS/GSAP scoping layer rewrites #ID selectors to [data-hf-authored-root-id=ID], but no element in the producer output has that attribute.

The bundler path preserves it via flattenInnerRoot + data-hf-inner-root.

Fix

In the producer inlining path, when the inner root has an id attribute, add data-hf-authored-root-id to the host element (or to a generated wrapper) so that rewritten #ID selectors resolve in both preview and render.

Tracking

Divergence documented in PR #965 with characterization tests in inlineSubCompositions.test.ts.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions