Files
editor/e2e/fixtures/grouped-layers-style.json
T
Nikita Maximilian Grimm 1301dc03e7 Fix layer group expansion state after deletion (#2146)
Deleting a layer changes the starting indices of later groups, so their
stored expansion state no longer matches. Preserve that state through
surviving layer IDs when rebuilding the group keys.

This keeps expanded groups open after deleting an earlier layer or the
first layer of a group. Separate groups with the same prefix retain
their own states; if deletion joins two groups, the merged group stays
expanded when either was expanded.

- Fixes #1781.

Adds five deletion regression tests, a small style fixture, and a
changelog entry.

Validation:

- All 33 layer-list E2E tests and 50 unit tests pass.
- Lint and the production build, including TypeScript checking, pass.
- Manually checked OSM Liberty: all 15 groups remain expanded after
deleting the background layer.
- The full E2E suite reports 160 passing tests and one failure in
`modals > open > upload` (`Could not get styleItem from localStorage`).
The same failure reproduces with the original production code restored.

---------

Co-authored-by: Harel M <harel.mazor@gmail.com>
2026-09-08 18:33:00 +00:00

17 lines
500 B
JSON

{
"version": 8,
"name": "Grouped layers",
"sources": {},
"layers": [
{ "id": "background", "type": "background" },
{ "id": "park-a", "type": "background" },
{ "id": "park-b", "type": "background" },
{ "id": "park-c", "type": "background" },
{ "id": "road", "type": "background" },
{ "id": "park-d", "type": "background" },
{ "id": "park-e", "type": "background" },
{ "id": "water-a", "type": "background" },
{ "id": "water-b", "type": "background" }
]
}