worktrunk icon indicating copy to clipboard operation
worktrunk copied to clipboard

wt list: shortened counts (C, K, ∞) are unexplained, and C is unfamiliar

Open worktrunk-bot opened this issue 3 weeks ago • 1 comments

wt list shortens counts that don't fit their column, and neither the shortened forms nor the reason for them is explained anywhere a user would look. This came up in #4727, where the reporter had to dig through the code to work out what 3C meant.

What it does today

format_overflow shortens values like this:

Value Commit counts (^↕, Remote⇅) Line counts (@±, ^…±)
0–99 exact exact
100–999 1C–9C (hundreds, rounded down) exact
1,000–9,999 1K–9K 1K–9K
10,000+ ∞ ∞

Shortened values are drawn one emphasis level brighter. The exact counts are in wt list --format=json. Columns get fixed widths before any data arrives so the table can draw immediately and fill in cells as git finishes. Commit counts get two digits per side (↑99 ↓99, 7 wide) and line counts get three (+999 -999, 9 wide).

What was raised

  • C is unfamiliar. The reporter would rather see 3xx. That needs the same three digit places as the exact count, though: ↑3C fits the column and ↑3xx doesn't. If commit-count columns got a third digit place, they could show exact counts up to 999 the way line counts already do (↑348), and C would go away. The cost is two more characters each for ^↕ and Remote⇅ (7 → 9).
  • +∞ reads as wrong. It means "10,000 or more", but nothing says so.
  • Width priority. The reporter would rather have these stats wide enough for full values than see the message or path columns in full. That would be a change to how columns are dropped on narrow terminals.
  • Docs. The list docs don't mention C, K or ∞ at all. However the other points are decided, this needs fixing.

Whether to change the rendering is a maintainer decision. The doc gap stands either way.

worktrunk-bot avatar Nov 11 '26 22:11 worktrunk-bot

#4770 covers the doc gap. It adds a paragraph under Columns in wt list --help and the list docs explaining C, K and ∞, the exact-count limits for each kind of column, and that --format=json carries the exact values. CI is green at its head, and it waits on a maintainer to merge.

That PR leaves the rendering alone, and the rest of this issue stays open for those choices: a third digit place for ^↕ and Remote⇅, which would show exact commit counts up to 999 and drop C at a cost of two columns each, and whether the count columns should outlast Message and Path on narrow terminals.

worktrunk-bot avatar Nov 11 '26 23:11 worktrunk-bot