fix: show loading/error state on the velocity heatmap page - #1815
Merged
jonsuguiyama merged 2 commits intoAug 18, 2026
Merged
Conversation
Contributor
Member
Member
|
@all-contributors please add @jonsuguiyama as code contributor :) |
Contributor
|
I've put up a pull request to add @jonsuguiyama! 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


🤖 This PR was written with the help of an AI coding agent (Claude), reviewed and submitted by @jonsuguiyama.
Closes #1483.
Root cause
useVelocityAggregationDataalready returnsloading/errorfrom react-query,and
VelocityHeatmapRectanglesrendered a<div className="err">for it, butthat div is a child of react-leaflet's
MapContainer, which only knows how toposition actual map layers (
Rectangle,Popup,TileLayer, etc.). A plaindiv there never gets a usable position, so it stays invisible in practice even
though the code appears to handle loading/error.
Fix
VelocityHeatmapRectanglesnow reports status via asetStatus?(loading, hasError)callback prop, mirroring the existing
setMinMaxpattern already used for the legend.VelocityHeatmapPageowns the loading/error state and renders it as a normalMUI
Box/CircularProgressoverlay positioned aboveMapShell, outside theLeaflet children tree.
theme.palette.mode), matched tothe exact light/dark values the map legend already uses (
$legend-bg/$legend-bg-darkinmap.scss), so the text has real contrast in both themesinstead of defaulting to the app's text color against a fixed light background.
.errstyle and its now-empty.scssfile.Note
While testing locally, the production
siri_velocity_aggregationAPI endpointhung (timed out) for every date/bounds combination tried, while the rest of the
API responded normally. That looks like a separate backend issue, out of scope
for this fix.
Test plan
npm run lint(tsc + eslint + stylelint + prettier), cleannpx tsc && npx vite build, builds successfullynpx vitest run src/pages/velocityHeatmap, 7/7 existing tests pass