Skip to content

feat(usage): exclude daily breaks from the 5h pace marker#144

Draft
neumie wants to merge 2 commits into
mainfrom
feat/usage-break-exclusion
Draft

feat(usage): exclude daily breaks from the 5h pace marker#144
neumie wants to merge 2 commits into
mainfrom
feat/usage-break-exclusion

Conversation

@neumie

@neumie neumie commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What

Adds a Breaks preference (shared between the Claude and Codex usage widgets): recurring daily time ranges that are excluded from the 5-hour pace marker.

On hour windows the marker now paces the budget over worked time — elapsed / (window − breaks inside it) — so it runs at a steady faster rate than the clock and reaches 100% before reset by the break amount. Net effect: a break leaves you more headroom while you work (you have fewer working hours to spend the same budget). Day/weekly windows are untouched (they keep the working-days reshape).

5h window 09:00–14:00, 1h break 12:00–13:00
 time   clock   marker
 10:00   20%     25%
 12:00   60%     75%
 13:00   80%    100%   ← full once worked hours are spent
 14:00  100%    100%

UI

A stepper-based Breaks section (add / remove, 15-min nudges) in both the Claude and Codex settings panels, writing to the shared usage settings blob alongside working-days (merge-preserving).

Notes

  • Break coverage is computed with calendar arithmetic (DST-safe across the 23h/25h transition days), and overlapping/duplicate ranges are merged so they can't double-count.
  • Stepper clamp bounds are ordered defensively and from_value drops sub-15-min ranges, so a hand-edited/legacy blob can't panic the editor.
  • Includes fix(extensions): ExtensionSettingsStore::update now notifies global observers, so a settings change reaches the live widgets immediately instead of on the next poll tick (also benefits working-days).
  • 19 unit tests (pace math, overlap merge, DST, validation) pass under UTC/Prague/New_York; workspace clippy clean.

🤖 Generated with Claude Code

neumie and others added 2 commits June 18, 2026 14:54
ExtensionSettingsStore::update ran the host setter (which mutates the
settings entity, not the store global), so observe_global watchers —
settings panels and the live usage widgets — never woke and a settings
change only landed on the next poll tick. Touch the global to fire them.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_014gEkgRjtnkrT8nwtymN5N8
Add recurring daily break periods as a shared usage setting. On hour
windows the pace marker paces the budget over worked time (window minus
the breaks inside it), so it runs at a steady faster rate and reaches
100% before reset by the break amount — leaving more headroom while you
work. Day/weekly windows keep the working-days reshape unchanged.

Stepper-based "Breaks" UI (add/remove, 15-min nudges) in both the Claude
and Codex settings panels. Break coverage is computed with calendar
arithmetic (DST-safe) and overlapping ranges are merged so they can't
double-count.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_014gEkgRjtnkrT8nwtymN5N8
@neumie neumie requested a review from matej21 June 18, 2026 13:06
@neumie neumie marked this pull request as draft June 18, 2026 13:40
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