The iframe height is synced explicitly, and two paths were missing it, so long
content ended up clipped inside the editor's own scroll area.
- restoring a local draft calls setContent with a whole article at once; the
iframe stayed at 520px while the body grew to 1410px, so only the first few
paragraphs appeared to survive the restore
- media inserts called insertContent directly without resyncing, and images
load asynchronously: the height was measured while the image was still 0px
tall, leaving the paragraphs below it cut off (measured: iframe 946 vs body
1006 with a single image after long text)
Fixes
- resync the height right after the restore's setContent, and add SetContent to
the events that already sync height and content
- resync after both media callbacks (picker and embed)
- add installHeightWatchers(): capture-phase load listener inside the iframe for
img / iframe / video / audio, plus a ResizeObserver on the body, so the height
follows assets that finish loading later
Tests cover the restore path and both media paths, including async loading.