Skip to content

feat: List Recency Column - #17

Merged
sahil-noon merged 3 commits into
mainfrom
260601-73cv-list-recency-column
Jun 1, 2026
Merged

sahil-noon merged 3 commits into
mainfrom
260601-73cv-list-recency-column

Conversation

@sahil87

@sahil87 sahil87 commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Meta

ID Type Confidence Plan Review
73cv feat 5.0/5.0 15/15 tasks, 0/18 acceptance ✓ 1 cycle

Pipeline: intake ✓ → spec ✓ → apply ✓ → review ✓ → hydrate ✓ → ship → review-pr

Impact: +267/−9 code (excluding fab/, docs/) · +973/−34 total

Summary

wt list defaults to recency order for human output, but the relative-time value was only rendered under --status. In the default recency-ordered view the rows were sorted newest-first with no time column, so the sort key was invisible — users saw an order but could not tell whether the top entry was touched minutes or weeks ago. This change renders the recency sort key (already computed and previously discarded) as a Last Active column at zero additional stat cost.

Changes

  • Render a Last Active column in the non-status recency view (default human view and explicit --sort=recent), as a 4-column Name / Branch / Last Active / Path table using the existing relativeTime() buckets.
  • Persist the recency sort key into LastActive: sortEntries writes the key it already computes back into entries[i].LastActive, gated by a new persistKey bool (caller passes !jsonOut); the main worktree gets a single wt.RecencyOf populate on the human path.
  • Thread the sort mode into the rendering decision: handleFormattedOutput gains a sortMode param and a new 4-column branch; name/branch modes stay 3-column and --status stays 5-column.
  • Explicitly unchanged: --json / --non-interactive still omit last_active unless --status and keep stable name default order; the machine-readable contract is untouched.

sahil87 added 2 commits June 1, 2026 06:41
Render a Last Active relative-time column in wt list's recency-ordered
human view (default human view and explicit --sort=recent), so users can
see how recent each worktree is. Previously the rows were recency-sorted
with no visible time.

Persist the recency sort key that sortEntries already computes (and
previously discarded) into entries[i].LastActive, gated by a new
persistKey bool (caller passes !jsonOut) so JSON output is unaffected.
The main worktree gets a single wt.RecencyOf populate on the human path.
handleFormattedOutput gains a sortMode param and a new 4-column branch
(Name/Branch/Last Active/Path). name/branch modes stay 3-column;
--status stays 5-column; --json/--non-interactive are unchanged (still
omit last_active unless --status, still default to stable name order).
Reuses the existing relativeTime() buckets.

Updated 2 existing tests and added 6 new tests; go test ./... green,
go vet clean. Memory contracts (list-status-contract.md,
recency-ordering-contract.md) updated.
@sahil-noon
sahil-noon marked this pull request as ready for review June 1, 2026 01:14
@sahil-noon
sahil-noon merged commit 3a682ce into main Jun 1, 2026
1 check passed
@sahil-noon
sahil-noon deleted the 260601-73cv-list-recency-column branch June 1, 2026 01:50
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.

2 participants