fix: accept multiple diffs using cmd+shift+enter#10183
fix: accept multiple diffs using cmd+shift+enter#10183uinstinct wants to merge 2 commits intocontinuedev:mainfrom
Conversation
RomneyDa
left a comment
There was a problem hiding this comment.
@uinstinct I think since you can only see one diff at a time it should only accept the current diff
implemented! |
There was a problem hiding this comment.
2 issues found across 2 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="extensions/vscode/src/diff/vertical/manager.ts">
<violation number="1" location="extensions/vscode/src/diff/vertical/manager.ts:159">
P2: The global document change listener is always disposed in clearForfileUri even when other file diffs remain, so multi-file diff tracking stops for remaining files. The listener should only be disabled when no diffs remain.</violation>
</file>
<file name="extensions/vscode/src/diff/processDiff.ts">
<violation number="1" location="extensions/vscode/src/diff/processDiff.ts:102">
P2: Multi-diff acceptance is no longer implemented: the code now selects only the first file from getAllFilesWithDiffs and processes a single diff, which contradicts the PR objective to accept multiple diffs.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
|
||
| this.disableDocumentChangeListener(); | ||
|
|
||
| const hasRemainingDiffs = this.fileUriToHandler.size > 0; |
There was a problem hiding this comment.
P2: The global document change listener is always disposed in clearForfileUri even when other file diffs remain, so multi-file diff tracking stops for remaining files. The listener should only be disabled when no diffs remain.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At extensions/vscode/src/diff/vertical/manager.ts, line 159:
<comment>The global document change listener is always disposed in clearForfileUri even when other file diffs remain, so multi-file diff tracking stops for remaining files. The listener should only be disabled when no diffs remain.</comment>
<file context>
@@ -156,16 +156,19 @@ export class VerticalDiffManager {
this.disableDocumentChangeListener();
+ const hasRemainingDiffs = this.fileUriToHandler.size > 0;
void vscode.commands.executeCommand(
"setContext",
</file context>
| if (!fileUriToProcess) { | ||
| const allFilesWithDiffs = verticalDiffManager.getAllFilesWithDiffs(); | ||
| if (allFilesWithDiffs.length > 0) { | ||
| fileUriToProcess = allFilesWithDiffs[0].fileUri; |
There was a problem hiding this comment.
P2: Multi-diff acceptance is no longer implemented: the code now selects only the first file from getAllFilesWithDiffs and processes a single diff, which contradicts the PR objective to accept multiple diffs.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At extensions/vscode/src/diff/processDiff.ts, line 102:
<comment>Multi-diff acceptance is no longer implemented: the code now selects only the first file from getAllFilesWithDiffs and processes a single diff, which contradicts the PR objective to accept multiple diffs.</comment>
<file context>
@@ -94,31 +94,30 @@ export async function processDiff(
+ if (!fileUriToProcess) {
+ const allFilesWithDiffs = verticalDiffManager.getAllFilesWithDiffs();
+ if (allFilesWithDiffs.length > 0) {
+ fileUriToProcess = allFilesWithDiffs[0].fileUri;
+ streamId = allFilesWithDiffs[0].streamId;
+ }
</file context>
Description
When using cmd+shift+enter to accept diffs, accept all the diffs generated during multi_edit instead of accepting only the first one.
AI Code Review
@continue-reviewChecklist
Screen recording or screenshot
fix.mp4
Tests
[ What tests were added or updated to ensure the changes work as expected? ]
Continue Tasks:▶️ 1 queued — View all
Summary by cubic
Cmd+Shift+Enter now accepts all pending diffs in the visible file, not just the first block. Other files with diffs stay open so you can accept them next.
Written for commit e343eb5. Summary will update on new commits.