perf(map): analyze only the selected theme
GeoIntel release gates / Compile, test, contracts and builds (push) Canceled after 0s
GeoIntel release gates / Python and npm vulnerability policy (push) Canceled after 0s
GeoIntel release gates / GIS image, SBOM and container scan (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-22 00:37:45 +02:00
parent 919f5879e5
commit 1299ff9dac
2 changed files with 6 additions and 5 deletions
@@ -34,7 +34,8 @@ def test_selection_reads_and_bounded_acquires_all_relevant_themes() -> None:
app = read("frontend/src/App.tsx") app = read("frontend/src/App.tsx")
selection_hook = read("frontend/src/hooks/useMapThemeSelectionInsights.ts") selection_hook = read("frontend/src/hooks/useMapThemeSelectionInsights.ts")
assert "for (const theme of DATA_THEMES)" in workspace assert "for (const theme of [activeTheme])" in workspace
assert "loadSelectedThemeResult" in workspace
assert "? onDemandProductsForZones(resolvedZones)" in workspace assert "? onDemandProductsForZones(resolvedZones)" in workspace
assert ".filter((product) => product.theme === activeThemeId)" not in workspace assert ".filter((product) => product.theme === activeThemeId)" not in workspace
assert "await loadThemeInsights(bbox, availableThemes, areaId)" in workspace assert "await loadThemeInsights(bbox, availableThemes, areaId)" in workspace
+4 -4
View File
@@ -1791,7 +1791,7 @@ export function MapWorkspace({
}) })
} }
const loadAllThemeResults = async (bbox: VectorSelectionBBox, areaId?: string) => { const loadSelectedThemeResult = async (bbox: VectorSelectionBBox, areaId?: string) => {
let resolvedZones = selectedCoverageZones let resolvedZones = selectedCoverageZones
const scale = selectionAnalysisScale(bbox) const scale = selectionAnalysisScale(bbox)
if (analysisMode === 'current' && selectedProjectId) { if (analysisMode === 'current' && selectedProjectId) {
@@ -1852,7 +1852,7 @@ export function MapWorkspace({
} }
const availableThemes: Array<MapThemeQuery<DataThemeId>> = [] const availableThemes: Array<MapThemeQuery<DataThemeId>> = []
const resultFeatureLimit = selectionFeatureLimit(bbox) const resultFeatureLimit = selectionFeatureLimit(bbox)
for (const theme of DATA_THEMES) { for (const theme of [activeTheme]) {
const dataset = themeDatasetMap[theme.id] const dataset = themeDatasetMap[theme.id]
const partitioned = Boolean( const partitioned = Boolean(
dataset dataset
@@ -1904,7 +1904,7 @@ export function MapWorkspace({
setMapAnalysisDurationMs(null) setMapAnalysisDurationMs(null)
setSelectionBbox(bbox) setSelectionBbox(bbox)
const tasks: Array<Promise<unknown>> = analysisMode === 'current' const tasks: Array<Promise<unknown>> = analysisMode === 'current'
? [loadAllThemeResults(bbox, areaId)] ? [loadSelectedThemeResult(bbox, areaId)]
: [] : []
const activeDatasetSupportsSelection = !activeThemeDataset const activeDatasetSupportsSelection = !activeThemeDataset
|| persistedDatasetSupportsSelection(activeThemeDataset, bbox) || persistedDatasetSupportsSelection(activeThemeDataset, bbox)
@@ -2576,7 +2576,7 @@ export function MapWorkspace({
) : mapSelectionLoading || themeResultsLoading || temporalComparisonLoading ? ( ) : mapSelectionLoading || themeResultsLoading || temporalComparisonLoading ? (
<div className="geo-results-loading" role="status"> <div className="geo-results-loading" role="status">
<span /> <span />
<strong>Officiële bronnen worden begrensd geladen en geanalyseerd</strong> <strong>De gekozen officiële bron wordt begrensd geladen en geanalyseerd</strong>
</div> </div>
) : ( ) : (
<> <>