feat: add setting to auto-expand diffs in edit messages#12151
Draft
roomote-v0[bot] wants to merge 1 commit intomainfrom
Draft
feat: add setting to auto-expand diffs in edit messages#12151roomote-v0[bot] wants to merge 1 commit intomainfrom
roomote-v0[bot] wants to merge 1 commit intomainfrom
Conversation
Adds a new "Auto-expand diffs in edit messages" setting under Settings > UI that, when enabled, automatically expands code diffs in "Roo wants to edit this file" chat messages instead of requiring users to click each one. The setting: - Defaults to false (preserving current collapsed behavior) - Respects user toggles (clicking to collapse overrides auto-expand) - Works with all diff tool types (editedExistingFile, appliedDiff, newFileCreated, searchAndReplace, insertContent, etc.) - Diffs still respect the existing 300px max-height with scrollbar Closes #10955
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related GitHub Issue
Closes: #10955
Description
This PR attempts to address Issue #10955 by adding an
autoExpandDiffssetting that automatically expands code diffs in "Roo wants to edit this file" chat messages. This addresses the frustration of having to click on each collapsed diff block while the chat is scrolling.Implementation details:
autoExpandDiffsboolean toGlobalSettingsschema (default:false)ExtensionStatetype so it flows from backend to frontendChatView, diff tool messages are auto-expanded when the setting is enablededitedExistingFile,appliedDiff,newFileCreated,searchAndReplace,insertContent,apply_patch,apply_diff, etc.Files changed:
packages/types/src/global-settings.ts- AddedautoExpandDiffsto schemapackages/types/src/vscode-extension-host.ts- Added toExtensionStatepick typewebview-ui/src/context/ExtensionStateContext.tsx- Added state and settersrc/core/webview/ClineProvider.ts- Broadcast setting in statewebview-ui/src/components/settings/UISettings.tsx- Added checkbox UIwebview-ui/src/components/settings/SettingsView.tsx- Wired setting throughwebview-ui/src/i18n/locales/en/settings.json- Added English locale stringswebview-ui/src/components/chat/ChatView.tsx- Auto-expand logic for diff messagesTest Procedure
Automated tests:
UISettings.spec.tsxwith 3 new tests for the auto-expand checkboxSettingsView.change-detection.spec.tsxandSettingsView.unsaved-changes.spec.tsxfixturesPre-Submission Checklist
Feedback and guidance are welcome.
Interactively review PR in Roo Code Cloud