Skip to content

feat(widgets): opt-in bundled widget tooltips - #10427

Closed
ibgreen-openai wants to merge 1 commit into
ib/widget-tooltipsfrom
codex/widget-tooltip-integration
Closed

feat(widgets): opt-in bundled widget tooltips#10427
ibgreen-openai wants to merge 1 commit into
ib/widget-tooltipsfrom
codex/widget-tooltip-integration

Conversation

@ibgreen-openai

@ibgreen-openai ibgreen-openai commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Stacked on #10414.

Applies the themed tooltip renderer to bundled button widgets using the protected member hook:

protected override onAfterRenderHTML = updateWidgetTooltip;

How It Fits With #10414

#10414 adds the generic updateWidgetTooltip helper and protected onAfterRenderHTML() lifecycle hook, but intentionally does not change bundled widget rendering.

This PR adds explicit metadata to button targets:

<button
  title="Zoom in"
  aria-label="Zoom in"
  data-deck-widget-tooltip="Zoom in"
/>

Each bundled button widget then calls the helper from its class member hook. The helper removes the native title after render and shows the styled deck.gl tooltip instead.

Changes

  • Adds aria-label and data-deck-widget-tooltip to shared IconButton, plus the direct button markup in CompassWidget and GimbalWidget.
  • Enables themed tooltips in Zoom, Fullscreen, Theme, Toggle, Screenshot, ResetView, Icon, Selector, Compass, and Gimbal widgets.
  • Updates widget tooltip docs and focused integration coverage.

Coverage

This PR covers standalone bundled button widgets.

Loading, Timeline, Popup, Stats, and Scrollbar are intentionally unchanged: they are status, range, or panel widgets rather than standalone button widgets, even where they reuse IconButton. Scale, Geocoder, Info, and ContextMenu do not currently render native title tooltip targets.

Validation

  • ./node_modules/.bin/tsc -p modules/widgets/tsconfig.json --noEmit
  • ./node_modules/.bin/vitest run --project headless test/modules/core/lib/widget-manager.spec.ts test/modules/widgets/widget-tooltip.spec.ts test/modules/widgets/scrollbar-widget.spec.ts test/modules/widgets/selector-widget.spec.ts test/modules/widgets/theme-widget.spec.ts test/modules/widgets/toggle-widget.spec.ts
  • ./node_modules/.bin/vitest run --project headless test/modules/widgets/*.spec.ts (79 passed; existing LoadingWidget async spinner test also fails on the base branch)
  • yarn build
  • yarn lint (passes with existing warnings, no errors)

@coveralls

coveralls commented Jul 8, 2026

Copy link
Copy Markdown

Coverage Status

Coverage is 83.137%codex/widget-tooltip-integration into ib/widget-tooltips. No base build found for ib/widget-tooltips.

@ibgreen-openai
ibgreen-openai marked this pull request as ready for review July 8, 2026 13:35
@ibgreen-openai

Copy link
Copy Markdown
Collaborator Author

@chrisgervang
What do you think about this? Using custom HTML attributes as a way to keep this out of a new base class, do we feel this is OK?

@chrisgervang chrisgervang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm comfortable using custom tooltips on all built-in that are a button.

Could we just use the member interface and manually add it to our built-in widget subclasses?

@ibgreen-openai
ibgreen-openai force-pushed the codex/widget-tooltip-integration branch from b0003af to b0084a6 Compare July 8, 2026 20:50
@ibgreen-openai

Copy link
Copy Markdown
Collaborator Author

Updated per your feedback: the callback prop is removed from #10414, and this PR now opts standalone built-in button widgets in through the protected member hook. Shared IconButton supplies metadata; each button widget explicitly sets protected override onAfterRenderHTML = updateWidgetTooltip;. Non-button widgets remain unchanged.

@chrisgervang

Copy link
Copy Markdown
Collaborator

Lgtm, do you have any screenshots of what this looks like?

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.

4 participants