Add on-map controls and in-app downloads panel; improve navigation, motion handling and weather caching - #13
Add on-map controls and in-app downloads panel; improve navigation, motion handling and weather caching#13Capybla wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d25805130f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| fetchConditions(); | ||
| }, [currentPosition]); | ||
| }, [currentPosition, isOnline]); | ||
| }, [currentPosition, isOnline, lastWeatherSnapshot]); |
There was a problem hiding this comment.
Remove self-updating weather snapshot dependency
Including lastWeatherSnapshot in this effect’s dependency list causes a request loop whenever a position is available and the app is online: the effect fetches weather, then calls setLastWeatherSnapshot(...) with a new object (updatedAt: Date.now()), which retriggers the same effect immediately and repeats indefinitely. In practice this will spam /conditions, increase battery/network usage, and can make the UI feel unstable under normal online navigation.
Useful? React with 👍 / 👎.
Motivation
Description
frontend/src/App.cssfor.map-button-controls,.downloads-paneland related download UI elements.MAP_DATASETSand a newDownloadsPanelcomponent infrontend/src/App.jsthat simulates download progress and supports start/pause/reset actions, and included it in the sidebar UI.MapButtonControlscomponent and wired it into the map widget with handlers foronCenterPosition,onToggleSidebar,onStartNavigationandonEndNavigationand conditional enablement based on GPS and selected route.motionDatastate to include barometric fields, throttled motion updates viarequestAnimationFrame, and addedhandleCenterPositionto center the map on the current GPS position.localStorageon success and to use cached data when offline, and adjusteduseEffectdependencies and cleanup accordingly.MapContainerblock and integrated map controls into the draggable map widget.Testing
npm run build, which completed successfully.npm test; the test run completed without failures (no new unit tests were added).npm startto ensure the new controls and downloads panel render and basic interactions work (automated build/dev commands only).Codex Task