Convert params to redux#677
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the parameters page and its components to use Redux for state management, replacing local React state with centralized Redux slices. This improves state consistency and enables better data flow throughout the application.
- Converts local state management to Redux with a new
paramsSlice - Refactors socket event handling to use Redux middleware
- Simplifies component prop passing by utilizing Redux selectors
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| gcs/src/redux/store.js | Adds paramsSlice to store configuration and improves code formatting |
| gcs/src/redux/middleware/socketMiddleware.js | Integrates parameter-specific socket event handlers and cleanup |
| gcs/src/redux/middleware/emitters.js | Adds parameter-related socket emitters |
| gcs/src/params.jsx | Converts from local state to Redux selectors and actions |
| gcs/src/components/realtimeGraph.jsx | Minor optimization in time formatting logic |
| gcs/src/components/params/paramsToolbar.jsx | Migrates to Redux state management |
| gcs/src/components/params/autopilotRebootModal.jsx | Converts to Redux-based modal state |
Comments suppressed due to low confidence (1)
gcs/src/components/params/autopilotRebootModal.jsx:1
- The
closefunction is undefined. It should be() => dispatch(setAutoPilotRebootModalOpen(false))to match the onClose handler.
/*
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Have you forgotten to commit the paramSlice.js file? |
…thub.com/project-Falcon/FGCS into alpha-0.1.10/656-convert-params-to-redux
|
Somehow yes what the helly |
1Blademaster
left a comment
There was a problem hiding this comment.
LGTM, haven't tested locally though
|
Can you please test this one locally as it may have breaking changes |
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (2)
gcs/src/components/params/autopilotRebootModal.jsx:54
- The
closefunction is not defined. It should be replaced with() => dispatch(setAutoPilotRebootModalOpen(false))to close the modal.
<Button
onClick={close}
color={tailwindColors.red[600]}
className="mt-4"
>
gcs/src/components/params/valueInput.jsx:80
- For consistency with the Select component above, this should also sanitize the input:
onChange={(value) => onChange(sanitiseInput(value), param)}
onChange={(value) => onChange(value, param)}
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (3)
gcs/src/redux/slices/paramsSlice.js:1
- The property name is inconsistent. Line 108 references
paramDef?.Bitmaskbut line 101 checks forparamDef?.BitMask. This will cause the bitmask conditional to never execute properly.
import { createSlice } from "@reduxjs/toolkit"
gcs/src/components/params/autopilotRebootModal.jsx:51
- The
closefunction is not defined in this component scope. It should be() => dispatch(setAutoPilotRebootModalOpen(false))to match the modal's onClose handler.
onClick={close}
gcs/src/params.jsx:1
- The
itemDataprop is still being passed toFixedSizeListbut theRowcomponent no longer expects or uses this data. This should be removed since the component now uses Redux state directly.
/*
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
1Blademaster
left a comment
There was a problem hiding this comment.
LGTM, tested and fixed some bugs + talked on discord
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
* bruhe i hate ai * moved as much to redux as possible - now need to work on socket * fixed wrong export * moved sockets and emitters over * moved more components to redux (i love redux this is fun) * formatted and cleaned up * no idea how this was missed * Fixed dropdowns for everything but floats * Fixed the things :D (no idea why it was erroring in the first place) * formatted * ai stuff * fixed sync bug * i hate js so much why does this language exist * formatted * cleaned up * cleaned up * fixed params when modified back to initial state * Fix some bugs with params * Address copilot review comments * Fix param refresh bug * Fix mypy issue, address copilot review comments, fix params tests --------- Co-authored-by: Kush Makkapati <kush.makkapati@icloud.com>



Moved params page and its components into redux