Repository navigation
Weekly routine that generates future time blocks - #51
Merged
Merged
Conversation
- Add `RoutineState`/`RoutineBlock` to the snapshot as a dateless default week (weekday, start, duration, category), persisted in `shared_settings` so it syncs LWW like the other singletons. - Materialize the next 8 weeks on boot and after sync: today only future slots, manual blocks win conflicts, and past/in-progress blocks are never touched. - Generated blocks carry `routineId`/`routineRevision`. Editing or deleting one is a one-off exception (deterministic ids prevent recreation); changing the routine bumps the revision and regenerates only the future. - Add the `RoutineSheet` editor: paint the default week on a 30-minute grid, choose a category/eraser, clear the window or save. Available from the Time module on desktop and mobile, free for everyone. - Document the model and rules in `docs/ROUTINE.md`.
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.
Why
The Time module only had one-off blocks. This adds a default week that keeps the planner filled: paint the routine once and the app creates the concrete blocks for the next 8 weeks, updating them when the routine changes.
Model
RoutineState = { revision, blocks[] }in the snapshot; a block is{ weekday, startMinutes, durationMinutes, categoryId, title }(no dates).shared_settingssingleton (routine), so it syncs LWW withlifeForce,financeanddailyGoal.routineId+routineRevisionand use deterministic ids (routine-<id>-<date>), so two devices do not duplicate them.Rules
UI
docs/ROUTINE.mddocuments the model and rules.Verification
npm run checknpm test(40 files / 284 tests)npm run buildnpm run csp:check(23/23)Pending manual check on device: paint/save a routine, confirm future blocks appear, manual conflicts are skipped, and editing/deleting a generated block stays one-off after reopening the app.