-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat: add granular checkboxes for re-read after edit settings #8929
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
Conversation
Implements issue #8927 - Add option to suggest reviewing changes after file edits. - Added RE_READ_AFTER_EDIT experiment configuration - Updated all file editing tools to suggest review when experiment is enabled - Added UI setting with English translation - Added tests for the new experiment When enabled, the AI will suggest using the read_file tool to review changes after editing files, helping catch errors that might be introduced during editing.
- Added reReadAfterEditGranular experiment with individual toggles for each edit operation type - Updated all file editing tools to check their specific granular setting - Created new ReReadAfterEditGranularSettings UI component with master toggle and individual checkboxes - Maintained backward compatibility with legacy reReadAfterEdit setting that overrides granular settings - Added comprehensive tests for the new granular settings functionality - Added translations for the new UI elements This allows users to selectively enable automatic review for specific edit types like: - Apply Diff (search and replace blocks) - Multi-file Apply Diff - Write to File (complete file rewrites) - Insert Content (add lines to files) - Search and Replace (find and replace text) Addresses Issue #8927 - implements the suggestion to have checkboxes for selecting review based on edit type
Review SummaryI've reviewed the PR and identified 1 issue that needs attention: Issues Found
|
| newSettings[type.key] = checked | ||
| }) | ||
| onGranularChange(newSettings) | ||
| onChange(checked) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The master toggle logic creates a state inconsistency that breaks granular control. When handleMasterToggle is called with checked=true, it sets both the granular settings AND the legacy reReadAfterEdit boolean to true via onChange(checked) on line 46. However, the backend logic in experiments.ts (lines 58-60) gives the legacy setting precedence: if reReadAfterEdit is true, it returns true for ALL edit types regardless of granular settings. This means if a user enables the master toggle then unchecks an individual edit type, that type will still trigger re-read because the legacy boolean remains true and overrides the granular setting. The master toggle should only control granular settings, not the legacy boolean. Remove the onChange(checked) call on line 46, as the legacy setting should remain independent of the granular UI controls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review complete. Found 1 issue that needs to be addressed before this PR can be merged. See inline comment for details.
This PR addresses the enhancement request in Issue #8927 to provide granular control over the re-read after edit feature.
Changes
New Features
reReadAfterEditexperimentImplementation Details
Type System Updates
ReReadAfterEditGranulartype to support granular settingsExperimentstype to include the newreReadAfterEditGranularpropertyRecord<string, boolean | any>Tool Integration
applyDiffTool,multiApplyDiffTool,writeToFileTool,insertContentTool,searchAndReplaceTool) to check their specific granular settingisReReadAfterEditEnabledmethod to the experiments module to handle both legacy and granular settingsUI Components
ReReadAfterEditGranularSettingscomponent with nested checkboxesInternationalization
Testing
Backward Compatibility
reReadAfterEditboolean setting continues to workRelated Issue
Closes #8927
Screenshots
The new UI provides fine-grained control over which edit operations trigger file re-reading:
Testing Instructions
cc @da2ce7
Important
Introduces granular control for re-read after edit settings, allowing specific edit operations to trigger re-read suggestions, with UI and tool updates.
ReReadAfterEditGranularSettings.reReadAfterEditboolean setting.ReReadAfterEditGranulartype and updatedExperimentstype inexperiment.ts.applyDiffTool,multiApplyDiffTool,writeToFileTool,insertContentTool,searchAndReplaceTool) to check granular settings.isReReadAfterEditEnabledmethod inexperiments.ts.ReReadAfterEditGranularSettingscomponent and integrated intoExperimentalSettings.settings.json.experiments-granular.spec.tsandexperiments-reReadAfterEdit.spec.ts.This description was created by
for 8e65a4d. You can customize this summary. It will automatically update as commits are pushed.