Skip to content

Improve HTML Widget example rendering - #528

Merged
Corina (corinagum) merged 2 commits into
mainfrom
cg/fix/htmlwidget-darkmode-buttons
Jul 28, 2026
Merged

Improve HTML Widget example rendering#528
Corina (corinagum) merged 2 commits into
mainfrom
cg/fix/htmlwidget-darkmode-buttons

Conversation

@corinagum

Copy link
Copy Markdown
Contributor

Make improvements to HTML Widget example rendering

  • Fixes button text rendering in white instead of black
  • /hostcontext - as a self-initializing widget (injectWidgetProtocol bypassed by being populated) lacking notifySize() meant that render was too small against actual height of the widget. Removed height: 100% to remove circular measurement.

Copilot AI review requested due to automatic review settings July 28, 2026 20:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_context widget layout by removing height: 100% on html, body to 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.

Comment thread examples/html-widgets/src/widgets/host_context.py
@corinagum
Corina (corinagum) merged commit 91ed533 into main Jul 28, 2026
8 checks passed
@corinagum
Corina (corinagum) deleted the cg/fix/htmlwidget-darkmode-buttons branch July 28, 2026 21:57
This was referenced Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants