[PR #78] [MERGED] feat(tui): refactor to iteration-based architecture with snapshot testing #122

Closed
opened 2026-02-27 10:22:18 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mikeyobrien/ralph-orchestrator/pull/78
Author: @mikeyobrien
Created: 1/20/2026
Status: Merged
Merged: 1/20/2026
Merged by: @mikeyobrien

Base: mainHead: feature/tui


📝 Commits (4)

  • b9297c5 feat(tui): refactor to iteration-based architecture with snapshot testing
  • 3d0e053 fix(tui): clear viewport buffer to prevent artifacts on iteration switch
  • f3db307 fix(tui): autoscroll content and preserve markdown line boundaries
  • 57be8dc fix(tui): remove ellipsis truncation from TUI content

📊 Changes

152 files changed (+17009 additions, -1768 deletions)

View changed files

📝 .claude/commands/verify-behaviors.md (+2 -2)
📝 AGENTS.md (+2 -1)
📝 Cargo.lock (+660 -7)
📝 Cargo.toml (+7 -1)
📝 PROMPT.md (+4 -2)
📝 README.md (+3 -4)
📝 crates/ralph-adapters/Cargo.toml (+12 -0)
📝 crates/ralph-adapters/src/cli_backend.rs (+11 -14)
📝 crates/ralph-adapters/src/lib.rs (+4 -1)
📝 crates/ralph-adapters/src/pty_executor.rs (+174 -55)
📝 crates/ralph-adapters/src/stream_handler.rs (+1134 -0)
📝 crates/ralph-cli/Cargo.toml (+3 -0)
📝 crates/ralph-cli/src/init.rs (+7 -3)
📝 crates/ralph-cli/src/main.rs (+209 -115)
📝 crates/ralph-cli/src/sop_runner.rs (+3 -1)
📝 crates/ralph-core/src/config.rs (+0 -7)
📝 crates/ralph-core/src/lib.rs (+3 -0)
crates/ralph-core/src/text.rs (+108 -0)
crates/ralph-core/src/utils.rs (+71 -0)
📝 crates/ralph-tui/Cargo.toml (+6 -1)

...and 80 more files

📄 Description

Summary

  • Major TUI architecture overhaul - Replace terminal/scroll widgets with unified iteration-based content widget
  • Comprehensive snapshot testing - Add 30+ insta snapshots for header, footer, content, and full layout validation
  • Spec-driven development - Full specs for TUI refactor and observation mode with 14+ implementation tasks
  • E2E test infrastructure - Visual regression testing with TUI behavior tests

Key Changes

TUI Architecture (ralph-tui)

  • New content.rs widget replacing terminal.rs and scroll.rs
  • Iteration buffer for per-iteration state tracking (scroll position, search state)
  • Simplified input handling for pure observation mode
  • Updated header/footer widgets with improved state display

Testing

  • Integration snapshot tests with JSONL fixtures for reproducible scenarios
  • Test fixtures: completion session, hat transitions, long output scrolling, multi-iteration, search
  • E2E behavior tests and visual regression tooling

Specs & Tasks

  • specs/tui-refactor/ - Complete architectural redesign spec
  • specs/tui-observation-mode/ - Observation-only mode spec
  • 22+ code task files for structured implementation

Test plan

  • cargo test -p ralph-tui - All TUI unit and snapshot tests pass
  • cargo test - Full test suite passes
  • Manual TUI testing with cargo run --bin ralph -- run --tui -c <config> -p "test"
  • Verify iteration navigation (h/l keys)
  • Verify search functionality (/pattern, n/N)
  • Verify scroll behavior (j/k/g/G)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mikeyobrien/ralph-orchestrator/pull/78 **Author:** [@mikeyobrien](https://github.com/mikeyobrien) **Created:** 1/20/2026 **Status:** ✅ Merged **Merged:** 1/20/2026 **Merged by:** [@mikeyobrien](https://github.com/mikeyobrien) **Base:** `main` ← **Head:** `feature/tui` --- ### 📝 Commits (4) - [`b9297c5`](https://github.com/mikeyobrien/ralph-orchestrator/commit/b9297c509e444c0d620555aa7fed9f48ef34f0f1) feat(tui): refactor to iteration-based architecture with snapshot testing - [`3d0e053`](https://github.com/mikeyobrien/ralph-orchestrator/commit/3d0e05389afe9a8b7bce44290590c0d2d17386b7) fix(tui): clear viewport buffer to prevent artifacts on iteration switch - [`f3db307`](https://github.com/mikeyobrien/ralph-orchestrator/commit/f3db30716cf31ab1c7d87c7bf860224239081e44) fix(tui): autoscroll content and preserve markdown line boundaries - [`57be8dc`](https://github.com/mikeyobrien/ralph-orchestrator/commit/57be8dc6d693442c5a70b0c534ae61dafc97b450) fix(tui): remove ellipsis truncation from TUI content ### 📊 Changes **152 files changed** (+17009 additions, -1768 deletions) <details> <summary>View changed files</summary> 📝 `.claude/commands/verify-behaviors.md` (+2 -2) 📝 `AGENTS.md` (+2 -1) 📝 `Cargo.lock` (+660 -7) 📝 `Cargo.toml` (+7 -1) 📝 `PROMPT.md` (+4 -2) 📝 `README.md` (+3 -4) 📝 `crates/ralph-adapters/Cargo.toml` (+12 -0) 📝 `crates/ralph-adapters/src/cli_backend.rs` (+11 -14) 📝 `crates/ralph-adapters/src/lib.rs` (+4 -1) 📝 `crates/ralph-adapters/src/pty_executor.rs` (+174 -55) 📝 `crates/ralph-adapters/src/stream_handler.rs` (+1134 -0) 📝 `crates/ralph-cli/Cargo.toml` (+3 -0) 📝 `crates/ralph-cli/src/init.rs` (+7 -3) 📝 `crates/ralph-cli/src/main.rs` (+209 -115) 📝 `crates/ralph-cli/src/sop_runner.rs` (+3 -1) 📝 `crates/ralph-core/src/config.rs` (+0 -7) 📝 `crates/ralph-core/src/lib.rs` (+3 -0) ➕ `crates/ralph-core/src/text.rs` (+108 -0) ➕ `crates/ralph-core/src/utils.rs` (+71 -0) 📝 `crates/ralph-tui/Cargo.toml` (+6 -1) _...and 80 more files_ </details> ### 📄 Description ## Summary - **Major TUI architecture overhaul** - Replace terminal/scroll widgets with unified iteration-based content widget - **Comprehensive snapshot testing** - Add 30+ insta snapshots for header, footer, content, and full layout validation - **Spec-driven development** - Full specs for TUI refactor and observation mode with 14+ implementation tasks - **E2E test infrastructure** - Visual regression testing with TUI behavior tests ## Key Changes ### TUI Architecture (`ralph-tui`) - New `content.rs` widget replacing `terminal.rs` and `scroll.rs` - Iteration buffer for per-iteration state tracking (scroll position, search state) - Simplified input handling for pure observation mode - Updated header/footer widgets with improved state display ### Testing - Integration snapshot tests with JSONL fixtures for reproducible scenarios - Test fixtures: completion session, hat transitions, long output scrolling, multi-iteration, search - E2E behavior tests and visual regression tooling ### Specs & Tasks - `specs/tui-refactor/` - Complete architectural redesign spec - `specs/tui-observation-mode/` - Observation-only mode spec - 22+ code task files for structured implementation ## Test plan - [ ] `cargo test -p ralph-tui` - All TUI unit and snapshot tests pass - [ ] `cargo test` - Full test suite passes - [ ] Manual TUI testing with `cargo run --bin ralph -- run --tui -c <config> -p "test"` - [ ] Verify iteration navigation (h/l keys) - [ ] Verify search functionality (/pattern, n/N) - [ ] Verify scroll behavior (j/k/g/G) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 10:22:18 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ralph-orchestrator#122
No description provided.