feat(tui): service history pane with one-press rollback#1
Merged
Conversation
New top-level TUI view: from any service detail, press `H` to open
the deploy history for that service. Lists every yoink-managed
container (running + exited) across every host, sorted newest-first,
with `when / version / state / host / container / deployed-by`
columns — same data the `yoink history` CLI surfaces.
The selected row is a rollback target. Press `r` to open the
existing reconcile-confirm modal pinned to that row's version, then
`y` / Enter to fire — the rest of the flow (lock, snapshot, swap,
healthcheck, status table) is the same path `yoink up` uses today.
The history pane refuses to "rollback" to a currently-running row
(no-op surprise); operators can still press `U` from Services to
redeploy the current spec.
Implementation:
- New `tui/history.rs` module with the state struct + render.
- `View::ServiceHistory(name)` enum variant + breadcrumb +
per-view help text.
- `Update::ServiceHistory { service, rows }` arrives via the
existing background-update channel.
- `schedule_history_refresh` fans out per-host
`list_containers_by_label("yoink.service=<name>")`, exactly
mirroring `cmd_history`.
- Key handler in `View::ServiceHistory`: j/k navigate, `r`
rollback (sets `reconcile_target`), `R` refresh, esc back.
Tests: 4 unit tests covering apply-sort, stale-result guard,
rollback-target skip-on-running, and selection wrapping.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ships as v0.4.0 (tag already pushed). Closes #62.
What
New top-level TUI view: from any service detail, press
Hto open the deploy history for that service. Lists every yoink-managed container (running + exited) across every host, sorted newest-first, withwhen / version / state / host / container / deployed-bycolumns.Press
ron a stopped row to open the existing reconcile-confirm modal pinned to that row's version →yto roll back. Same pathyoink upuses today, just with an explicit--tagoverride. Refuses to 'rollback' to a currently-running row.Test
cargo test --lib— 140 passed (4 new intui::history::tests)cargo clippy --workspace --all-targets -- -D warnings— cleanyoink history apiagainst backtrack-eu-1 (same query the new pane uses)Roadmap
This is v0.4.0 of a sequence: