Fix GTFS Flex feed detail map defaulting to bounding box when feed has no routes#112
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…utes Agent-Logs-Url: https://github.com/MobilityData/mobilitydatabase-web/sessions/e2518ce7-973f-4065-a48e-56728012a9ae Co-authored-by: Alessandro100 <18631060+Alessandro100@users.noreply.github.com>
|
|
Agent-Logs-Url: https://github.com/MobilityData/mobilitydatabase-web/sessions/e2518ce7-973f-4065-a48e-56728012a9ae Co-authored-by: Alessandro100 <18631060+Alessandro100@users.noreply.github.com>
There was a problem hiding this comment.
@copilot CoveredAreaMap component should get it's route data passed as a prop and not rely on the store
There was a problem hiding this comment.
Done in bfe0896. Added totalRoutes?: number to CoveredAreaMapProps and replaced the selectGtfsDatasetRoutesTotal store selector with the prop-derived value. FeedView (which already receives totalRoutes from the server-side fetch) now passes it down to CoveredAreaMap. The hasNoRoutes boolean is now computed as totalRoutes !== undefined && totalRoutes === 0.
Agent-Logs-Url: https://github.com/MobilityData/mobilitydatabase-web/sessions/b2b856c6-d6e9-4f2c-b3a4-104dd5c12915 Co-authored-by: Alessandro100 <18631060+Alessandro100@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
*Lighthouse ran on https://mobilitydatabase-p2jfugv8j-mobility-data.vercel.app/ * (Desktop)
*Lighthouse ran on https://mobilitydatabase-p2jfugv8j-mobility-data.vercel.app/feeds * (Desktop)
*Lighthouse ran on https://mobilitydatabase-p2jfugv8j-mobility-data.vercel.app/feeds/gtfs/mdb-2126 * (Desktop)
*Lighthouse ran on https://mobilitydatabase-p2jfugv8j-mobility-data.vercel.app/feeds/gtfs_rt/mdb-2585 * (Desktop)
*Lighthouse ran on https://mobilitydatabase-p2jfugv8j-mobility-data.vercel.app/feeds/gbfs/gbfs-flamingo_porirua * (Desktop)
|
Alessandro100
left a comment
There was a problem hiding this comment.
Ran it locally and it works for the feed /feeds/gtfs/mdb-3081
|
To test visit: https://mobilitydatabase-web-git-copilot-gtfs-flex-82520f-mobility-data.vercel.app/feeds/gtfs/mdb-2290 (a flex feed). Zoom out with your mouse on the map. For this ticket it fixes it in the sense that the detailed map doesn't show up, but another issue arrises with flex feeds -> the bounding box is a point instead of a box (at least for that feed) |
GTFS Flex feeds can have zero routes. When
routes.jsonloads successfully but returns an empty array,CoveredAreaMapwas staying ongtfsVisualizationViewand rendering a blank map instead of falling back to the bounding box.Changes
CoveredAreaMap.tsx: AddedselectGtfsDatasetRoutesTotalselector and ahasNoRoutesderived boolean (status === 'loaded' && total === 0). Both the view-determination effect andenableGtfsVisualizationViewmemo now treat an empty-routes load the same as a failed load — falling back toboundingBoxViewand disabling the visualization toggle.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
download.cypress.io/opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node index.js --exec install(dns block)/opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node dist/index.js --exec install(dns block)If you need me to access, download, or install something from one of these locations, you can either: