Repository navigation
fix: keep late-arriving features hidden when their layer is hidden - #125
Merged
Merged
Conversation
Hiding a layer marks the layer key and every feature present at that moment with a hidden+ entry. Features created afterwards through store.import (NIDO WebSocket API, Matrix replication) carry no marker, and the visibility tracker only checked the feature's own key, so they appeared on the map inside a hidden layer. The tracker now also treats a feature as hidden when its layer key is in the hidden set. Covered by a new visibilityTracker test. Co-Authored-By: Claude Fable 5.1 <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
Hiding a layer writes a
hidden+marker for the layer key and for every feature present at that moment. Features created afterwards throughstore.import(NIDO WebSocket API, Matrix replication) carry no marker of their own. The visibility tracker only checked the feature's own key, so new features showed up on the map inside a hidden layer. Updates to existing features stayed hidden, which is why the effect is most visible with live sources that create new keys continuously (e.g. Sentinel tracks and units).Fix
visibilityTrackernow treats a feature as hidden when either its own key or its layer key is in the hidden set. The layer key is already part of the set, sinceStore.hidecollects the layer id itself. Covers NIDO and replication alike; the SSE live data sources are separate OpenLayers layers and not affected by this code path.Side effect, accepted on purpose: a single feature inside a hidden layer can no longer be shown separately while the layer stays hidden.
Test
New
test/renderer/model/sources/visibilityTracker-test.js(4 cases): visible layer, feature arriving after the layer was hidden, layer hidden before the tracker started, other layers unaffected.Note:
npm testas a whole fails onmainalready (test/shared/level/*,test/renderer/store/schema/Schema-test.js,test/main/legacy/*: missing modules / directory imports under Node 22). Unrelated to this change.🤖 Generated with Claude Code