Skip to content

Post content height to parent when embedded#3

Draft
PavelMakarchuk wants to merge 1 commit intomasterfrom
iframe-height-postmessage
Draft

Post content height to parent when embedded#3
PavelMakarchuk wants to merge 1 commit intomasterfrom
iframe-height-postmessage

Conversation

@PavelMakarchuk
Copy link

Summary

  • When ?embed is present, uses ResizeObserver to post the root element's scrollHeight to the parent window via postMessage
  • Message format: { type: 'policyengine-model-height', height: number }
  • Enables policyengine-app-v2 to dynamically size the iframe so the footer only appears at the bottom of the page

Related

Test plan

  • Open the model page standalone — no postMessage behavior (not embedded)
  • Embed via policyengine-app-v2 /us/model — iframe resizes to content height, footer at bottom

🤖 Generated with Claude Code

Uses ResizeObserver to send scrollHeight via postMessage when
the ?embed param is present, enabling the parent iframe to
resize dynamically so the footer only appears at the bottom.

Closes #2

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Feb 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
policyengine-model Ready Ready Preview, Comment Feb 17, 2026 9:08pm

Request Review

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.

Post content height to parent when embedded via iframe

1 participant