Skip to content

tui 3/8: boundary edits, undo/redo, quit-guard & exit #4

Description

@freshtonic

Parent

#1 — git queue tui — interactive queue/history editor (TUI)

What to build

The first (safe, ref-only) mutations, plus the undo/redo and exit machinery every later operation reuses. Branch boundary edits move refs only — no commit is rewritten (the same safety git queue edit has).

  • Boundary operations in the view: rename a branch, add a boundary (split a branch in two), remove a boundary (dissolve a branch into its neighbour), shift a boundary (move commits between adjacent branches).
  • Immediate mutation: each operation applies to real git state at once; the panes re-render to the true state.
  • Undo/redo stack: before each operation, snapshot all queue-line refs and queue metadata (parent pointers, cached PR numbers); undo restores it, redo mirrors it; unlimited within the session, session-scoped, with git reflog as the durable backstop.
  • Quit-guard: exiting with operations on the stack prompts to confirm.
  • Exit behaviour: HEAD returns to the launch branch at its new tip (or nearest surviving neighbour if dissolved); print the new branch layout and remind the user to run git queue sync.

Acceptance criteria

  • Rename / add / remove / shift boundary each work in the view and change branch refs without rewriting any commit (Stable-Commit-Ids unchanged).
  • Every operation is immediately reflected in the panes and in the repo.
  • Undo restores the exact prior refs and metadata; redo reapplies; both work across a sequence of operations.
  • Quitting with pending operations prompts to confirm.
  • On quit, HEAD lands sensibly and the layout + sync reminder are printed.
  • Engine integration tests cover each boundary op and undo/redo restoring exact state.

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentSpec is ready to be picked up by an implementing agent

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions