Skip to content

A way out of the conflict, not just a warning #270

Description

@jamescrosswell

Context

Fourth slice of #133. #267 gave the conflict modal Overwrite and Cancel. Cancel is safe but it's a dead end: you're told the two versions diverged and left to work out what to do about it somewhere else. This slice gives you the two ways out — see the difference, or take theirs.

Depends on #269 (and transitively #268, #267): Reload is #269's reload path, asked for deliberately.

Acceptance criteria

  • The conflict modal's buttons become [ Compare ] [ Overwrite ] [ Reload ] [< Cancel >], with Cancel still focused and Esc still cancelling.
  • Compare closes the modal and opens the Compare to saved diff tab (CommandIds.CompareToSaved, cts) for that file, showing your buffer against what's on disk now. Nothing is written.
  • After Compare, the diff tab is the active tab and has focus.
  • Reload discards the buffer's edits and loads what's on disk — the same reload A clean tab shows what is actually on disk #269 does for a clean tab, so cursor line/column is kept and clamped, the gutter baseline resets, and undo history is cleared. ● and ⚠ both clear. Nothing is written.
  • Reload does not ask a second time. You already chose it in a dialog; a confirm-the-confirm is noise.
  • After a Reload, pressing Ctrl+S immediately is silent — the recorded state is the file that's now there.
  • Overwrite and Cancel behave exactly as Save stops overwriting a file that changed underneath you #267 left them.
  • The modal still fits an 80-column terminal with four buttons.

Implementation notes

Tests

Compare writes nothing and leaves a diff tab active and focused; Reload writes nothing, replaces the buffer with the disk content, clears ● and ⚠, clears undo history, and makes the following save silent; Overwrite and Cancel are unchanged; the scope stack is balanced after each of the four buttons (nothing left pushed).

Out of scope

  • Merging the two versions, or any three-way merge. Compare, overwrite or reload — the user resolves it.
  • A "save as" / "keep both" escape, or writing the buffer to a backup file.
  • Any change to the diff tab itself, or to cts.
  • Changing what the modal says when the tab is clean (it doesn't appear — Save stops overwriting a file that changed underneath you #267).
  • A conflict modal for a deleted file — the next slice, and a different shape.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-team:devClaimed by the a-team Dev

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions