Skip to content

Commit 86562c2

Browse files
vanceingallsclaude
andcommitted
docs(core): document legacy-id round-trip in clip-model readback (R1 review)
Addresses Rames' review on #1270: clarifies that a pre-R1 clip authored with id="my-title" round-trips as data-hf-id="my-title" (non-hf-shaped but stable, exact-match) by design — targeting uses exact [data-hf-id="…"] match and does not require the hf- shape; legacy values re-mint only at the R7 write-back. Not a bug. Comment-only. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
1 parent f391075 commit 86562c2

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎packages/core/src/parsers/htmlParser.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,13 @@ export function parseHtml(html: string): ParsedHtml {
193193
}
194194

195195
// R1: stable hf- id minted by ensureHfIds above; clips just read it.
196+
// Legacy/migration note: ensureHfIds pins a pre-existing `data-hf-id`, and
197+
// the generator emits `data-hf-id="${element.id}"`. So a clip authored
198+
// before R1 with `id="my-title"` round-trips as `data-hf-id="my-title"` —
199+
// a non-`hf-`-shaped but still stable, exact-match handle. This is the
200+
// intended migration: targeting uses exact `[data-hf-id="…"]` match (it does
201+
// not require the hf- shape), and legacy values are re-minted only once the
202+
// R7 write-back persists freshly-minted ids to source. Not a bug.
196203
const id = el.getAttribute("data-hf-id") || el.id || `element-${++idCounter}`;
197204
const name = getElementName(el);
198205
const zIndex = getZIndex(el);

0 commit comments

Comments
 (0)