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.
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.