Skip to content

feat(ui): make every pod column sortable - #26

Merged
ErfanY merged 1 commit into
mainfrom
feat/sortable-columns
Jun 25, 2026
Merged

feat(ui): make every pod column sortable#26
ErfanY merged 1 commit into
mainfrom
feat/sortable-columns

Conversation

@ErfanY

@ErfanY ErfanY commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Summary

Sorting was limited to Namespace/Name/Status/Age. Now s steps left-to-right through every column of the current view, and :sort accepts them all:

  • Pods: + Restarts, CPU, %CPU/R, %CPU/L, MEM, %MEM/R, %MEM/L, IP, Node
  • Other kinds: the four universal columns (a pod-only sort is normalized away when you switch kinds)

The active sort column shows its direction arrow in the header (numeric headers included now), and [SORT] uses each column's short label.

:sort <ns|name|status|age|restarts|cpu|cpu/r|cpu/l|mem|mem/r|mem/l|ip|node> [asc|desc]

How it works

  • Entity-derived columns (Restarts/IP/Node) sort in the projector.
  • Metric columns (CPU/MEM + request/limit %s) re-sort in the App layer from the live usage map, recomputed when metrics refresh (a metrics_gen keys the view cache) — so the order is stable between the ~15s refreshes rather than churning each frame.

Testing

  • make validate green (109 tests + release build)
  • tests: cycle order through all pod columns + non-pod normalization; metric sort orders pods by live usage; :sort parsing/labels

🤖 Generated with Claude Code

Sorting was limited to Namespace/Name/Status/Age. Now `s` steps left-to-right
through every column of the current view, and `:sort` accepts them all:

- Pods: + Restarts, CPU, %CPU/R, %CPU/L, MEM, %MEM/R, %MEM/L, IP, Node
- Other kinds: the four universal columns (a pod-only sort is normalized away on
  kind switch)

The active sort column shows the direction arrow in its header (numeric headers
included now), and the [SORT] indicator uses each column's short label.

Entity-derived columns (Restarts/IP/Node) sort in the projector. Metric columns
(CPU/MEM and the request/limit %s) re-sort in the App layer from the live usage
map — recomputed when metrics refresh (a new `metrics_gen` keys the view cache),
so the order is stable between the ~15s refreshes rather than churning.

Tests: cycle order through all pod columns + non-pod normalization; metric sort
orders pods by live usage; `:sort` parsing/labels.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ErfanY
ErfanY merged commit a1880d6 into main Jun 25, 2026
1 check passed
@ErfanY
ErfanY deleted the feat/sortable-columns branch June 25, 2026 23:31
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