Skip to content

Add on-map controls and in-app downloads panel; improve navigation, motion handling and weather caching - #13

Open
Capybla wants to merge 1 commit into
codex/Paraweatherfrom
show-app-preview
Open

Add on-map controls and in-app downloads panel; improve navigation, motion handling and weather caching#13
Capybla wants to merge 1 commit into
codex/Paraweatherfrom
show-app-preview

Conversation

@Capybla

@Capybla Capybla commented Apr 29, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Provide quick, on-map controls for centering, toggling the sidebar and starting/stopping navigation to improve UX while flying.
  • Allow users to download terrain and airspace datasets in-app for offline use.
  • Improve sensor/motion update performance and persist a minimized weather snapshot for offline fallback.

Description

  • Added styles in frontend/src/App.css for .map-button-controls, .downloads-panel and related download UI elements.
  • Introduced MAP_DATASETS and a new DownloadsPanel component in frontend/src/App.js that simulates download progress and supports start/pause/reset actions, and included it in the sidebar UI.
  • Added MapButtonControls component and wired it into the map widget with handlers for onCenterPosition, onToggleSidebar, onStartNavigation and onEndNavigation and conditional enablement based on GPS and selected route.
  • Extended motionData state to include barometric fields, throttled motion updates via requestAnimationFrame, and added handleCenterPosition to center the map on the current GPS position.
  • Enhanced weather fetch logic to save a minimized snapshot to localStorage on success and to use cached data when offline, and adjusted useEffect dependencies and cleanup accordingly.
  • Removed an obsolete standalone MapContainer block and integrated map controls into the draggable map widget.

Testing

  • Ran the project build with npm run build, which completed successfully.
  • Executed the test suite with npm test; the test run completed without failures (no new unit tests were added).
  • Verified the development server with npm start to ensure the new controls and downloads panel render and basic interactions work (automated build/dev commands only).

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread frontend/src/App.js
fetchConditions();
}, [currentPosition]);
}, [currentPosition, isOnline]);
}, [currentPosition, isOnline, lastWeatherSnapshot]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant