Skip to content

feat(ui): previous-instance logs toggle (P) - #22

Merged
ErfanY merged 1 commit into
mainfrom
feat/previous-logs
Jun 25, 2026
Merged

feat(ui): previous-instance logs toggle (P)#22
ErfanY merged 1 commit into
mainfrom
feat/previous-logs

Conversation

@ErfanY

@ErfanY ErfanY commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Summary

Closes gap #2 from the k9s parity audit (4.7): previous logs.

In the logs pane, P (shift+p) toggles between the current and the previous (terminated) container instance's logs — equivalent to kubectl logs -p, for debugging crashlooping containers.

  • One-shot fetch: previous logs don't follow and don't auto-reconnect (the container is gone), so the reconnect loop is skipped while previous mode is active.
  • Refetches on toggle (clears the buffer); a fresh log view always starts on the current instance.
  • The logs status line shows instance:current / instance:previous.

The PodLogRequest.previous plumbing already existed (it flows to LogParams { previous, .. }); this PR wires the UI toggle to it and handles the follow/reconnect/tail semantics.

Testing

  • make validate green (102 tests + release build)
  • new test: toggle flips the flag, resets the buffer, and the title reflects the instance

🤖 Generated with Claude Code

In the logs pane, `P` (shift+p) toggles between the current and the previous
(terminated) container instance's logs — `kubectl logs -p`, for debugging
crashlooping containers. Closes gap #2 from the k9s parity audit (4.7).

- One-shot fetch: previous logs don't follow and don't auto-reconnect (the
  container is gone), so the reconnect loop is skipped while previous is active.
- Refetches on toggle (clears the buffer); a fresh log view always starts on the
  current instance.
- Status line shows `instance:current|previous`.

The PodLogRequest.previous plumbing already existed; this wires the UI to it.

Test: toggle flips the flag, resets the buffer, and the title reflects the
instance.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ErfanY
ErfanY merged commit 08f1dc5 into main Jun 25, 2026
1 check passed
@ErfanY
ErfanY deleted the feat/previous-logs branch June 25, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant