Skip to content

Fix config states being incorrectly set#1002

Merged
1Blademaster merged 3 commits intomainfrom
1001-config-state-incorrectly-being-set
Feb 25, 2026
Merged

Fix config states being incorrectly set#1002
1Blademaster merged 3 commits intomainfrom
1001-config-state-incorrectly-being-set

Conversation

@1Blademaster
Copy link
Copy Markdown
Member

No description provided.

@1Blademaster 1Blademaster requested review from a team and Copilot February 21, 2026 10:36
@1Blademaster 1Blademaster linked an issue Feb 21, 2026 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 fixes an issue where config states were being incorrectly set as a generic "config" state instead of specific sub-states for individual config pages. The changes implement a more granular state management system using dot notation (e.g., "config.gripper", "config.ftp") to properly track which specific config page the user is on.

Changes:

  • Backend endpoints now enforce specific config sub-states (e.g., "config.gripper") instead of accepting a generic "config" state
  • Frontend layout component now skips setting state for the generic "config" page, allowing individual config components to set their own specific states
  • Tests updated to use the new specific config sub-states

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
radio/app/endpoints/params.py Changed set_multiple_params to only accept "params" state, removed "config" from valid states
radio/app/endpoints/gripper.py Removed state check from getGripperEnabled (called before entering page), kept "config.gripper" check for actual operations
gcs/src/components/layout.jsx Skip emitting state for "config" page since individual config components handle it
gcs/src/components/config/gripper.jsx Set state to "config.gripper" on mount, fixed useEffect dependencies
gcs/src/components/config/ftp.jsx Set state to "config.ftp" on mount with proper useEffect dependencies
radio/tests/test_params.py Removed test for setting params in "config" state (no longer valid)
radio/tests/test_gripper.py Updated state from "config" to "config.gripper"
radio/tests/test_ftp.py Updated state from "config" to "config.ftp"

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

ProgramPhantom added a commit that referenced this pull request Feb 23, 2026
…eware

- Moved error result from endpoint to controller
- Formatted
- Added check to be on config.gripper. I'll test this once #1002 is merged
@1Blademaster 1Blademaster merged commit 4563627 into main Feb 25, 2026
8 checks passed
@1Blademaster 1Blademaster deleted the 1001-config-state-incorrectly-being-set branch February 25, 2026 03:36
ProgramPhantom added a commit that referenced this pull request Feb 27, 2026
* Added enable gripper button

* Created separate gripper enable button and removed the deactivation of the gripper tab

* Added emitRefreshParams to toggleGripperEnabled

* - Added endpoints for enabling and disabling gripper
- Added controllers for setting GRIP_ENABLE
- Think I've wired everything up

* Update gcs/src/components/config/gripper.jsx

Co-authored-by: Kush Makkapati <kush.makkapati@icloud.com>

* Update gcs/src/components/config/gripper.jsx

Co-authored-by: Kush Makkapati <kush.makkapati@icloud.com>

* Update gcs/src/components/config/gripper.jsx

Co-authored-by: Kush Makkapati <kush.makkapati@icloud.com>

* - Changed socket emit names to end in _result
- Added the return of appropriate error message from endpoints and handling in middleware

* - Added tests and formatted. First time doing these tests

* - Moved gripper config refresh to be triggered automatically by middleware
- Moved error result from endpoint to controller
- Formatted
- Added check to be on config.gripper. I'll test this once #1002 is merged

* Fixed ruff formatting

* Try to fix python tests

* Fix tests again

* Added success notifications

* Fixed fetch error of gripper params

* Alternative fix

* - Removed random getGripperEnabled
- Added extra check to only fetch params if gripper enabled

* Turned off initial fetch of gripper config so it only fires if gripper enabled.

* Added getGripperEnabled to dependency list

* - Removed get gripper config from set gripper disabled
- Dispatched emitGetGripperEnabled when gripper page is opened

---------

Co-authored-by: Kush Makkapati <kush.makkapati@icloud.com>
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.

Config state incorrectly being set

3 participants