Commit History
-
fix: graceful fallback when indicator has no grid overlay
KSvend +1: Claude Opus 4.6 (1M context)The overlay was disappearing completely when clicking between indicators if any of them hit the raster→grid fallback path — the frontend fell through to _renderStatusOverlay() which (after the AOI rectangle was removed) did nothing visible, leaving a blank map with no feedback. Backend: - raster_to_grid_dict() now handles all-NaN rasters by emitting an empty grid so the legend still renders instead of returning None - _save_spatial_json() logs the raster path + band + existence when serializing, and writes a richer raster-unavailable payload (with label, colormap, vmin, vmax) so the frontend can still show a meaningful legend Frontend: - renderSpatialOverlay() no longer falls through to the old status overlay — unknown/fallback payloads render the legend in its new "overlay not available" mode with the product name + color hint - new _activeProductId tracking drops stale spatial responses when the user clicks through indicators rapidly - addSource/addLayer calls are wra…ef89b38 -
feat: remove AOI box, add map legend, color hints, before/after bars
KSvend +1: Claude Opus 4.6 (1M context)Polish pass on the results dashboard based on user feedback: - the AOI rectangle is gone from the results map — it was clashing with the indicator overlay for no informational gain; the overlay itself defines the area - new floating map legend (bottom-right) shows the active indicator label, the exact color gradient, the value range, and a one-line plain-language hint like "Green = healthier than baseline, pink = stressed, cleared, or burnt" - each indicator card now carries its own color hint under the chart, so non-tech readers don't need to consult the map legend to interpret what they're looking at - two-point chart_data (the built-up baseline → current payload) is now rendered as a before/after bar pair with a percent-change badge, instead of a meaningless two-dot line - MapLibre ScaleControl added in the bottom-left so distances are legible at a glance - grid overlay opacity softened from 0.65 → 0.55 so basemap labels remain readable - product color hints c…1ea9510 -
feat: show real indicator overlay on dashboard map + fix downloads
KSvend +1: Claude Opus 4.6 (1M context)The results dashboard map was only tinting the AOI box because the frontend had no handler for map_type="raster" — all four indicators use raster spatial data, so nothing ever rendered. Map overlay: - new app/outputs/spatial_web.raster_to_grid_dict() downsamples the product raster (using NaN-aware block mean) to ~96x96, flips rows to match the frontend's ascending-lat grid convention, and emits explicit matplotlib-colormap hex stops so the browser does not need to know RdYlGn, Blues, PiYG, etc. - _save_spatial_json() converts raster SpatialData through the helper before writing, so indicators return a grid-format payload the existing _renderGrid() already understands - _renderGrid() now prefers backend-provided color stops and fits the map view to the grid extent so the overlay is always visible Download fixes: - authDownload(): anchor is appended to the DOM before .click() and objectURL revocation is deferred — the old synchronous teardown broke in Safari/Firefox a…d2a9a16
-
fix: re-register map click handler after basemap toggle
KSvend +2: Claude, HappysetStyle() strips all event listeners, so toggling the basemap killed the AOI click-to-place handler and crosshair cursor. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>52dc51f -
feat: rewrite map.js with click-to-place AOI (no MapboxDraw)
KSvend59bad34
-
fix: remove MapboxDraw during rectangle tap to fix mobile touch events
KSvend +2: Claude, HappyMapboxDraw's simple_select mode intercepts click/tap events, preventing the two-tap rectangle from working on mobile. Now temporarily removes Draw control during the tap phase, re-adds it after the rectangle is built. Also adds a visual marker on first tap for feedback. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>8e098b4 -
fix: replace broken draw_rectangle with two-tap rectangle for mobile support
KSvend +2: Claude, Happydraw_rectangle is not a built-in MapboxDraw mode and no plugin was loaded, so rectangle drawing silently failed. Replaced with a two-tap approach: first tap sets one corner, second tap sets the opposite corner. Works on both touch (mobile) and click (desktop). Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>b15c51f -
feat: frontend renders spatial overlays natively in MapLibre
KSvend +2: Claude, HappyReplace PNG image overlay with native MapLibre rendering: spatialUrl() added to api.js, map.js gains renderSpatialOverlay/clearSpatialOverlay supporting points (circle layers), choropleth (fill), grid (polygon fill), and status color fallback. results.js updated to fetch JSON from /spatial/ endpoint. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>337d9e1 -
fix: let Draw handle its own style.load lifecycle on basemap toggle
KSvend +2: Claude, HappyDraw internally listens for style.load and re-adds its GL layers. Our removeControl/addControl was destroying that internal listener, breaking both toggle-back and drawing on the satellite layer. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>ebcc0cb -
fix: add double-click guard and improve BasemapToggle robustness
KSvend +2: Claude, Happy- Prevent toggle during style load with _switching flag - Use safer container.remove() in onRemove - Reset _currentStyle on initAoiMap re-entry Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>e5e17d3 -
feat: add basemap toggle control to AOI map (Positron/ESRI Satellite)
KSvend +2: Claude, HappyGenerated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>6a6634a -
refactor: rename MAP_STYLE to POSITRON_STYLE and add SATELLITE_STYLE constant
KSvend +2: Claude, HappyCo-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>cc94dbe -
fix: switch basemap from demo tiles to CARTO Positron
KSvend +2: Claude, HappyReplace MapLibre demo tiles (country outlines only) with CARTO Positron basemap showing roads, cities, and place labels so users can locate their programme areas. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>7773924
-
feat: wire up indicator map layers on results dashboard
KSvend +2: Claude, HappySpatial indicators (cropland, vegetation, water) now cache their 2D raster data after processing. The worker generates styled PNG maps via render_indicator_map(), served through a new API endpoint. The frontend overlays these on the results map when clicking indicator cards. - Add SpatialData dataclass and get_spatial_data() to BaseIndicator - Cache NDVI/MNDWI grids in cropland, vegetation, water indicators - Worker generates map PNGs alongside charts during job processing - New GET /api/jobs/{job_id}/maps/{indicator_id} endpoint - Frontend: MapLibre image overlay with graceful fallback for non-spatial indicators - Fix setuptools package discovery in pyproject.toml Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>85f7c19 -
Initial commit: Aperture platform (extracted from SR4S)
KSvendae74af5