diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ece96a6..05633796 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,9 @@ - Prevented a single bounded municipality Dataset from being presented as complete Flanders coverage; GRB cards remain `Op aanvraag` until the active selection has produced its measured result, and stale previously opened - vector features are not rendered behind an on-demand theme. + vector features are not rendered behind an on-demand theme. The global + context bar also reports `Op aanvraag` instead of the previous Dataset's + feature count. - Updated the provider registry to report the bounded GRB integration as configured while keeping the old generic import/fetch contract non-fetching and directing callers to the governed project endpoint. diff --git a/backend/tests/test_sprint239_bounded_grb_acquisition.py b/backend/tests/test_sprint239_bounded_grb_acquisition.py index 784713b7..32a41ffc 100644 --- a/backend/tests/test_sprint239_bounded_grb_acquisition.py +++ b/backend/tests/test_sprint239_bounded_grb_acquisition.py @@ -390,5 +390,7 @@ def test_grb_frontend_and_contracts_use_only_the_governed_backend_path() -> None assert "officialMapProducts.grb" in workspace assert "result[product.key] = null" in workspace assert ": onDemandThemeActive\n ? null\n : mapFeatureCollection" in workspace + assert "onSetContextLayerLabel" in workspace + assert "'Op aanvraag'" in workspace assert "/datasets/grb/acquire" in contracts assert "geo.api.vlaanderen.be" not in workspace diff --git a/docs/CODEX_EXECUTION_LOG.md b/docs/CODEX_EXECUTION_LOG.md index ceee64c5..85e46af4 100644 --- a/docs/CODEX_EXECUTION_LOG.md +++ b/docs/CODEX_EXECUTION_LOG.md @@ -10246,7 +10246,8 @@ Implemented: acquired small Mol Dataset no longer makes a complete-Flanders theme card appear fully loaded. In the Flanders workspace GRB stays `Op aanvraag`; the exact bounded result is shown only after selection and an older active - vector layer is not rendered behind it. + vector layer is not rendered behind it. The top-level map context follows + the same state and cannot retain an unrelated Dataset count. Validation: - Focused provider, acquisition, route-envelope and frontend contract tests diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 103212d4..341267b2 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -71,6 +71,7 @@ function App(): JSX.Element { const [inspectorOpen, setInspectorOpen] = useState(false) const [mapContentMode, setMapContentMode] = useState<'dataset' | 'analysis'>('dataset') const [mapContextSourceLabel, setMapContextSourceLabel] = useState(null) + const [mapContextLayerLabel, setMapContextLayerLabel] = useState(null) const workbenchMainRef = useRef(null) useEffect(() => { workbenchMainRef.current?.scrollTo({ top: 0, left: 0 }) @@ -710,17 +711,19 @@ function App(): JSX.Element { : datasets.length > 0 ? 'Kies een bron' : 'Geen bron' - const layerContextLabel = bathymetryContextActive - ? regionalBathymetryContextActive - ? `${bathymetryProfileCount.toLocaleString('nl-BE')} profielen · ${regionalBathymetryPartitions.length} gemeenten` - : `${bathymetryProfileCount.toLocaleString('nl-BE')} profielen` - : mapFeatureCollection - ? `${mapFeatureCount.toLocaleString('nl-BE')} objecten` - : viewportVectorLayerActive - ? 'Kaartlaag gekozen' - : activeWorkspace === 'map' && selectedDataset?.dataset_type === 'raster' - ? 'Rasterlaag actief' - : 'Geen actieve laag' + const layerContextLabel = activeWorkspace === 'map' && mapContextLayerLabel + ? mapContextLayerLabel + : bathymetryContextActive + ? regionalBathymetryContextActive + ? `${bathymetryProfileCount.toLocaleString('nl-BE')} profielen · ${regionalBathymetryPartitions.length} gemeenten` + : `${bathymetryProfileCount.toLocaleString('nl-BE')} profielen` + : mapFeatureCollection + ? `${mapFeatureCount.toLocaleString('nl-BE')} objecten` + : viewportVectorLayerActive + ? 'Kaartlaag gekozen' + : activeWorkspace === 'map' && selectedDataset?.dataset_type === 'raster' + ? 'Rasterlaag actief' + : 'Geen actieve laag' return (
@@ -952,6 +955,7 @@ function App(): JSX.Element { selectedFeature={selectedMapFeature} onSelectMapArea={setSelectedMapAreaId} onSetContextSourceLabel={setMapContextSourceLabel} + onSetContextLayerLabel={setMapContextLayerLabel} onOpenDatasetInMap={openDatasetInMap} onSetAreaLayerVisible={setAreaLayerVisible} onSetAreaLayerOpacity={setAreaLayerOpacity} diff --git a/frontend/src/components/map/MapWorkspace.tsx b/frontend/src/components/map/MapWorkspace.tsx index fdfb6d51..cc034811 100644 --- a/frontend/src/components/map/MapWorkspace.tsx +++ b/frontend/src/components/map/MapWorkspace.tsx @@ -543,6 +543,7 @@ interface MapWorkspaceProps { selectedMapDatasetId: string onSelectMapArea: (areaId: string) => void onSetContextSourceLabel: (label: string | null) => void + onSetContextLayerLabel: (label: string | null) => void onOpenDatasetInMap: (dataset: DatasetCreateResponse) => void onSetAreaLayerVisible: (visible: boolean) => void onSetAreaLayerOpacity: (opacity: number) => void @@ -628,6 +629,7 @@ export function MapWorkspace({ selectedMapDatasetId, onSelectMapArea, onSetContextSourceLabel, + onSetContextLayerLabel, onOpenDatasetInMap, onSetAreaLayerVisible, onSetAreaLayerOpacity, @@ -1035,6 +1037,23 @@ export function MapWorkspace({ const activeResultDataset = activeThemeInsight?.dataset ?? activeThemeDataset const activeSelectionResult = activeThemeInsight?.result ?? (!regionalPartitionedThemeActive && selectedMapDataset?.id === activeThemeDataset?.id ? mapSelectionResult : null) + useEffect(() => { + const contextLayerLabel = analysisMode === 'current' && activeOnDemandMapProduct + ? activeSelectionResult + ? `${( + activeSelectionResult.total_feature_count + ?? activeSelectionResult.feature_count + ).toLocaleString('nl-BE')} objecten gemeten` + : 'Op aanvraag' + : null + onSetContextLayerLabel(contextLayerLabel) + return () => onSetContextLayerLabel(null) + }, [ + activeOnDemandMapProduct, + activeSelectionResult, + analysisMode, + onSetContextLayerLabel, + ]) const explorerMapFeatureCollection = regionalBathymetryThemeActive ? null : analysisMode === 'evolution' && temporalComparison?.geojson.features.length