Skip to content

Convert params to redux#677

Merged
NexInfinite merged 25 commits intorelease-alpha-0.1.10from
alpha-0.1.10/656-convert-params-to-redux
Sep 14, 2025
Merged

Convert params to redux#677
NexInfinite merged 25 commits intorelease-alpha-0.1.10from
alpha-0.1.10/656-convert-params-to-redux

Conversation

@NexInfinite
Copy link
Copy Markdown
Contributor

Moved params page and its components into redux

@NexInfinite NexInfinite requested a review from Copilot September 7, 2025 21:04
@NexInfinite NexInfinite linked an issue Sep 7, 2025 that may be closed by this pull request
@NexInfinite NexInfinite changed the base branch from main to release-alpha-0.1.10 September 7, 2025 21:04
@NexInfinite NexInfinite requested review from Copilot and removed request for Copilot September 7, 2025 21:07
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 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 close function 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.

@1Blademaster
Copy link
Copy Markdown
Member

Have you forgotten to commit the paramSlice.js file?

@NexInfinite
Copy link
Copy Markdown
Contributor Author

Somehow yes what the helly

1Blademaster
1Blademaster previously approved these changes Sep 8, 2025
Copy link
Copy Markdown
Member

@1Blademaster 1Blademaster left a comment

Choose a reason for hiding this comment

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

LGTM, haven't tested locally though

@NexInfinite
Copy link
Copy Markdown
Contributor Author

Can you please test this one locally as it may have breaking changes

@NexInfinite NexInfinite requested a review from Copilot September 11, 2025 23:32
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

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 close function 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.

Comment thread gcs/src/components/params/valueInput.jsx Outdated
Comment thread gcs/src/redux/slices/paramsSlice.js Outdated
@1Blademaster
Copy link
Copy Markdown
Member

1Blademaster commented Sep 12, 2025

Parameters with both a range and values key in the param def should use range and be a number input, not a select. E.g. ACRO_RP_RATE_TC should be a number input, even though it gives values. The values can be displayed on the side or something to help with selection. The best solution would be to have an input where you can EITHER input your number directly OR select one from the dropdown (but no point spending more time on it if it's not easily done via Mantine).
image
image
image

@NexInfinite NexInfinite requested a review from Copilot September 14, 2025 15:30
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

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?.Bitmask but line 101 checks for paramDef?.BitMask. This will cause the bitmask conditional to never execute properly.
import { createSlice } from "@reduxjs/toolkit"

gcs/src/components/params/autopilotRebootModal.jsx:51

  • The close function 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 itemData prop is still being passed to FixedSizeList but the Row component 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.

Comment thread gcs/src/components/params/valueInput.jsx
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

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.

Comment thread gcs/src/redux/middleware/socketMiddleware.js Outdated
Comment thread gcs/src/components/params/valueInput.jsx
Comment thread gcs/src/components/params/rowItem.jsx Outdated
Comment thread gcs/src/components/params/rowItem.jsx Outdated
Comment thread gcs/src/components/params/rowItem.jsx Outdated
Copy link
Copy Markdown
Member

@1Blademaster 1Blademaster left a comment

Choose a reason for hiding this comment

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

LGTM, tested and fixed some bugs + talked on discord

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

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.

Comment thread radio/app/controllers/paramsController.py Outdated
Comment thread gcs/src/components/params/autopilotRebootModal.jsx
Comment thread gcs/src/redux/slices/paramsSlice.js Outdated
Comment thread gcs/src/components/params/valueInput.jsx Outdated
@NexInfinite NexInfinite merged commit 5434170 into release-alpha-0.1.10 Sep 14, 2025
7 checks passed
1Blademaster added a commit that referenced this pull request Sep 28, 2025
* 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>
@1Blademaster 1Blademaster deleted the alpha-0.1.10/656-convert-params-to-redux branch December 8, 2025 19:39
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.

Convert params to redux

3 participants