From c596e17a40e4abaa621bf0ad05dcac20a1ae78eb Mon Sep 17 00:00:00 2001 From: claude_code Date: Sun, 21 Jun 2026 03:50:17 +0300 Subject: [PATCH] fix(html-embed): correct stale iframe height and damp the resize loop Address the non-test code-review findings on the htmlEmbed sandbox change (test-coverage gaps are tracked in issue #99): - html-embed-view: track the iframe's reported content height even while a fixed height is set, so clearing the height (fixed -> auto) without editing the source no longer leaves the frame pinned to the stale value. Derive the fixed-height predicate once; seed autoHeight to the default. - html-embed-view: drop width/border from the iframe inline style (the .htmlEmbedFrame CSS class already provides them). - html-embed-sandbox: coalesce height reports via requestAnimationFrame and skip <=1px deltas to damp the self-measure feedback loop; fix the misleading bootstrap comment. - tracker-settings: add an aria-label to the snippet Textarea (a11y). - CHANGELOG: note the removal of server-side role-based HTML-embed stripping. --- CHANGELOG.md | 5 ++++ .../html-embed/html-embed-sandbox.ts | 28 +++++++++++++++-- .../components/html-embed/html-embed-view.tsx | 30 +++++++++---------- .../settings/components/tracker-settings.tsx | 1 + 4 files changed, 46 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80d6ec51..cda50f68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 when the workspace HTML-embed toggle is on, can be inserted by any member (previously admin-only). Turning the toggle off hides existing embeds and stops serving them on public share pages. +- Remove the server-side role-based stripping of HTML-embed blocks from the + write paths (collab/REST/MCP, page create/duplicate, import, transclusion + unsync); sandboxing makes per-write gating unnecessary. The only remaining + server-side strip is the public-share read path, which still honors the + workspace HTML-embed toggle. ## [0.91.0] - 2026-06-18 diff --git a/apps/client/src/features/editor/components/html-embed/html-embed-sandbox.ts b/apps/client/src/features/editor/components/html-embed/html-embed-sandbox.ts index 983269f9..d4ea79f4 100644 --- a/apps/client/src/features/editor/components/html-embed/html-embed-sandbox.ts +++ b/apps/client/src/features/editor/components/html-embed/html-embed-sandbox.ts @@ -22,20 +22,42 @@ export function buildSandboxSrcdoc(source: string): string { const bootstrap = ` ")}