Fix auto-approve checkbox state synchronization #4563
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here's the filled-out PR template for this fix:
PR Template - Auto-Approve Checkbox State Synchronization Fix
Related GitHub Issue
Closes: #2579
Description
This PR implements a minimal fix for the auto-approve checkbox state synchronization issue in the chat input menu. The main problem was that the checkbox didn't accurately reflect whether any individual auto-approve actions were enabled.
Key Implementation Details:
hasAnyAutoApprovedActioncomputed value that tracks if any individual toggle is enabledcheckedprop to use this computed value instead of the globalautoApprovalEnabledstateautoApprovalEnabledvariable to resolve ESLint warningsDesign Choice: Used a minimal approach that only modifies the existing component without introducing new hooks, state management, or performance optimizations, keeping the change scope focused and reducing risk.
Test Procedure
Manual Testing Steps:
Automated Testing:
pnpm test- 418 passing, 0 failing)pnpm lint)Type of Change
srcor test files.Pre-Submission Checklist
pnpm lintpasses).console.log) has been removed.pnpm test- 418 passing).mainbranch.npm run changesetif this PR includes user-facing changes or dependency updates.Screenshots / Videos
Before: The main auto-approve checkbox would show inconsistent state - it might be checked even when no individual auto-approve actions were enabled, causing user confusion.


After: The checkbox now accurately reflects the state:
https://youtu.be/5VbPbGeszSk
Documentation Updates
This is a bug fix that doesn't change the intended behavior or add new features, so existing documentation remains accurate.
Additional Notes
AutoApproveMenu.tsx)Get in Touch
Mnehmos
Important
Fixes checkbox state synchronization in
AutoApproveMenu.tsxby using a computed value and adding master toggle functionality.hasAnyAutoApprovedActioncomputed value added to track if any auto-approve toggles are enabled inAutoApproveMenu.tsx.checkedprop updated to usehasAnyAutoApprovedAction.autoApprovalEnabledvariable fromAutoApproveMenu.tsx.This description was created by
for 85a37e6. You can customize this summary. It will automatically update as commits are pushed.