Repository navigation
[9.4-release] fix(core): give duplicate view ids one controller in ViewManager (#11065) - #11295
Merged
Merged
Conversation
) ViewManager keys controllers, view event managers and viewport lookups by view id. With two views sharing an id, `_rebuildViewports` created a controller for each, and the second overwrote the first in `controllers[id]`, so the overwritten one was never finalized. Later rebuilds reused the surviving controller for both views, applying both layouts to it in turn. Warn with "Multiple views with same id" when views change, as LayerManager does for layers. Keep drawing every view, since two `MapView`s without an explicit id share the default id, but give controllers and event managers only to the first view with each id, matching `getView` and `getViewport`. This resolves the TODO in `_buildViewportMap`. Claude-Session: https://claude.ai/code/session_01LGNhMnSJ94uYgx7ihcVwPn Co-authored-by: Claude <[email protected]> (cherry picked from commit 6d1ccaf)
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
29 of 30 tasks
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.
Follow up of #11065, for #10972
Background
Backports #11065 to
9.4-release. Fixes #11067: when views share an id, the first gets the controller and the rest are still drawn, instead of each building a controller that the next one overwrites.Change List
-x_setViewsconflict: 9.4 has no view retention oronViewRemoved, so only the duplicate-id warning is keptThe
ViewManagerandDeckheadless tests pass on this branch.Note
Low Risk
Low risk bug fix that prevents controller conflicts when duplicate view IDs are provided, with thorough test coverage.
Overview
Updates
ViewManagerto handle duplicate view IDs gracefully by issuing a warning and assigning the controller and event manager exclusively to the first view with each ID. Subsequent views sharing an ID are still drawn as viewports instead of repeatedly overwriting controller state.Adds unit tests covering warning generation, multi-viewport rendering, controller reuse, and cleanup when views share the same ID.
Reviewed by Cursor Bugbot for commit 8c65f27. Bugbot is set up for automated code reviews on this repo. Configure here.
Generated by Claude Code