Skip to content

tui 1/8: engine scaffold, git queue tui command & guards #2

Description

@freshtonic

Parent

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

What to build

The foundation for git queue tui: the subcommand exists, refuses to run in the wrong conditions, and can load the current queue line into a headless engine model — no interactive UI yet. git queue edit is untouched.

  • The tui subcommand is wired into the CLI and dispatched.
  • A headless engine (exposed from the library so tests can drive it in-process) holds the queue-line model: the ordered commit sequence (front/oldest → tip) and the branch boundaries over it, loaded by reusing edit's scope logic (current queue line; an untracked branch opens as one provisional section over trunk).
  • The operations-as-data type is defined (reorder, squash, split, reword, delete, add/remove/move-boundary, rename-branch, undo, redo) even where variants are not yet handled.
  • Guards: errors cleanly when stdout is not a TTY (pointing to git queue edit); requires a clean worktree; bails on an empty queue; refuses a forked line with a clear message (rewriting shared history is out of scope).

Acceptance criteria

  • git queue tui is a recognised subcommand; git queue edit behaviour is unchanged.
  • Running without a TTY exits non-zero with a message directing the user to edit.
  • Running with a dirty worktree, an empty queue, or on a forked line each fails with a distinct, clear message.
  • Engine integration test: loading a multi-branch queue line yields the correct commit sequence and boundary positions, with Stable-Commit-Ids read where present.
  • Engine integration test: an untracked branch loads as a single provisional section over trunk.

Blocked by

  • None — can start immediately.

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