Skip to content

Feature: Merge Conflict Resolution UI (3-way merge editor) #23

@zelon

Description

@zelon

Overview

Currently, WimyGit only displays conflicted files as a plain diff when a merge conflict occurs. Adding an intuitive 3-way merge editor would significantly improve the conflict resolution workflow.

Proposed Features

3-way Merge Editor

  • Three panels — Ours / Base / Theirs — plus a Result panel
  • Visual highlighting of conflict blocks in each panel
  • One-click resolution of conflict markers (<<<<<<<, =======, >>>>>>>) to select ours/theirs
  • Inline buttons in VS Code / IntelliJ style: Accept Ours / Accept Theirs / Accept Both
  • Manual editing support (direct editing in the Result panel)

Conflicted File Navigation

  • Display conflicted files as a separate group in the Pending tab (with a ⚠️ icon)
  • Automatically open the merge editor when a conflicted file is clicked
  • Guide the user to stage and commit after all conflicts are resolved

Resolution Completion

  • Automatically run git add on a file once all conflicts are resolved
  • Show a warning if unresolved conflict markers remain in the file

Expected UX Flow

Merge/rebase conflict occurs
  → "Conflicts (N files)" section appears in the Pending tab
  → Click a file → 3-way Merge Editor opens
  → Select ours/theirs or edit manually
  → Click "Mark as Resolved" → file is staged via git add
  → All files resolved → "Continue Merge" button becomes active

Implementation Notes

  • Frontend: New MergeEditorPanel component (React), extending DiffViewer.tsx / InteractiveDiffViewer.tsx
  • Backend: Detect conflicted files via git diff --diff-filter=U, add conflict section parsing logic under src-tauri/src/parsers/
  • Related files:
    • src/components/tabs/PendingTab.tsx
    • src/components/shared/DiffViewer.tsx
    • src-tauri/src/parsers/status.rs

Related Features

  • Applicable to conflicts during cherry-pick and rebase as well
  • Expected synergy when Interactive Rebase UI is implemented

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions