Improve HTML Widget example rendering - #528
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the rendering and usability of the examples/html-widgets sample widgets by correcting button text color styling and improving the host-context widget’s sizing behavior so it better matches its actual rendered height in the host.
Changes:
- Explicitly sets button text color to avoid incorrect (white) button label rendering.
- Adjusts
host_contextwidget layout by removingheight: 100%onhtml, bodyto avoid circular sizing behavior. - Adds a manual size notification (
ui/notifications/size-changed) to help the host correctly size the iframe for self-initializing widgets.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| examples/html-widgets/src/widgets/update_context.py | Sets an explicit button text color to ensure readable button labels. |
| examples/html-widgets/src/widgets/open_link.py | Sets an explicit button text color to ensure readable button labels. |
| examples/html-widgets/src/widgets/host_context.py | Removes height: 100% and adds manual size reporting after initialization to improve iframe sizing. |
Lily Du (lilyydu)
approved these changes
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make improvements to HTML Widget example rendering
/hostcontext- as a self-initializing widget (injectWidgetProtocolbypassed by being populated) lackingnotifySize()meant that render was too small against actual height of the widget. Removedheight: 100%to remove circular measurement.