Skip to content

[9.4-release] fix(core): give duplicate view ids one controller in ViewManager (#11065) - #11295

Merged
chrisgervang merged 1 commit into
9.4-releasefrom
chr/backport-11065-9.4
Nov 23, 2026
Merged

chrisgervang merged 1 commit into
9.4-releasefrom
chr/backport-11065-9.4

Conversation

@chrisgervang

@chrisgervang chrisgervang commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Original commit, cherry-picked with -x
  • _setViews conflict: 9.4 has no view retention or onViewRemoved, so only the duplicate-id warning is kept
  • Unit tests, unchanged

The ViewManager and Deck headless 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 ViewManager to 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

)

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)

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@chrisgervang
chrisgervang requested a review from ibgreen November 23, 2026 03:26
@chrisgervang chrisgervang mentioned this pull request Nov 23, 2026
29 of 30 tasks
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage is 83.131% — chr/backport-11065-9.4 into 9.4-release. No base build found for 9.4-release.

@chrisgervang
chrisgervang merged commit 9d746a5 into 9.4-release Nov 23, 2026
7 checks passed
@chrisgervang
chrisgervang deleted the chr/backport-11065-9.4 branch November 23, 2026 05:59
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.

2 participants