feat(tui): scale elapsed time to hours and days - #11
Merged
Conversation
A 90-minute session rendered as 90:30, which reads as a minute count rather than an hour and a half. Past 1h the timer now renders h:mm:ss. The elapsed column widens from 5 to 8 to fit 25:01:02; sub-hour rendering is unchanged. renderCard derives nameMaxW from the rendered width of the right-hand side, so the name column reflows automatically.
A three-day session rendered as 73:15:30, which has the same readability problem as 90:30 did, one scale up. Past 24h the timer now uses kubectl's compact AGE notation (2d3h) — at day scale the seconds are noise. This also makes the column width exact rather than optimistic: the h:mm:ss branch now only covers sub-24h, so its longest value is 23:59:59 (8 chars) and the day branch maxes at 1000d23h (8). Nothing can overflow Width(8) and wrap the card, which a 100h+ session would have done before. Pinned by a test.
hoaitan
approved these changes
Jul 17, 2026
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.
The task card timer rendered a raw minute count, so a 90-minute session read
90:30. It now scales its precision to the duration:05:30(unchanged)1:15:302d3hPast a day, seconds are noise —
73:15:30has the same readability problem as90:30, one scale up. The day format is kubectl's compact AGE notation, which most people already read fluently.Changes
formatElapsedas a pure function, with a table test across every threshold.Width(5)→Width(8).renderCardderivesnameMaxWfromlipgloss.Width(rightStr), so the name column reflows automatically.Why the width is exactly 8
lipgloss wraps rather than truncates when content exceeds
Width, so an over-long value would corrupt the card layout. The formats are bounded so that can't happen:mm:ssmaxes at59:59(5)h:mm:ssonly covers sub-24h, so it maxes at23:59:59(8)NdNhmaxes at1000d23h(8) — i.e. not in this universeTestFormatElapsedFitsColumnpins that invariant.Why not fix it downstream
retask-cli hosts long-lived sandbox sessions, where
90:30is easy to misread as seconds-since-something. It can't fix this on its side:TUIConfigexposes no elapsed-formatting hook, so the format is only reachable here.go test ./...passes.