app props / host state adjustments & improvements - #26
Conversation
52f09ef to
d246b0f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c47f651063
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| JSON.parse(toolResponseMetadataStr), | ||
| ); | ||
|
|
||
| if (!toolResult) return; |
There was a problem hiding this comment.
Send a clear tool-result update when both channels are null
Returning early here prevents bridge.sendToolResult(...) from running when both toolOutput and toolResponseMetadata are cleared, so the iframe keeps the previous tool result state. This now causes stale preview data in the new metadata-only flow: if metadata is sent while toolOutput is null and then metadata is removed, no clearing message is emitted and the widget continues to see the old _meta.
Useful? React with 👍 / 👎.
| intrinsicHeight !== null | ||
| ? Math.min(Math.max(intrinsicHeight, 0), maxHeight) |
There was a problem hiding this comment.
Fallback to max height when intrinsic height is non-positive
This new clamp treats intrinsicHeight = 0 as a valid rendered height, which collapses the widget container to 0px. The previous behavior intentionally fell back to maxHeight for non-positive intrinsic heights, and 0 can occur transiently from host sizing callbacks before real measurement is available, causing the preview to disappear until another resize event arrives.
Useful? React with 👍 / 👎.
Uh oh!
There was an error while loading. Please reload this page.