You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A package widget that finishes drawing inside a sizeObserver callback causes a ResizeObserver loop error at page load #6147
A package widget that finishes its first drawing inside a sizeObserver delivery raises a "ResizeObserver loop completed with undelivered notifications" error at page load, and the render gate and browser tests count that as a page fault. When the widget's pending-task settles in that delivery, settle resumes in the delivery's microtask checkpoint. startPage then presents the page there: the body's stamps, the margin and the details shelf resize boxes shallower than the one just delivered. Drawing in a size callback is a common widget pattern, and nothing in the package contract tells an author to avoid it.
This is how the chart pages failed in #5708. #5743 fixed it inside the chart: its drawing now settles at Leaf's next rendering pass (lf-chart.js). The heat-loss, alert-review and live-progress cases have passed on Linux and macOS in every scheduled run since. Any other widget still hits the same loop.
The fix belongs in core: one hop in settle after await presented(), before the caller lays out the page, which would also remove the chart's own hop. An earlier run on #5708 removed the chart's hop and tried two hops in core. Each conflicts with a contract in browser/runtime/rendering.js:
setTimeout: the same four tests pass. But the readiness reading can't see work held in a timer. test_revision_patches.py::test_a_revision_releases_the_served_markup_it_removes[selection] failed with this hop and passed without it, one run each.
A hop that holds holdRendering() across a task boundary would probably meet both contracts, but it changes how page readiness is counted. That is the decision this issue needs: should page readiness count a held task hop after widget settlement, or should the package contract tell authors to settle outside size deliveries and keep the chart's local hop as the pattern?
Assigned to @max-sixty for that decision. #5751 covers a different loop, a redraw inside a scrolling box.
Decision: settle this in the package contract, not in core. Add the reason to module-authoring.md's "Scheduling paints": a widget draws from frameFor, never inside a sizeObserver delivery, because a drawing that settles there makes the browser report a ResizeObserver loop at page load, which the render gate counts as a fault. Each widget keeps its own deferral, as lf-chart, lf-diagram and lf-shot do, and page readiness stays as it is.
This was written by Claude Code on behalf of max-sixty
Activity
max-sixty commentedon Nov 18, 2026
Decision: settle this in the package contract, not in core. Add the reason to
module-authoring.md's "Scheduling paints": a widget draws fromframeFor, never inside asizeObserverdelivery, because a drawing that settles there makes the browser report a ResizeObserver loop at page load, which the render gate counts as a fault. Each widget keeps its own deferral, as lf-chart, lf-diagram and lf-shot do, and page readiness stays as it is.leaf-agent commentedon Nov 18, 2026
Opened #6349, which adds that rule and its reason to the Scheduling paints section.