feat(ET-007): спутниковая подложка с переключателем Схема/Спутник #10

Merged
admin merged 8 commits from feature/ET-007-et-005 into main 2026-06-01 01:30:03 +03:00
Owner

Summary

  • Сегментированный переключатель «Подложка» (Схема/Спутник) в попапе слоёв #terrain-popup
  • Ленивое создание Esri World Imagery raster-source/layer при первом включении «Спутник»
  • Восстановление выбора из localStorage (ключ map-base-layer) и переживание смены темы через rebuildMapOverlays() (первым)
  • Halo-underlay-слои *-halo-satellite в обоих style*.json для читаемости trails поверх спутника
  • POI text-halo и POI circle stroke динамически меняются на чёрный/белый под спутник через setPaintProperty
  • 28 behavioural JS-тестов + 22 pytest-проверки (статика + node --test)

Артефакты

  • ТЗ: docs/work-items/ET-007/02-trz.md
  • AC: docs/work-items/ET-007/03-acceptance-criteria.md
  • ADR-004: docs/work-items/ET-007/06-adr/ADR-004-satellite-base-layer.md
  • Test plan: docs/work-items/ET-007/04-test-plan.yaml

Test plan

  • node --test tests/unit/base_layer.test.js — 28 passed
  • pytest tests/unit/test_base_layer.py — 22 passed
  • pytest tests/unit/test_poi_toggle.py tests/unit/test_unit_toggle.py — регресса нет (27 passed)
  • JSON-валидность style.json и style-dark.json
  • e2e (Playwright): TC-UI-01..14 — инфраструктуры пока нет

Refs: ET-007

## Summary - Сегментированный переключатель «Подложка» (Схема/Спутник) в попапе слоёв `#terrain-popup` - Ленивое создание Esri World Imagery raster-source/layer при первом включении «Спутник» - Восстановление выбора из `localStorage` (ключ `map-base-layer`) и переживание смены темы через `rebuildMapOverlays()` (первым) - Halo-underlay-слои `*-halo-satellite` в обоих `style*.json` для читаемости trails поверх спутника - POI text-halo и POI circle stroke динамически меняются на чёрный/белый под спутник через `setPaintProperty` - 28 behavioural JS-тестов + 22 pytest-проверки (статика + node --test) ## Артефакты - ТЗ: `docs/work-items/ET-007/02-trz.md` - AC: `docs/work-items/ET-007/03-acceptance-criteria.md` - ADR-004: `docs/work-items/ET-007/06-adr/ADR-004-satellite-base-layer.md` - Test plan: `docs/work-items/ET-007/04-test-plan.yaml` ## Test plan - [x] `node --test tests/unit/base_layer.test.js` — 28 passed - [x] `pytest tests/unit/test_base_layer.py` — 22 passed - [x] `pytest tests/unit/test_poi_toggle.py tests/unit/test_unit_toggle.py` — регресса нет (27 passed) - [x] JSON-валидность `style.json` и `style-dark.json` - [ ] e2e (Playwright): TC-UI-01..14 — инфраструктуры пока нет Refs: ET-007
admin added 5 commits 2026-05-31 23:09:42 +03:00
docs: init ET-007 business request
All checks were successful
CI / lint (push) Successful in 4s
CI / test (push) Successful in 6s
CI / build (push) Successful in 1s
5bb2fa96d7
docs(ET-007): analyst artifacts - BRD, TRZ, AC, TestPlan, UI tests
All checks were successful
CI / lint (push) Successful in 4s
CI / test (push) Successful in 6s
CI / build (push) Successful in 1s
d7d06bb046
docs(ET-007): architecture - ADR, infra-requirements, data-requirements, tech-risks
All checks were successful
CI / lint (push) Successful in 3s
CI / test (push) Successful in 6s
CI / build (push) Successful in 1s
231c99c045
reviewer(ET): auto-commit from reviewer run_id=29
All checks were successful
CI / lint (push) Successful in 3s
CI / test (push) Successful in 5s
CI / build (push) Successful in 3s
29d8461c0c
feat(web): спутниковая подложка с переключателем Схема/Спутник
All checks were successful
CI / lint (push) Successful in 3s
CI / test (push) Successful in 5s
CI / build (push) Successful in 1s
CI / lint (pull_request) Successful in 4s
CI / test (pull_request) Successful in 5s
CI / build (pull_request) Successful in 1s
475d42187d
ET-007: добавлен сегментированный переключатель «Подложка» в попап
слоёв; ленивое создание Esri World Imagery raster-source при первом
включении «Спутник»; восстановление выбора из localStorage и переживание
смены темы через rebuildMapOverlays().

- src/web/index.html: блок .terrain-base-row в #terrain-popup
- src/web/app.css: стили .terrain-base-row / .terrain-base-label / .base-seg
- src/web/app.js: блок ET-007 с onBaseLayerToggle, applyBaseLayer,
  restoreBaseLayerState, syncBaseLayerUI; хук в rebuildMapOverlays()
  первым, чтобы terrain/trails/POI лежали поверх спутника
- src/web/style.json, style-dark.json: halo-underlay-слои
  trails-track-halo-satellite и trails-path-bridleway-halo-satellite
  (visibility:none по умолчанию, включаются на спутнике для контраста)
- tests/unit/base_layer.test.js: 28 behavioural JS-тестов (U-01..U-05,
  U-10..U-11, I-01..I-07, halo, z-order, private mode, тёмная тема)
- tests/unit/test_base_layer.py: 22 pytest-проверки (HTML/CSS/app.js/
  style.json структурные + node --test runner)

Refs: ET-007
ADR: docs/work-items/ET-007/06-adr/ADR-004-satellite-base-layer.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
admin added 1 commit 2026-06-01 00:05:57 +03:00
fix(ET-007): address 6 P1 findings from review (docs + code)
All checks were successful
CI / lint (push) Successful in 4s
CI / test (push) Successful in 6s
CI / lint (pull_request) Successful in 4s
CI / test (pull_request) Successful in 5s
CI / build (push) Successful in 4s
CI / build (pull_request) Successful in 2s
1984b0bde6
12-review.md (REQUEST_CHANGES, attempt 2/3) flagged 6 must-fix items
in the analysis/architecture artefacts plus matching bugs that had
already leaked into the committed implementation. This patch lands
both: documents corrected, code aligned with corrected specs, tests
updated.

P1-1: TRZ/ADR/Data/Risks referenced fictional layer ids
(`trails-grade1..5-halo-satellite`, `paths-bridleway-halo-satellite`).
Actual style*.json has only `trails-track-halo-satellite` and
`trails-path-bridleway-halo-satellite`; grade differentiation lives
inside one `match` expression on `tracktype` within `trails-track`.
Docs rewritten to operate on real ids.

P1-2: POI labels contrast was broken — spec changed only halo-color
to black, leaving `text-color: #333333` (light theme baseline)
unreadable over the new black halo. Code+docs now switch BOTH
`text-color` (-> `#ffffff` on satellite) AND halo together, with
per-theme baselines (`#333333` light / `#e0e0e0` dark) restored on
return to Schematic.

P1-3: BRD §5 hillshade risk said «hillshade auto-disabled on
satellite», contradicting TRZ/ADR/AC. BRD wording aligned: hillshade
keeps working over satellite; visual check is AC-04.

P1-4: background-color had four divergent sources (`#1a1a1a`,
`#2a2a2a`, `#1a1a2e`, `#f0ede6`), incl. an inverted-theme typo and a
baseline `#1a1a1a` that didn't match the actual `style-dark.json:28`
value `#1a1a2e`. Settled on ADR-004's single-constant model: `#2a2a2a`
on satellite for both themes; on Schematic restore per-theme baselines
`#f0ede6` (light) / `#1a1a2e` (dark). `_applyBackgroundForSatellite`
fixed accordingly.

P1-5: app.js already had `layerState.basemap` and `toggleLayer
('basemap')` (legacy «Базовая карта» switch). Neither TRZ nor ADR
specified the interaction. Added save&restore contract: on entering
Satellite save `layerState.basemap` to `_savedBasemapState` and
force-hide `osm-base`; on returning to Schematic restore osm-base
visibility from the saved value. CSS hook `body.satellite-active
#btn-basemap { display:none }` keeps the user from trying to enable
a hybrid mode (out of scope, BRD §3). TRZ §5.6, ADR-004 §8.

P1-6: `restoreTrailsState()` and `onTrailsCheckbox()` only managed
visibility of `trails-track` / `trails-path-bridleway`, leaving
their halo-underlay siblings as «phantom» halos when the user
unchecked grunты/тропы under Satellite. Introduced
`_applyTrailHaloVisibility(map, base)` reading checkbox state from
DOM; called from `onTrailsCheckbox`, `restoreTrailsState`, and both
branches of `applyBaseLayer`. Rule: halo visible ⇔ (base ===
satellite) AND (checkbox ON). TRZ §5.7, ADR-004 §9.

Docs bumped: BRD v2, TRZ v2, AC v2, Data v2, Risks v2; ADR-004
получает «Ревизии»-секцию (status remains accepted — only editorial
fixes, no decision change).

Tests:
- tests/unit/base_layer.test.js: rewritten 2 background-color
  assertions (#1a1a1a expectation removed), added 6 new tests for
  P1-2 / P1-4 (POI text-color per-theme baselines, single satellite
  bg #2a2a2a, baseline restore on Schematic).
- All 33 JS unit tests + 22 pytest static checks green.
- Full pytest suite: 76 passed (excluding pre-existing
  shapely-import skipped collection in tests/unit/test_health.py).

Refs: ET-007
Review: docs/work-items/ET-007/12-review.md (P1-1..P1-6)
ADR: docs/work-items/ET-007/06-adr/ADR-004-satellite-base-layer.md (rev. 2026-05-31)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
admin added 1 commit 2026-06-01 00:13:01 +03:00
reviewer(ET): auto-commit from reviewer run_id=32
All checks were successful
CI / lint (push) Successful in 4s
CI / test (push) Successful in 5s
CI / lint (pull_request) Successful in 3s
CI / build (push) Successful in 4s
CI / test (pull_request) Successful in 5s
CI / build (pull_request) Successful in 1s
6acc57d7b7
admin added 1 commit 2026-06-01 01:18:16 +03:00
test(ET-007): tester report - all unit tests pass, e2e skip (no Playwright)
All checks were successful
CI / lint (push) Successful in 4s
CI / test (push) Successful in 5s
CI / lint (pull_request) Successful in 3s
CI / test (pull_request) Successful in 5s
CI / build (push) Successful in 4s
CI / build (pull_request) Successful in 1s
95a122f1f8
admin merged commit d4f1591be3 into main 2026-06-01 01:30:03 +03:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/enduro-trails#10