Skip to content

feat: factor weeklyProgressWorkDays into pace calculation #1356

@pstanton237

Description

@pstanton237

Summary

The existing weeklyProgressWorkDays setting (added in #1096 / PR #1102) segments the weekly progress bar visually, but does not affect the pace calculation itself. Users who work only on weekdays (e.g. 5 days/week) see misleading pace indicators throughout the week:

Day (5-day user) 7-day linear expected Actual usage Pace verdict
Wednesday 42.9% 60% 17% deficit
Friday 71.4% 100% 29% deficit
Saturday 85.7% 100% 14% deficit

A user consuming 100% by Friday is using their quota exactly as planned across 5 work days, yet the current model reports a large deficit all week.

Proposed behavior

When weeklyProgressWorkDays is set (e.g. 5), the pace expected curve should distribute 100% across only the configured work days rather than uniformly across 7 calendar days:

Day (5-day model) Expected Actual Verdict
Wednesday 60% 60% on pace
Friday 100% 100% on pace
Saturday 100% 100% on pace

On non-work days, the expected curve should remain flat (no additional expected usage).

Implementation notes

UsagePace.weekly() currently computes:

let expected = ((elapsed / duration) * 100).clamped(to: 0...100)

This could be replaced with a workday-aware calculation when workDays is provided, distributing expected usage only across work-day hours within the window.

The weeklyProgressWorkDays value is already available in settings — it just needs to be threaded into the pace calculation path.

Context

Follow-up to #1096 which added visual segmentation. This completes the feature by making the pace indicator workday-aware.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions