feat(rota): catch up on every blank day since the last log - #48
Open
davidvornholt wants to merge 1 commit into
Open
davidvornholt wants to merge 1 commit into
davidvornholt wants to merge 1 commit into
Conversation
The Today prompt dropped gaps older than a week and vanished once today was logged, and it could only fill one day at a time. The gap now has no horizon and stays visible until the days are filled or today is behind you; several blank days lead to /history/catch-up, where every day since the last log is filled in from the day before or by hand and saved in one request. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.
Before. When a few days went by without logging an outfit, the Today page offered to fill in only the first blank day, one tap at a time, and only while today itself was still unlogged. Once the last log was more than seven days old the prompt disappeared entirely, so a week away left the gap invisible; the only way to fill those days was to open each one from the History calendar. Blank days also make the rotation forget which garments were "still on", so the next proposals were worse than they needed to be.
Now. The Today page names the whole gap since the last logged day, with no age limit, whether or not today is already logged, and offers to leave it blank. A single blank day keeps the one-tap "Same as Thu"; several blank days link to a new page,
/history/catch-up, which lists every blank day oldest first with its stored weather and occasion note as memory aids, a "Same as " button that copies the previous day's picks, and the four slot pickers. One "Save N days" writes every day with a garment picked in one request; days left blank stay blank. A wardrobe that was never used has no gap, so nothing is shown.Implementation
shared/data/wear-log-gap.tsdefines the gap once (lastLoggedDayBefore,unloggedDaysBefore) for both the rota and history features.TodayView.unloggedDaysbecomesunlogged: UnloggedGap | null; the 7-daybackfillHorizonDaysand theworn === nullgate are gone.logDaysFn(rota) writes several past days asbackfillthroughProposalService.logOutfit, rejecting today/future dates and duplicates.catchUpFn(history) loads the blank days, the last outfit, notes via a newDayNoteRepository.readRange, and the slot choices shared withdayFn.DayPage's slot select and choice helpers moved intoslot-picker.tsx,day-choice.ts, andweather-line.tsso the catch-up page reuses them unchanged.tsr generatefor/history/catch-up.Screenshots
Demo fixture data; 1280px viewport.
Today with three blank days: before, only the first day is offered; after, the whole run is named and leads to the catch-up page. The base fixture was given the same three-day gap for the before shot.
One blank day keeps the one-tap copy; "Something else" now opens the catch-up page.
New
/history/catch-uppage after "Same as Thursday" on Friday and "Same as Friday" plus a different top on Saturday; Sunday left blank. No before: the page is new.Verification
Completed checks
bun run check:standards check, lint, check-types, test, and build passed for all workspaces (199 unit tests pass, including newwear-log-gap.test.tsandcatch-up-choices.test.ts).test:a11yinsidebun run checkfailed with 22page.goto30s timeouts across pre-existing specs while the machine's load average was above 50 from unrelated processes; rerun serially withplaywright test --workers=1: 50 passed, 0 failed (includes the newcatch-up.a11y.tsand two newtoday.a11y.tscases on both desktop and mobile projects).LD_LIBRARY_PATH=/run/current-system/sw/share/nix-ld/lib; that is a local environment matter, not a repository change.Check it yourself
gh pr checkout feat/catch-up-unlogged-days,bun install,bun run dev, sign in./history/<yesterday>). Open/: the bordered prompt names the blank days regardless of whether today is logged./history/catch-up. Press "Same as " on the first day, change a slot on the second, leave the rest blank, and press "Save N days": you return to Today and the prompt is gone; the saved days appear in/historywith sourcebackfill.