Skip to content

[UI/UX] Diff editor always creates a new editor group instead of opening in the current group #2233

@yiliang114

Description

@yiliang114

What happened?

When using qwen-code's edit file feature that requires user confirmation, the VSCode diff editor that pops up always creates a new editor group to display the diff, instead of opening in the user's currently active editor group.

Image

Steps to reproduce

  1. Open qwen-code extension in VSCode
  2. Let qwen-code perform a file edit operation (one that requires confirmation)
  3. Observe where the diff editor opens

Actual behavior: The diff editor always opens in a newly created editor group.

Related: #2097

What did you expect to happen?

The diff editor should open in the user's currently active editor group (or at least have a configuration option to control this behavior), rather than forcibly creating a new group.

This aligns with VSCode's native diff behavior — when using the vscode.diff command, it defaults to opening in the current editor group or an adjacent group, rather than always creating a new one.

Code Analysis

By examining packages/vscode-ide-companion/src/diff-manager.ts and packages/vscode-ide-companion/src/utils/editorGroupUtils.ts, the current implementation logic is:

  1. The showDiff() method attempts to find an editor group to the left of the chat webview
  2. If not found, it calls ensureLeftGroupOfChatWebview() which forcibly creates a new group
  3. Then opens the diff in that new group

Core code at diff-manager.ts:195-203:

```typescript
let targetViewColumn = findLeftGroupOfChatWebview();
if (targetViewColumn === undefined) {
// If there is no left neighbor, create one to satisfy the requirement of
// opening diffs to the left of the chat webview.
targetViewColumn = await ensureLeftGroupOfChatWebview();
}
```

This design intends to open diffs to the left of the chat webview, but when the user's workspace layout doesn't satisfy this condition, it forcibly creates a new group, affecting user experience.

Client information

Client Information

```

/about

╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Status │
│ │
│ Qwen Code 0.12.0 (426e9c2) │
│ Runtime Node.js v22.22.0 / npm 10.9.4 │
│ OS darwin arm64 (24.1.0) │
│ │
│ Auth Alibaba Cloud Bailian Coding Plan │
│ Base URL https://coding.dashscope.aliyuncs.com/v1
│ Model qwen3.5-plus │
│ Sandbox no sandbox │
│ Proxy no proxy │
│ Memory Usage 284.5 MB │
│ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
```

Metadata

Metadata

Assignees

Labels

coding-planIssues related to Coding Planstatus/needs-triageIssue needs to be triaged and labeledtype/bugSomething isn't working as expected

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions