From 24eb4d1e79be00ced1a3fc0445d52589ab2cfa75 Mon Sep 17 00:00:00 2001 From: timmy Date: Sat, 22 Aug 2026 14:32:08 +0000 Subject: [PATCH] feat: refresh Week capacity with atomic reflow (Closes #1266) --- README.md | 10 +++++-- frontend/dashboard.css | 2 ++ frontend/index.html | 6 ++-- frontend/week-calendar-import.js | 40 +++++++++++++++++++++------ frontend/week-plan.js | 24 ++++++++++++---- tests/test_week_calendar_import.py | 44 ++++++++++++++++++++++++++++++ tests/test_week_plan_frontend.py | 29 ++++++++++++++++++++ 7 files changed, 134 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index bf716a5..724d58a 100644 --- a/README.md +++ b/README.md @@ -193,9 +193,13 @@ work that cannot fit is named and remains in My Work, while missing estimates bl write, and apply stages one durable whole-week transition through the existing conflict-safe sync path. Confirmation remains disabled while duplicates exist or the account-bound week is still syncing. Rapid saves and review moves use one network flight plus a coalesced latest-state delivery, so later staged days -are not stranded behind an earlier request. From the same review, **Set capacity from calendar** reads a local -`.ics` file on-device, unions overlapping busy periods within chosen working hours, and previews seven daily -availability totals before one atomic apply. IANA `TZID` values from Google and Outlook calendars are converted +are not stranded behind an earlier request. From the same review, **Refresh from calendar** reads a local +`.ics` file on-device, unions overlapping busy periods within chosen working hours, and compares every current +capacity with refreshed availability and planned load. If refreshed availability creates an overload, the review +previews the deterministic destination of moved work and reports anything that cannot fit. One explicit +**Apply capacities & reflow** action stages the complete seven-day plan once—there is no transient overloaded +save—and preserves consented free windows alongside the redistributed work. A refresh that already fits keeps +the direct one-write capacity path. IANA `TZID` values from Google and Outlook calendars are converted to the device's local workday, including daylight-saving transitions. Daily and weekly recurrence (`COUNT`, `UNTIL`, `INTERVAL`, and weekly `BYDAY`), `RDATE`/`EXDATE`, and all-day events are evaluated with work bounded to the seven review dates; cancelled and transparent events do not consume capacity. If a time zone is unknown, diff --git a/frontend/dashboard.css b/frontend/dashboard.css index 95c9416..e6c4775 100644 --- a/frontend/dashboard.css +++ b/frontend/dashboard.css @@ -392,6 +392,8 @@ textarea { resize: vertical; min-height: 120px; } .week-capacity-day { display:grid; min-width:0; gap:3px; padding:10px; border:1px solid #31577f; border-radius:10px; background:#10233a; overflow-wrap:anywhere; } .week-capacity-day span { color:#bfdbfe; font-weight:700; } .week-capacity-day small { color:#a9bdd3; } +.week-capacity-day.is-overloaded { border-color:#f59e0b; background:#2a1c12; } +.week-capacity-day .week-capacity-over { color:#fde68a; font-weight:700; } .week-free-times-consent { display:flex; align-items:flex-start; gap:10px; min-width:0; margin:12px 0; padding:10px; border:1px solid #31577f; border-radius:10px; } .week-free-times-consent input { flex:0 0 44px; width:44px; margin:0; } .week-free-times-consent span { display:grid; min-width:0; gap:4px; overflow-wrap:anywhere; } diff --git a/frontend/index.html b/frontend/index.html index b43b620..2bd1f06 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -522,7 +522,7 @@

See what is next and check each day’s load. Edit only when you are ready.

- +