Repository navigation
feat: List Recency Column - #17
Merged
Merged
Conversation
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
marked this pull request as ready for review
June 1, 2026 01:14
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.
Meta
Pipeline: intake ✓ → spec ✓ → apply ✓ → review ✓ → hydrate ✓ → ship → review-pr
Impact: +267/−9 code (excluding
fab/,docs/) · +973/−34 totalSummary
wt listdefaults 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 aLast Activecolumn at zero additional stat cost.Changes
Last Activecolumn in the non-status recency view (default human view and explicit--sort=recent), as a 4-columnName / Branch / Last Active / Pathtable using the existingrelativeTime()buckets.LastActive:sortEntrieswrites the key it already computes back intoentries[i].LastActive, gated by a newpersistKey bool(caller passes!jsonOut); the main worktree gets a singlewt.RecencyOfpopulate on the human path.handleFormattedOutputgains asortModeparam and a new 4-column branch;name/branchmodes stay 3-column and--statusstays 5-column.--json/--non-interactivestill omitlast_activeunless--statusand keep stablenamedefault order; the machine-readable contract is untouched.