Skip to content

feat: short bar mode for timer widgets#358

Open
t-benoit wants to merge 1 commit intosirmalloc:mainfrom
t-benoit:feat/short-bar-reset-timers
Open

feat: short bar mode for timer widgets#358
t-benoit wants to merge 1 commit intosirmalloc:mainfrom
t-benoit:feat/short-bar-reset-timers

Conversation

@t-benoit
Copy link
Copy Markdown
Contributor

@t-benoit t-benoit commented May 6, 2026

Summary

SessionUsage and WeeklyUsage already support a "short bar" (slider) display mode via the (p)rogress toggle keybind. The three timer widgets in the Usage category did not — their cycle stopped at medium bar. This PR enables slider modes on all of them:

  • BlockTimer
  • BlockResetTimer
  • WeeklyResetTimer

New cycle for each:

time → long bar (32) → medium bar (16) → short bar (10) → short bar (no %) → time

Visual

Block Timer:
Block: 3hr 45m # time
Block [████████████████░░░░░░░░░░░░░░░░] 50.0% # long bar
Block [████████░░░░░░░░] 50.0% # medium bar
Block ▓▓▓▓▓░░░░░ 50.0% # short bar (new)
Block ▓▓▓▓▓░░░░░ # short bar only (new)

Block Reset Timer / Weekly Reset Timer behave identically (different label).

Notes

  • (v)invert fill is now also exposed in slider modes (previously only in progress modes).

Test plan

  • bun run lint (tsc + eslint, 0 warnings)
  • bun test — 1164 tests pass; ~5–6 new tests per widget covering slider rendering (elapsed, slider-only, inverted), the new invert keybind in slider mode, and the short bar / short bar only modifier text. BlockTimer additionally covers the empty-fallback slider rendering
  • Manual TUI check: cycle through all 5 modes via p, toggle v in slider mode, verify hours-only/compact/absolute metadata are stripped on entering bar modes

@t-benoit t-benoit marked this pull request as ready for review May 6, 2026 19:32
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.

1 participant