Repository navigation
fix(core): disable a controller with no view state instead of throwing - #10731
Merged
chrisgervang merged 5 commits intoSep 29, 2026
Merged
Conversation
A Deck created with a top-level controller, a per-view initialViewState and no views (a widget such as SplitterWidget provides them later) starts with the default view, whose controller resolved to the keyed view state map and made MapState assert. The assertion escaped ViewManager._update() before _isUpdating was reset, so the manager never rebuilt again and the widget's views never received controllers. ViewManager now skips (and warns about) a controller whose view cannot resolve a view state, and _update() always resets _isUpdating. Closes #10730 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01GoghM5SYvzaConbutwAw21
Collaborator
Author
|
@greptileai review bugbot run Generated by Claude Code |
|
A view whose viewState prop fully defines its state never reads the manager-level view state, so the no-view-state check must not disable its controller when the manager state is a keyed map without that view's id. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01GoghM5SYvzaConbutwAw21
Collaborator
Author
|
@greptileai review bugbot run Generated by Claude Code |
The skipped controller is an expected transient state when a widget provides views after construction. The explanation lives in a code comment; a test covers the controller being created once the view state arrives. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01GoghM5SYvzaConbutwAw21
Collaborator
Author
|
@greptileai review bugbot run Generated by Claude Code |
chrisgervang
marked this pull request as ready for review
September 22, 2026 14:52
ibgreen
approved these changes
Sep 29, 2026
chrisgervang
deleted the
claude/view-manager-default-view-controller
branch
September 29, 2026 14:53
This was referenced Oct 7, 2026
Collaborator
Author
|
Released in deck.gl 9.4.1. |
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.
Closes #10730
Background
A
Deckcreated with a top-levelcontroller, a per-viewinitialViewStateand noviews(a widget such asSplitterWidgetprovides them a frame later) starts with the default view. Its controller resolves to the keyed view state map, soMapStateasserts, and the exception escapesViewManager._update()before_isUpdatingis reset, so the manager never rebuilds again and the widget's views never get controllers.Change List
ViewManager: skip the controller of a view whose view state cannot be resolved; a view that owns itsviewStateprop or has an entry in the keyed map keeps its controller, and the controller is created on a later rebuild onceviewsorviewStatechangeViewManager._update: reset_isUpdatingin afinallyso one failing rebuild cannot wedge later updatesVerified with
yarn lint,yarn vitest run --project headless test/modules/core(397 passed), and a headless Chromium run of the pydeckSplitterWidgetexample against a bundle built from this branch: both panes get controllers, no assertion, no console warnings.This description was drafted by an AI coding agent following the guidelines proposed in #10707.
Note
Medium Risk
Touches core view/controller lifecycle during rebuild; behavior change is intentional for missing view state but affects when controllers attach.
Overview
Fixes a startup path where a default view with
controller: truemeets a keyedviewStatemap (no entry for that view), which used to assert insideMapStateand could leaveViewManagerstuck because_isUpdatingnever cleared.ViewManagernow skips attaching a controller when_hasViewState(view)is false (view-ownedviewState, a keyed entry, or a single global state still work); viewports still build and controllers appear on latersetPropswhen state or views arrive._update()resets_isUpdatingin afinallyblock so one failed rebuild cannot block future updates.Adds unit coverage for late view state, multi-view keyed maps, and views that own their
viewState.Reviewed by Cursor Bugbot for commit e1582b5. Bugbot is set up for automated code reviews on this repo. Configure here.