Skip to content

Auto-open MergeConflictTab on git merge conflicts with complete resolution workflow#267

Merged
Stasshe merged 8 commits intomainfrom
copilot/implement-merge-conflict-tab
Jan 20, 2026
Merged

Auto-open MergeConflictTab on git merge conflicts with complete resolution workflow#267
Stasshe merged 8 commits intomainfrom
copilot/implement-merge-conflict-tab

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 20, 2026

When git merge encounters conflicts, the system now detects them and automatically opens the MergeConflictTab. Previously, conflicts only displayed a CLI error message without UI integration.

Implementation

MergeConflictDetector (gitOperations/mergeConflictDetector.ts)

  • Compares base/ours/theirs trees via git.walk to identify modified files
  • Reads blob content from git objects with binary file handling
  • Returns structured conflict data for 3-way diff display

GitMergeOperations (gitOperations/merge.ts)

  • Catches MergeNotSupportedError from isomorphic-git
  • Invokes detector and opens tab with conflict data
  • Uses useTabStore.getState() for non-React context access

MergeConflictTabType (tabs/builtins/MergeConflictTabType.tsx)

  • Complete resolution flow:
    1. Save via fileRepository → IndexedDB
    2. Sync to GitFileSystem
    3. Stage files with git.add
    4. Create merge commit

Example Flow

// User runs: git merge feature-branch
// System detects conflict, automatically opens:
await openTab({
  conflicts: [
    {
      filePath: '/src/utils.ts',
      baseContent: '...',
      oursContent: '...',
      theirsContent: '...',
      resolvedContent: '...',
      isResolved: false
    }
  ],
  oursBranch: 'main',
  theirsBranch: 'feature-branch',
  projectId, projectName
}, { kind: 'merge-conflict' });

User resolves in UI → files save through fileRepository → merge commit created.

Original prompt

マージコンフリクト解決タブの実装

MergeConflictTab タイプの型定義を追加 (src/engine/tabs/types.ts)
MergeConflictTabType を実装 (src/engine/tabs/builtins/MergeConflictTabType.tsx)
タブコンポーネントUI MergeConflictResolutionTab.tsx を作成
ビルトインタブにエクスポートを追加
レジストリに登録
型のre-export
翻訳データを全言語に追加 (mergeConflict.*, common.editable)
ファイルリストの幅を調整 (w-64 → w-48)
を追加したは良いものの、git mergeのコマンドで、このシステムを使えていない。コンフリクトが起きたら開くように。


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
@Stasshe Stasshe temporarily deployed to copilot/implement-merge-conflict-tab - pyxis-code PR #267 January 20, 2026 04:33 — with Render Destroyed
@Stasshe Stasshe marked this pull request as ready for review January 20, 2026 04:33
Copilot AI changed the title [WIP] Add implementation for merge conflict resolution tab Auto-open MergeConflictTab on git merge conflicts with complete resolution workflow Jan 20, 2026
Copilot AI requested a review from Stasshe January 20, 2026 04:33
@Stasshe Stasshe merged commit 050777a into main Jan 20, 2026
@Stasshe Stasshe deleted the copilot/implement-merge-conflict-tab branch January 20, 2026 05:47
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