Skip to content

fix: allow auto-approve checkbox to be toggled at any time #6061

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

KJ7LNW
Copy link
Collaborator

@KJ7LNW KJ7LNW commented Jul 22, 2025

Context

The auto-approve checkbox was becoming unresponsive and flickering during model responses, preventing users from disabling auto-approval when they realize the model is about to perform unintended actions. This created a critical safety issue where users could not stop unwanted auto-approvals in time-sensitive situations.

Implementation

This fix removes the disabled state from the main auto-approve checkbox and ensures it can always be toggled:

  1. Remove checkbox disabled logic: Eliminated isCheckboxDisabled state that prevented toggling when no options were selected or menu was open
  2. Simplify toggle behavior: The checkbox now always responds to user clicks and sends toggle messages
  3. Add memoization: Wrapped component in React.memo to reduce unnecessary re-renders that cause flickering
  4. Update test coverage: Modified tests to reflect the new always-enabled behavior

How to Test

  1. Open Roo Code and start a conversation
  2. Enable auto-approval for any operations
  3. During a model response, try to disable the auto-approve checkbox
  4. Verify the checkbox responds immediately and toggles state
  5. Test with no options selected - checkbox should still be toggleable
  6. Verify no flickering occurs during normal usage

Safety Impact

This fix ensures users can always disable auto-approval for safety, especially during time-critical situations when the model is actively responding and about to execute unwanted actions.

Fixes #6060


Important

Fixes AutoApproveMenu checkbox to be always toggleable, ensuring user control during model responses.

  • Behavior:
    • Removed isCheckboxDisabled logic in AutoApproveMenu.tsx, allowing the auto-approve checkbox to be toggled at any time.
    • Checkbox now always responds to clicks and sends toggle messages, regardless of selected options.
    • Wrapped AutoApproveMenu component in React.memo to reduce unnecessary re-renders and prevent flickering.
  • Tests:
    • Updated tests in AutoApproveMenu.spec.tsx to reflect the always-enabled checkbox behavior.
    • Added test to ensure checkbox can be toggled even when no options are selected.

This description was created by Ellipsis for fd4c064. You can customize this summary. It will automatically update as commits are pushed.

During model responses, users need the ability to disable auto-approval
for safety when they realize the model is about to perform unintended
actions. The checkbox was previously disabled when no options were
selected or when the menu was open, preventing users from turning off
auto-approval when needed most.

- Remove disabled state from main auto-approve checkbox
- Simplify toggle logic to always allow state changes
- Add memoization to reduce unnecessary re-renders that cause flickering
- Update tests to reflect new always-enabled behavior

This ensures users can always disable auto-approval for safety,
especially during time-critical situations when the model is actively
responding.

Fixes: #6060
Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
@KJ7LNW KJ7LNW requested review from mrubens, cte and jr as code owners July 22, 2025 09:26
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 22, 2025
@KJ7LNW KJ7LNW moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Jul 22, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jul 22, 2025
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PR - Needs Preliminary Review size:S This PR changes 10-29 lines, ignoring generated files.
Projects
Status: PR [Needs Prelim Review]
Development

Successfully merging this pull request may close these issues.

Regression: Auto-approve checkbox becomes unresponsive and flickers during model responses
2 participants