feat(widgets): Add controlled mode and state callbacks#9973
Open
chrisgervang wants to merge 4 commits intomasterfrom
Open
feat(widgets): Add controlled mode and state callbacks#9973chrisgervang wants to merge 4 commits intomasterfrom
chrisgervang wants to merge 4 commits intomasterfrom
Conversation
Implement controlled/uncontrolled component pattern for 12 widgets (ThemeWidget, FullscreenWidget, TimelineWidget, ZoomWidget, CompassWidget, GimbalWidget, GeocoderWidget, ResetViewWidget, ViewSelectorWidget, SplitterWidget, StatsWidget, LoadingWidget). Add state props, getter methods, and callbacks. Update widget overview documentation with controlled/uncontrolled mode explanation. Closes #9964 Co-Authored-By: Claude (global.anthropic.claude-haiku-4-5-20251001-v1:0) <noreply@anthropic.com>
Resolve conflict in stats-widget.tsx: keep _collapsed naming for controlled mode internal state, use _getStats() method from master. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove redundant _playing assignments in timeline-widget start()/stop() - Remove redundant updateHTML() calls after super.setProps() in multiple widgets - Fix IconMenu to support controlled mode via selectedItem prop Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.


Summary
Implements controlled/uncontrolled component pattern for 12 deck.gl widgets, enabling applications to drive widget state from external state management. Adds state props, getter methods, and event callbacks.
Change List
Closes #9964
Note
Medium Risk
Touches interaction/state logic across many widgets (fullscreen, timeline playback, view selection), so regressions in UI behavior or event handling are possible despite changes being mostly additive and opt-in.
Overview
Adds a controlled/uncontrolled state pattern across multiple
@deck.gl/widgetscomponents, introducing new state props (e.g.,themeMode,fullscreen,time,playing,collapsed,viewMode,split) plus getter methods, and updates rendering/interaction logic to defer internal state updates when controlled.Introduces new event callbacks for user actions and state transitions (
onZoom,onCompassReset,onGimbalReset,onGeocode,onReset,onLoadingChange,onFullscreenChange,onPlayingChange,onCollapsedChange) and updates docs to describe controlled vs uncontrolled usage and document the new props across widget API pages.Written by Cursor Bugbot for commit 7e952dd. This will update automatically on new commits. Configure here.