Commit dc0f89a
authored
fix(layers): hide control-rendered rasters with their group (#1720)
* fix(layers): hide control-rendered rasters with their group
Turning a group off left its COG layers painted on the map. The raster
control's store subscriber only reacted to `state.layers` and diffed each
layer's own `visible`/`opacity`, but group state lives in `layerGroups` and
never mutates a child layer, so the subscriber bailed out before it ran. A
deck.gl-rendered raster has no MapLibre style layer for layer-sync to toggle,
so that control push is its only channel and the raster stayed visible.
The subscriber now wakes on `layerGroups` changes and diffs the group-folded
values, so hiding or fading a group reaches the control. Project restore
replays the folded values too, so a project saved with a hidden group no
longer reopens with its rasters on the map.
Because the control now holds folded values, the control -> store mirror
would burn a hidden group's `false` into the layer's own `visible` on the
next control event, leaving it hidden after the group is shown again. It now
ignores a reported value that matches the fold and only records one that
differs, which is a genuine control-side edit.
Adds `effectiveLayerRenderState`, the single-layer form of
`applyGroupEffects`, so the fold (including the nested-group walk and its
cycle guard) has one definition.
Fixes #1717
* Address Claude review feedback; grey the eye of a group-hidden layer
- raster-layer-sync: the echo guard keyed on a re-derived group fold, so it
decided "this is an echo" from a value coincidence rather than from
provenance. It now records the folded value this module actually pushed
(subscriber and project-restore replay both register) and suppresses only
that, so any other control-reported value is treated as a user edit. Records
are dropped when the control loses the raster and cleared on unwire.
- LayerPanel: a layer hidden by its group kept a full-strength eye icon while
its name was already greyed, so the row contradicted itself. The eye is now
muted with the name and its tooltip says why. It deliberately stays an Eye
rather than flipping to EyeOff: the button is the layer's *own* switch, and
an EyeOff would offer a "Show layer" that turns that switch off, making the
layer take two clicks to reveal once the group is shown.
- LayerPanel: that cue read only the immediate parent, so a hidden grandparent
left the row looking fully visible. It now folds through
effectiveLayerRenderState and covers nested groups.
* Address Claude review feedback (round 2)
- raster-layer-sync: the echo guard remembered only values this module pushed,
never ones it accepted, so a control-side toggle away from the pushed value
and back landed on that value again and was misread as an echo and dropped —
the raster would then reappear when the group was shown. The map now tracks
the last value the control is known to hold, updated on accepted edits as
well as pushes, and is renamed controlRenderState to say so. Adds the
toggle-away-and-back regression test, which the round-1 tests missed.
- effectiveLayerRenderState now also takes a prebuilt id -> group map, and
LayerPanel passes its memoized groupById, so folding every row no longer
rebuilds that map once per layer on each render.
* Address Claude review feedback (round 3)
- maplibre-raster: build the restore-path group lookup as a Map once instead
of handing effectiveLayerRenderState the array inside the loop, which
rebuilt it per grouped raster — the pattern that helper's own JSDoc warns
against.
- LayerPanel: the visibility button's tooltip explained why the eye was muted
but its aria-label did not, so the group-hidden context reached a hover and
not a screen reader. Both now render the same string.1 parent f35c7a2 commit dc0f89a
6 files changed
Lines changed: 366 additions & 31 deletions
File tree
- apps/geolibre-desktop/src/components/panels
- packages
- core/src
- plugins/src/plugins
- tests
Lines changed: 29 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
2950 | 2951 | | |
2951 | 2952 | | |
2952 | 2953 | | |
2953 | | - | |
| 2954 | + | |
2954 | 2955 | | |
2955 | | - | |
2956 | | - | |
2957 | | - | |
2958 | | - | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
2959 | 2970 | | |
2960 | 2971 | | |
2961 | 2972 | | |
| |||
3172 | 3183 | | |
3173 | 3184 | | |
3174 | 3185 | | |
3175 | | - | |
3176 | | - | |
| 3186 | + | |
| 3187 | + | |
| 3188 | + | |
| 3189 | + | |
| 3190 | + | |
| 3191 | + | |
| 3192 | + | |
| 3193 | + | |
| 3194 | + | |
| 3195 | + | |
3177 | 3196 | | |
3178 | 3197 | | |
3179 | 3198 | | |
3180 | 3199 | | |
3181 | 3200 | | |
3182 | 3201 | | |
3183 | | - | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
3184 | 3205 | | |
3185 | 3206 | | |
3186 | 3207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
| 95 | + | |
| 96 | + | |
107 | 97 | | |
108 | 98 | | |
109 | 99 | | |
110 | 100 | | |
111 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
112 | 156 | | |
113 | 157 | | |
114 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
565 | 566 | | |
566 | 567 | | |
567 | 568 | | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
568 | 574 | | |
569 | 575 | | |
570 | 576 | | |
| |||
587 | 593 | | |
588 | 594 | | |
589 | 595 | | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
590 | 604 | | |
591 | 605 | | |
592 | 606 | | |
593 | 607 | | |
594 | 608 | | |
595 | 609 | | |
596 | 610 | | |
597 | | - | |
598 | | - | |
| 611 | + | |
| 612 | + | |
599 | 613 | | |
600 | 614 | | |
601 | 615 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
2 | 8 | | |
3 | 9 | | |
4 | 10 | | |
| |||
82 | 88 | | |
83 | 89 | | |
84 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
85 | 120 | | |
86 | 121 | | |
87 | 122 | | |
| |||
241 | 276 | | |
242 | 277 | | |
243 | 278 | | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
244 | 285 | | |
245 | 286 | | |
246 | 287 | | |
| |||
272 | 313 | | |
273 | 314 | | |
274 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
275 | 335 | | |
276 | | - | |
277 | | - | |
| 336 | + | |
| 337 | + | |
278 | 338 | | |
279 | 339 | | |
280 | 340 | | |
| |||
283 | 343 | | |
284 | 344 | | |
285 | 345 | | |
286 | | - | |
| 346 | + | |
287 | 347 | | |
288 | 348 | | |
289 | | - | |
| 349 | + | |
290 | 350 | | |
291 | 351 | | |
292 | 352 | | |
| |||
314 | 374 | | |
315 | 375 | | |
316 | 376 | | |
317 | | - | |
| 377 | + | |
318 | 378 | | |
319 | 379 | | |
320 | 380 | | |
| |||
323 | 383 | | |
324 | 384 | | |
325 | 385 | | |
326 | | - | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
327 | 395 | | |
328 | | - | |
| 396 | + | |
329 | 397 | | |
330 | 398 | | |
331 | 399 | | |
332 | 400 | | |
333 | 401 | | |
| 402 | + | |
334 | 403 | | |
335 | 404 | | |
336 | 405 | | |
337 | 406 | | |
338 | 407 | | |
| 408 | + | |
339 | 409 | | |
340 | 410 | | |
341 | 411 | | |
| 412 | + | |
342 | 413 | | |
343 | 414 | | |
344 | 415 | | |
| |||
435 | 506 | | |
436 | 507 | | |
437 | 508 | | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
438 | 512 | | |
439 | 513 | | |
440 | 514 | | |
| |||
616 | 690 | | |
617 | 691 | | |
618 | 692 | | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
619 | 701 | | |
620 | 702 | | |
621 | 703 | | |
| |||
0 commit comments