worktrunk icon indicating copy to clipboard operation
worktrunk copied to clipboard

feat(list): configure wt list columns

Open Faria22 opened this issue 5 months ago • 2 comments

What

Adds user-configurable column visibility for wt list via a new [list.columns] user-config section.

The config can now enable or suppress each optional table column by key:

[list.columns]
status = true
head-diff = true
main-commits = true
main-diff = false
summary = false
remote-commits = true
ci = false
path = false
url = true
commit = true
age = true
message = true

Unset keys preserve the current defaults: the ordinary wt list columns stay visible, while the expensive main-diff, summary, and ci columns remain off unless enabled or --full is used. --full still forces the full-mode columns on for a single invocation, even when config disables them.

The path column keeps its existing automatic behavior when unset: it only appears for branch/worktree mismatches. Setting path = true makes it eligible whenever there is path data, and path = false hides it.

Why

wt list --full is intentionally broad: it turns on every expensive/full-mode column at once. That is useful for inspection, but it does not let users build a stable daily view like "show main diff, but keep CI and summaries hidden" or "hide message/path to make the table denser."

This keeps the existing defaults and CLI behavior intact while making the list layout configurable in user config.

Implementation

  • Adds ListColumnsConfig under [list.columns], including merge behavior for user/project override layering and env overrides such as WORKTRUNK__LIST__COLUMNS__MESSAGE=false.
  • Adds ColumnVisibility as the table-render-time policy object, so task selection and layout allocation agree on which columns are eligible.
  • Uses the visibility policy to skip unused expensive tasks (BranchDiff, CiStatus, SummaryGenerate, and URL status when hidden).
  • Preserves the legacy "all columns eligible with automatic path" behavior for picker/statusline-style callers that already pass explicit task skips.
  • Updates wt list and wt config help/docs plus generated mirrors and snapshots.

Verification

  • cargo run -- hook pre-merge --yes in a normal terminal reached the insta/nextest summary with 3,932 passing tests and 2 local timeouts.
  • Re-running the two timed-out tests with GIT_SSH_COMMAND='ssh -o BatchMode=yes -o ConnectTimeout=5' still timed out locally:
    • integration_tests::eval::test_eval_owner
    • integration_tests::list::test_list_json_repo_url_from_ssh_remote
  • The remaining local timeout pattern is limited to tests that rewrite origin to [email protected]:...; this branch does not touch SSH remote handling.
  • Earlier sandbox validation also showed docs/doctests passing, but the full sandbox gate was not usable because PTY and filesystem permission tests failed under Codex sandboxing.

This was written by Codex on behalf of faria.

Faria22 avatar Jun 13 '26 02:06 Faria22

thanks @Faria22

I have been thinking of a general approach here; including a template that would allow for arbitrary vars, will publish something

this is an interesting approach. it's simple and flexible. But I wonder whether it's in an awkward place on the simplicity-flexibility frontier — its main role is in excluding columns. But when are times we want to always exclude a column? is there a specific case that gave you this idea or this is a general bid toward more flexibility?

max-sixty avatar Jun 14 '26 16:06 max-sixty

I noticed myself not really looking at certain columns, like the path or commit hash, but also waiting to see the line diff against main, or the AI summary. So I think having control over every column makes it easy to customize what each person wants to see without changing the default.

Faria22 avatar Jun 14 '26 16:06 Faria22

@worktrunk-bot please draft a changelog and acknowledge @Faria22 as responsible for improvements in this area, even though this specific PR is closed

max-sixty avatar Jun 23 '26 01:06 max-sixty

Here's a draft, @max-sixty.

The work that grew out of this area shipped in 0.61.0 as the custom-columns feature (#3073) — a template-driven [list.custom-columns.<Header>] rather than the boolean per-column toggles here, but the same goal: let people shape wt list without changing the defaults. That entry currently carries no acknowledgment, so the natural place to credit @Faria22 is there.

Proposed edit to the existing 0.61.0 wt list custom columns line — append a thanks clause:

  • wt list custom columns: Each [list.custom-columns.<Header>] entry in user config adds a column to wt list (and the wt switch picker)… The feature is experimental, so the config shape may still change. (#3073, thanks @Faria22, whose #3065 prototyped configurable wt list column visibility and motivated this area)

This matches the existing thanks @user / thanks @user for reporting convention used elsewhere in the changelog (e.g. the 0.60.0 wt step relocate and cargo install entries).

If you'd rather keep the released 0.61.0 section frozen and credit @Faria22 in the next release instead, an alternative is a fresh line under an upcoming ### Improved:

  • Configurable wt list columns: groundwork from @Faria22's #3065 toward per-user wt list column visibility, building on the #3073 custom-columns work.

Happy to open a PR with whichever placement you prefer — just say which.

worktrunk-bot avatar Jun 23 '26 01:06 worktrunk-bot

please PR

max-sixty avatar Jun 23 '26 07:06 max-sixty

Opened #3174 — appends the thanks clause to the 0.61.0 wt list custom columns entry, crediting @Faria22's prototype here. If you'd prefer to keep the released section frozen and credit in the next release instead, let me know and I'll move it.

worktrunk-bot avatar Jun 23 '26 07:06 worktrunk-bot