Skip to content

Auto-resize model iframe via postMessage#807

Closed
MaxGhenis wants to merge 1 commit intomainfrom
model-iframe-autoresize
Closed

Auto-resize model iframe via postMessage#807
MaxGhenis wants to merge 1 commit intomainfrom
model-iframe-autoresize

Conversation

@MaxGhenis
Copy link
Contributor

Summary

  • The embedded policyengine-model content is ~6830px tall but the iframe was hardcoded to 4000px, clipping the Data pipeline and Behavioral responses sections
  • Now the model app posts its scrollHeight via postMessage using a ResizeObserver, and the parent iframe listens and auto-resizes
  • Minimum height stays at 4000px as a fallback

Test plan

  • Visit /us/model — all 4 sections visible (microsim walkthrough, rules coverage, data pipeline, behavioral responses)
  • Visit /uk/model — UK content renders, behavioral → behavioural spelling
  • No resize loops or flickering

🤖 Generated with Claude Code

The embed content (~6830px) was clipped by the 4000px hardcoded iframe
height, hiding the Data pipeline and Behavioral responses sections.
Now listens for height messages from the embedded policyengine-model app.

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

vercel bot commented Mar 9, 2026

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

Project Deployment Actions Updated (UTC)
policyengine-app-v2 Ready Ready Preview, Comment Mar 9, 2026 8:41pm
policyengine-calculator Ready Ready Preview, Comment Mar 9, 2026 8:41pm

Request Review

@MaxGhenis
Copy link
Contributor Author

Superseded by #808 which uses a Vercel rewrite instead of iframe auto-resize

@MaxGhenis MaxGhenis closed this Mar 9, 2026
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.

1 participant