Skip to content

Restore the three-way merge editor behind an opt-in setting - #7

Merged
boyan01 merged 1 commit into
boyan01:mainfrom
tranphucbol:feature/restore-merge-editor
Oct 20, 2026
Merged

boyan01 merged 1 commit into
boyan01:mainfrom
tranphucbol:feature/restore-merge-editor

Conversation

@tranphucbol

@tranphucbol tranphucbol commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

1. Purpose & Motivation

Description

Refs #6

39b8aac removed the three-way merge editor. Without it, conflicts can only be resolved in the standard VS Code editor with conflict markers. As agreed in #6, this PR brings the editor back as an opt-in feature behind intelli-git.mergeEditor.enabled, which defaults to false.

The PR is a plain git revert of 39b8aac, so the restored code matches what was removed and can be reviewed against it. The follow-ups from #6 are left for a separate PR so this diff stays a clean revert: loading Monaco only in the resolver's own webview, and rewording the conflict section of AGENTS.md for the opt-in setting.

Context & Flow

Click conflict file in Commit view
      │
      ├── [OLD] rpc.openFile() → standard VS Code editor with conflict markers
      │
      └── [NEW] rpc.openConflictResolver() → openConflictFile()
                  │
                  ├── mergeEditor.enabled = false (default)
                  │       └── vscode.open → standard VS Code editor (same as today)
                  │
                  └── mergeEditor.enabled = true
                          └── ConflictResolverPanel (editor-area webview, one per file)
                                  │
                                  ├── getConflictFileContent → git index stages 1/2/3 + worktree result
                                  │
                                  ├── Accept Left / Accept Right → resolveConflict → git add
                                  │
                                  └── Apply → saveConflictResolution
                                          ├── stage signature or result changed → reject, panel stays open
                                          └── unchanged → write result, git add, refresh Commit view

2. Verification & Testing

Provide reproducible inputs or steps for each test case, followed by the result and supporting evidence.

  • npm run compile, npm run lint and npm run test pass on the branch

    Compile and lint pass, including the webview l10n audit (69 files, 329 keys). Tests: 219 extension tests and 109 webview tests pass.

  • With intelli-git.mergeEditor.enabled on, clicking a conflict file opens the three-way editor in the editor area

    Extension Development Host with the merge-conflict fixture (UU, UD, DU, AA). Clicking multiple-conflicts.txt opens Merge: multiple-conflicts.txt with 8 unresolved changes.

    on-1-three-way.png

  • With the setting on, a delete/modify conflict shows which side deleted the file

    delete-on-feature.txt (UD) shows the incoming side as deleted, and the footer offers Accept Right (delete file).

    on-2-delete-modify.png

  • With the setting on, Accept Left resolves and stages the file

    Accept Left on src/conflict.txt closes the panel, stages the file with the current-branch content, and the Conflicting Changes count drops from 5 to 4.

    on-3-accept-left-resolved.png

  • With the setting off (default), clicking a conflict file opens the standard VS Code editor

    multiple-conflicts.txt opens in the standard text editor with conflict markers and the built-in CodeLens actions, same as current main.

    off-standard-editor.png

This reverts commit 39b8aac.

- Restore the Monaco-based three-way conflict resolver and the
  intelli-git.mergeEditor.enabled setting as the starting point for
  bringing the editor back as an opt-in feature (boyan01#6).
- Follow-up commits will keep it default-off, load Monaco only in the
  resolver's own webview so the commit and log views keep the strict CSP
  and small bundle, and keep the standard-editor flow when the setting
  is off.
@boyan01
boyan01 merged commit 742bba0 into boyan01:main Oct 20, 2026
3 checks passed
@boyan01

boyan01 commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Thanks for restoring it and for the thorough before/after evidence! Merged.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants