Skip to content

feat(tui): inline diff viewer for file write/edit tools #13

Open

Description

@EngineerProjects

Summary

When the agent proposes a write_file or edit_file operation, display
the diff inline in the terminal before it is applied. The user can accept,
reject, or edit the change without leaving the TUI.

UX

┌─ Edit proposed — internal/agent/profile.go ─────────┐
│  @@ -12,6 +12,7 @@                                   │
│   type AgentProfile struct {                         │
│       ID       string                                │
│  +    AvatarURL string `json:"avatar_url,omitempty"` │
│       Nickname string                                │
│                                                      │
│  [a] accept   [r] reject   [e] edit   [?] help       │
└──────────────────────────────────────────────────────┘
  • Unified diff with syntax highlighting
  • a accept, r reject, e open in $EDITOR, ? help
  • Scrollable for large diffs
  • Works for both write_file (full file) and edit_file (patch)

Acceptance criteria

  • Diff panel appears before file is written/patched
  • Accept applies the change and resumes the agent
  • Reject skips the change and sends a refusal message to the agent
  • Scrollable diff with line numbers and +/- colouring
  • Large diffs (500+ lines) do not freeze the UI
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

    enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions