Skip to content

Conversation

@roomote
Copy link

@roomote roomote bot commented Nov 11, 2025

Fixes the issue where clearing the "Max Count" or "Max Cost" fields in Auto-Approve settings would not persist after saving and navigating away.

Problem

When users cleared the Max Count or Max Cost input fields to return to "Unlimited" auto-approvals, the Save button would enable, but after clicking Save and navigating away from settings, the old value would still be present.

Root Cause

The MaxRequestsInput and MaxCostInput components were sending vscode.postMessage immediately on value change (in the handleValueChange callback). This created a race condition where:

  1. User clears the field → undefined is sent via postMessage
  2. User navigates away → field loses focus
  3. FormattedTextField blur handler reformats the display value
  4. The cached state still had the old value, causing it to reappear

Solution

Removed the immediate vscode.postMessage calls from both components. The parent SettingsView component already handles sending all settings via postMessage when the Save button is clicked (line 338-339 in SettingsView.tsx). This ensures:

  • Changes are only persisted when explicitly saved
  • The cached state is the single source of truth until save
  • No race conditions between immediate postMessage and blur handlers

Changes

  • Removed vscode.postMessage from MaxRequestsInput.handleValueChange
  • Removed vscode.postMessage from MaxCostInput.handleValueChange
  • Removed unused vscode import from both files

Testing

  • Existing tests pass (MaxRequestsInput.spec.tsx)
  • Manual testing confirms clearing values now persists correctly

Important

Fixes persistence issue for cleared "Max Count" and "Max Cost" fields in Auto-Approve settings by removing immediate vscode.postMessage calls.

  • Behavior:
    • Fixes issue where clearing "Max Count" or "Max Cost" fields in Auto-Approve settings did not persist after saving.
    • Ensures changes are only sent when Save button is clicked, preventing race conditions.
  • Components:
    • Removed vscode.postMessage from handleValueChange in MaxRequestsInput and MaxCostInput.
    • Removed unused vscode import from both components.
  • Testing:
    • Existing tests pass (MaxRequestsInput.spec.tsx).
    • Manual testing confirms clearing values now persists correctly.

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


Note

Removes vscode.postMessage side-effects from Max Cost/Requests inputs so cleared values persist until explicitly saved.

  • Settings UI:
    • Remove immediate vscode.postMessage calls from handleValueChange in webview-ui/src/components/settings/MaxCostInput.tsx and MaxRequestsInput.tsx.
    • Drop unused vscode imports in both files.
    • Inputs now solely call onValueChange, deferring persistence to the parent save flow.

Written by Cursor Bugbot for commit ceaa3b7. This will update automatically on new commits. Configure here.

@roomote roomote bot requested review from cte, jr and mrubens as code owners November 11, 2025 01:01
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Nov 11, 2025
@roomote
Copy link
Author

roomote bot commented Nov 11, 2025

Rooviewer Clock   See task on Roo Cloud

Re-review completed. No new issues found.

The merge from main includes a significant refactoring of auto-approval logic (moved from ChatView to backend) and improved command parsing. The original fix for clearing Max Count/Max Cost fields remains intact and unaffected.

Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Nov 11, 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 Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

4 participants