Visitar URL original
fix: show a real Changed age on container rows by janosmiko · Pull Request #736 · janosmiko/lfk · GitHub
Skip to content

fix: show a real Changed age on container rows - #736

Merged
janosmiko merged 1 commit into
mainfrom
fix/container-changed-column
Sep 9, 2026
Merged

janosmiko merged 1 commit into
mainfrom
fix/container-changed-column

Conversation

@janosmiko

@janosmiko janosmiko commented Sep 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

The Changed column in the container view was blank on every row. Container items never carried a timestamp changeAt could read, so the cell was always empty and sorting by it compared empty strings. Containers now report the newest container status timestamp.

Type of change

  • feat: new user-facing feature
  • fix: bug fix
  • refactor: code change that neither fixes a bug nor adds a feature
  • docs: documentation only
  • test: add or update tests
  • chore: maintenance (dependencies, tooling)
  • perf: performance improvement
  • ci: CI/CD configuration

Related issue

None. Found while diagnosing container detail rows.

Changes

  • Add Item.ChangedAt, the newest status timestamp for kinds with no conditions.
  • changeAt folds ChangedAt in next to LastRestartAt and the conditions.
  • buildContainerItem sets ChangedAt from the newest of running start, terminated finish, and last terminated finish.
  • Containers set LastRestartAt from the last terminated state with the same rule pods use, so the recent-restart row tint applies to them too.
  • Pod and node Changed values are unchanged.

Testing

  • go build ./... succeeds
  • go test ./... passes (with -race)
  • golangci-lint run passes
  • Manually verified against a real cluster (when behavior changed)

Checklist

  • Commits follow conventional commit style (feat:, fix:, refactor:, docs:, test:, chore:, perf:, ci:)
  • README / docs/ updated when user-visible behavior or config changed (no doc describes the column)
  • docs/keybindings.md and the in-app help screen updated when keybindings changed (none changed)
  • No secrets, tokens, or personal data included in diffs, logs, or screenshots
  • PR is opened from a feature branch on my fork (not from my fork's main)

Container items never carried a timestamp changeAt could read, so the
Changed column in the container view was blank on every row and sorting
by it compared empty strings.

Containers now record the newest container status timestamp (running
start, terminated finish, or last terminated finish) in Item.ChangedAt,
and changeAt folds that in. LastRestartAt is set from the last terminated
state with the same rule pods use, so the recent-restart tint applies to
container rows too. Pod and node behaviour is unchanged.
@coderabbitai

coderabbitai Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 53f210a8-9b94-4b80-b41c-7b68b48b4a0a

📥 Commits

Reviewing files that changed from the base of the PR and between 38e10d7 and 9e128eb.

📒 Files selected for processing (5)
  • internal/app/changed_column.go
  • internal/app/changed_column_test.go
  • internal/k8s/client_crd.go
  • internal/k8s/client_crd_test.go
  • internal/model/types.go

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


Summary by CodeRabbit

  • Bug Fixes
    • Improved container change-time tracking by considering the newest available lifecycle timestamp, including starts, terminations, and restarts.
    • Container status and age information now more accurately reflects the most recent activity.
    • Waiting containers without status history continue to report no change time.

Walkthrough

The change adds ChangedAt to Item. buildContainerItem derives it from running and terminated container timestamps and records the last termination time. changeAt compares ChangedAt with LastRestartAt before evaluating conditions. Tests cover plain, restarted, terminated, and waiting containers, plus change-age selection.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 9e128

Container rows now display and sort by their newest lifecycle timestamp, including restart information, while pod and node behavior remains unchanged. The covered fallback and precedence cases indicate no remaining merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main fix: showing the correct Changed age for container rows.
Description check ✅ Passed The description follows the repository template and explains the bug, implementation, tests, and checklist status. The optional manual real-cluster verification is unchecked, but the required descript…
  • Fix all pre-merge checks with AI

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@janosmiko
janosmiko merged commit eaf73e1 into main Sep 9, 2026
13 checks passed
@janosmiko
janosmiko deleted the fix/container-changed-column branch September 9, 2026 04:14
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