Ajouter le mode Comparer à barre glissante et retirer le mode « les deux »
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -306,19 +306,17 @@ def test_healthz_and_assets(tmp_path, monkeypatch):
|
||||
|
||||
def test_ui_main_layer_and_precision_modes():
|
||||
"""Une couche d'affichage principal et la précision : relief seul,
|
||||
précision seule, ou précision en « produit » sur le relief.
|
||||
précision seule, ou comparaison de part et d'autre d'une barre glissante.
|
||||
|
||||
Plus de pile réordonnable ni de fusion par couche. Le produit est
|
||||
cantonné à la pile LiDAR par un conteneur isolé (sinon il assombrirait
|
||||
aussi le fond de carte). Bascule rapide au clavier (touche P).
|
||||
Plus de pile réordonnable ni de fusion par couche. Bascule rapide au
|
||||
clavier (touche P).
|
||||
"""
|
||||
from lidar_pipeline.mapui import _MAP_CSS, _MAP_HTML, _MAP_JS
|
||||
for mode in ('data-mode="relief"', 'data-mode="precision"', 'data-mode="both"'):
|
||||
for mode in ('data-mode="relief"', 'data-mode="precision"', 'data-mode="compare"'):
|
||||
assert mode in _MAP_HTML
|
||||
assert 'id="precOpacity"' in _MAP_HTML and 'id="precLegend"' in _MAP_HTML
|
||||
assert 'id="precLegend"' in _MAP_HTML
|
||||
assert 'id="mainSel"' in _MAP_HTML
|
||||
assert "blend = 'multiply'" in _MAP_JS
|
||||
assert "createPane('lidarStack')" in _MAP_JS and "isolation = 'isolate'" in _MAP_JS
|
||||
assert "createPane('lidarStack')" in _MAP_JS
|
||||
assert "e.key === 'p'" in _MAP_JS
|
||||
# Légende en 16 paliers exacts (échelle log de la densité)
|
||||
assert "const PREC_LEVELS = 16;" in _MAP_JS and "repeat(16, 1fr)" in _MAP_CSS
|
||||
@ -509,6 +507,25 @@ def test_meta_serves_reading_text(tmp_path, monkeypatch):
|
||||
assert layers["densite_sol"]["reading"]
|
||||
|
||||
|
||||
def test_ui_compare_mode_replaces_both():
|
||||
"""Mode « Comparer » : une barre glissante sépare deux couches (relief,
|
||||
précision ou OSM seul) ; l'ancien mode « les deux » (produit) disparaît
|
||||
et un ancien lien P=both s'ouvre en relief."""
|
||||
from lidar_pipeline.mapui import _MAP_CSS, _MAP_HTML, _MAP_JS
|
||||
assert 'data-mode="compare"' in _MAP_HTML and 'data-mode="both"' not in _MAP_HTML
|
||||
assert 'id="precOpacity"' not in _MAP_HTML and "precOpacity" not in _MAP_JS
|
||||
assert "mixBlendMode" not in _MAP_JS and "multiply" not in _MAP_JS
|
||||
for id_ in ("compareBar", "compareLeft", "compareRight", "compareCtl"):
|
||||
assert f'id="{id_}"' in _MAP_HTML, id_
|
||||
assert "function applyCompareClip(" in _MAP_JS and "clipPath" in _MAP_JS
|
||||
assert "map.on('move', applyCompareClip)" in _MAP_JS
|
||||
assert "'&C=' +" in _MAP_JS
|
||||
# Ancien lien P=both : mode relief
|
||||
parse = _MAP_JS[_MAP_JS.index("function parseHash("):_MAP_JS.index("function viewHash(")]
|
||||
assert "'both'" in parse and "'relief'" in parse
|
||||
assert "#compareBar" in _MAP_CSS and "touch-action: none" in _MAP_CSS
|
||||
|
||||
|
||||
def test_ui_applies_server_defaults():
|
||||
"""L'interface part des défauts du serveur et sait les (re)définir."""
|
||||
from lidar_pipeline.mapui import _MAP_HTML, _MAP_JS
|
||||
@ -516,7 +533,8 @@ def test_ui_applies_server_defaults():
|
||||
assert "api/map/defaults" in _MAP_JS
|
||||
assert "meta.default_main" in _MAP_JS and "meta.default_mode" in _MAP_JS
|
||||
assert "meta.default_base" in _MAP_JS
|
||||
assert "meta.default_precision_opacity" in _MAP_JS
|
||||
assert "default_precision_opacity" not in _MAP_JS
|
||||
assert "precision_opacity" not in _MAP_JS
|
||||
# Réinitialiser oublie l'état local avant de reprendre celui du serveur
|
||||
assert "lsDel(LS_KEY)" in _MAP_JS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user