fix(node): restore view-tree owners on map dispose so node-list popups aren't invisible#5699
Merged
Merged
Conversation
…dering invisible
InlineMap (and NodeClusterMarkers) set the activity root view's
ViewTreeLifecycleOwner / SavedStateRegistryOwner to work around a
maps-compose MarkerComposable crash, but used an empty `onDispose {}`.
The owner is the host screen's NavEntry-scoped lifecycle. Visiting a node
detail with a location attaches that transient owner to the activity root
view; navigating back destroys the lifecycle but leaves it on the root view.
Every Popup/DropdownMenu opened afterward (node-list sort/filter menus,
long-press context menu) inherits the destroyed lifecycle from the root view,
so its content never composes and the popup window is measured at 0x0 —
invisible.
Capture the previous owners and restore them in onDispose, keeping the maps
crash workaround intact while no longer leaking a destroyed lifecycle onto the
root view.
Regression from #5684. Verified on-device: sort/filter and long-press menus
render correctly across repeated node detail round-trips.
Co-Authored-By: Claude Opus 4.8 <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.
Problem
On the Nodes list, all popups — the sort/filter menus and the long-press
NodeContextMenu— stopped appearing after navigating into a node detail and back. The popup window was created (and even grabbed focus) but its content measured to0×0(dumpsys window→mAttrs={(0,0)(0x0)}), so nothing drew.Root cause
InlineMap(rendered inside the node-detail screen) andNodeClusterMarkers(Map screen) set the activity root view'sViewTreeLifecycleOwner/ViewTreeSavedStateRegistryOwnerto work around a maps-composeMarkerComposablecrash — but with an emptyonDispose {}:lifecycleOwneris the host screen's NavEntry-scoped, transient lifecycle. Visiting a node detail with a location attaches that owner to the activity root view; navigating back destroys the lifecycle but leaves it on the root view. EveryPopup/DropdownMenuopened afterward inherits its lifecycle from the root view → gets a DESTROYED lifecycle → its content never composes →0×0invisible window.This explains why it affected all popups, any popup type, only after a detail visit, and was unaffected by Compose-level changes. Regression from #5684 (bisected on-device: good through
internal.111, bad at HEAD).Fix
Capture the previous owners (
findViewTreeLifecycleOwner()/findViewTreeSavedStateRegistryOwner()) before overwriting and restore them inonDispose, in bothInlineMap.ktandNodeClusterMarkers.kt. The maps crash workaround stays intact; we just no longer leak a destroyed lifecycle onto the root view.Verification
Built and run on an emulator. After repeated node detail → back round-trips:
576×1952)531×692)🤖 Generated with Claude Code