Skip to content

fix: accept multiple diffs using cmd+shift+enter#10183

Open
uinstinct wants to merge 2 commits intocontinuedev:mainfrom
uinstinct:accept-diffs
Open

fix: accept multiple diffs using cmd+shift+enter#10183
uinstinct wants to merge 2 commits intocontinuedev:mainfrom
uinstinct:accept-diffs

Conversation

@uinstinct
Copy link
Contributor

@uinstinct uinstinct commented Feb 4, 2026

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

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • [] I've read the contributing guide
  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

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.

  • Bug Fixes
    • Processes one file at a time via processSingleFileDiff; selects the visible/first pending file from VerticalDiffManager.getAllFilesWithDiffs().
    • Keeps remaining diffs visible by setting continue.diffVisible based on leftover handlers; only refocuses input when none remain.
    • Invokes cancelApply only on reject while preserving edit outcome tracking and auto-format detection.

Written for commit e343eb5. Summary will update on new commits.

@uinstinct uinstinct requested a review from a team as a code owner February 4, 2026 07:23
@uinstinct uinstinct requested review from RomneyDa and removed request for a team February 4, 2026 07:23
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 4, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

@uinstinct uinstinct changed the title fix: accept multiple diffs when with cmd+shift+enter fix: accept multiple diffs using cmd+shift+enter Feb 4, 2026
Copy link
Collaborator

@RomneyDa RomneyDa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@uinstinct I think since you can only see one diff at a time it should only accept the current diff

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Feb 4, 2026
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Feb 5, 2026
@uinstinct
Copy link
Contributor Author

@uinstinct I think since you can only see one diff at a time it should only accept the current diff

implemented!

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Fix with Cubic

if (!fileUriToProcess) {
const allFilesWithDiffs = verticalDiffManager.getAllFilesWithDiffs();
if (allFilesWithDiffs.length > 0) {
fileUriToProcess = allFilesWithDiffs[0].fileUri;
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants