Skip to content

feat(rota): catch up on every blank day since the last log - #48

Open
davidvornholt wants to merge 1 commit into
mainfrom
feat/catch-up-unlogged-days
Open

davidvornholt wants to merge 1 commit into
mainfrom
feat/catch-up-unlogged-days

Conversation

@davidvornholt

Copy link
Copy Markdown
Owner

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.ts defines the gap once (lastLoggedDayBefore, unloggedDaysBefore) for both the rota and history features. TodayView.unloggedDays becomes unlogged: UnloggedGap | null; the 7-day backfillHorizonDays and the worn === null gate are gone.
  • logDaysFn (rota) writes several past days as backfill through ProposalService.logOutfit, rejecting today/future dates and duplicates. catchUpFn (history) loads the blank days, the last outfit, notes via a new DayNoteRepository.readRange, and the slot choices shared with dayFn.
  • DayPage's slot select and choice helpers moved into slot-picker.tsx, day-choice.ts, and weather-line.ts so the catch-up page reuses them unchanged.
  • Route tree regenerated with tsr generate for /history/catch-up.

Screenshots

Demo fixture data; 1280px viewport.

Before After
before-today-three-blank-days-prompt after-today-three-blank-days-prompt

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.

after-today-one-blank-day-prompt

One blank day keeps the one-tap copy; "Something else" now opens the catch-up page.

after-catch-up-three-blank-days

New /history/catch-up page 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 new wear-log-gap.test.ts and catch-up-choices.test.ts).
  • test:a11y inside bun run check failed with 22 page.goto 30s timeouts across pre-existing specs while the machine's load average was above 50 from unrelated processes; rerun serially with playwright test --workers=1: 50 passed, 0 failed (includes the new catch-up.a11y.ts and two new today.a11y.ts cases on both desktop and mobile projects).
  • Locally the sharp-backed tests and the a11y web server only load with LD_LIBRARY_PATH=/run/current-system/sw/share/nix-ld/lib; that is a local environment matter, not a repository change.

Check it yourself

  1. gh pr checkout feat/catch-up-unlogged-days, bun install, bun run dev, sign in.
  2. Make sure at least one day is logged and yesterday is not (for example clear yesterday via /history/<yesterday>). Open /: the bordered prompt names the blank days regardless of whether today is logged.
  3. With two or more blank days, "Fill in N days" opens /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 /history with source backfill.

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>
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