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
setupSizeChangedNotifications reports size before content is ready, causing widgets to collapse #143
Describe the bug
The setupSizeChangedNotifications() method measures and reports size immediately when connect() completes. For widgets with async content (maps, data fetches, etc.), this captures the loading state dimensions rather than the final rendered size.
if (this.options?.autoResize) {
this.setupSizeChangedNotifications(); //
Called immediately after connect
}
To Reproduce
Connect https://open-sky-mcp.kontakt-e7d.workers.dev/mcp (repo) to MCPJam and observe. More context in this thread
Notes
From what I notice (but i could be wrong):
Widget connects → shows "Waiting for flight data..." spinner
SDK immediately measures → reports height 110px (just the spinner)
I also ran into this issue. The reason is that setupSizeChangedNotifications sets html.style.width = "fit-content" and html.style.height = "max-content".
Because of this, if a child element uses height: 100%, the height detection may become inaccurate.
Update: as of #622 you can pass useApp({ autoResize: false }) (or new App(appInfo, caps, { autoResize: false })) and call app.sendSizeChanged() yourself once your async content has rendered — that sidesteps the early-measurement collapse without touching the default measurement logic.
A change to the measurement itself (#619) is on hold pending cross-host validation, since it affects every existing app's resize behavior.
Activity
Mohammedsapry commentedon Dec 17, 2025
Why
fix: defer initial size measurement to ResizeObserver (modelcontextpr…
kashtian commentedon Mar 26, 2026
I also ran into this issue. The reason is that setupSizeChangedNotifications sets html.style.width = "fit-content" and html.style.height = "max-content".
Because of this, if a child element uses height: 100%, the height detection may become inaccurate.
ochafik commentedon Apr 21, 2026
Update: as of #622 you can pass
useApp({ autoResize: false })(ornew App(appInfo, caps, { autoResize: false })) and callapp.sendSizeChanged()yourself once your async content has rendered — that sidesteps the early-measurement collapse without touching the default measurement logic.A change to the measurement itself (#619) is on hold pending cross-host validation, since it affects every existing app's resize behavior.
Mohammedsapry commentedon Jul 6, 2026
if (this.options?.autoResize) {
this.setupSizeChangedNotifications(); //
Called immediately after connect
}