Skip to content

Add fetch params warning modal#928

Merged
1Blademaster merged 3 commits into
mainfrom
927-add-warning-to-fetching-params-mid-flight
Dec 31, 2025
Merged

Add fetch params warning modal#928
1Blademaster merged 3 commits into
mainfrom
927-add-warning-to-fetching-params-mid-flight

Conversation

@1Blademaster
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings December 22, 2025 10:07
@1Blademaster 1Blademaster linked an issue Dec 22, 2025 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a warning modal that alerts users when they attempt to fetch parameters while the aircraft is armed or flying. The implementation introduces new Redux state to manage the modal visibility and store pending fetch actions, and updates the params component to check the drone's armed/flying status before executing fetch or refresh operations.

  • Added new modal component to warn users about fetching parameters during unsafe conditions
  • Updated Redux slice to manage modal state and pending fetch actions
  • Modified fetch and refresh logic to check armed/flying status before execution

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
gcs/src/redux/slices/paramsSlice.js Added Redux state for fetchParamsWarningModalOpen and pendingFetchAction, along with corresponding reducers and selectors
gcs/src/params.jsx Added armed/flying state checks, created checkArmedOrFlying helper function, refactored fetchParams and refreshCallback to show warning modal when armed/flying, and integrated the new warning modal component
gcs/src/components/params/fetchParamsWarningModal.jsx Created new modal component that displays context-aware warning messages and provides cancel/confirm actions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread gcs/src/components/params/fetchParamsWarningModal.jsx
Comment thread gcs/src/components/params/fetchParamsWarningModal.jsx Outdated
Comment thread gcs/src/params.jsx Outdated
Comment on lines 128 to 133
function executePendingFetch() {
// This is called by the modal when user confirms
dispatch(setFetchingVars(true))
dispatch(emitRefreshParams())
dispatch(setHasFetchedOnce(true))
}
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

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

The function name executePendingFetch is misleading because it doesn't actually execute the pending fetch action stored in Redux state. It only performs the initial fetch operation. Consider renaming it to executeInitialFetch or performFetch to better reflect its actual behavior. Alternatively, if this function should execute the pending action, it needs to be refactored to retrieve and call pendingFetchAction from Redux state.

Copilot uses AI. Check for mistakes.
Comment thread gcs/src/params.jsx Outdated
Comment thread gcs/src/params.jsx Outdated
Comment thread gcs/src/params.jsx Outdated
@1Blademaster 1Blademaster requested a review from a team December 22, 2025 10:24
Copy link
Copy Markdown
Contributor

@NexInfinite NexInfinite left a comment

Choose a reason for hiding this comment

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

Code looks good at works locally, tested on linux.

Image

@1Blademaster 1Blademaster merged commit 8ffbb2e into main Dec 31, 2025
5 checks passed
@1Blademaster 1Blademaster deleted the 927-add-warning-to-fetching-params-mid-flight branch December 31, 2025 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add warning to fetching params mid-flight

3 participants