4.5 KiB
Date Selection 01 Summary — Day Navigation and Date Picker
Status: Planned. Scope level: XHIGH implementation plan. Primary outcome: The Flutter desktop app can switch the visible planning day, load the correct persisted timeline for that day, and keep date-specific task state durable across app restarts.
Current repo facts this plan is based on
- The compact Flutter UI already has top-bar calendar, left-arrow, and right-arrow controls, but their callbacks are placeholders.
- The top bar currently receives only a display-ready
dateLabel. TodayScreenControllercurrently reads one fixed day through a callback.- The composition currently owns a single
CivilDateand creates command controllers with that fixed local date. GetTodayStateQuery.executealready accepts a requestedCivilDate.- Scheduler commands such as scheduling, completing, and uncompleting already accept a local date for planning context.
- After Persistence Plan 1, app state should be backed by an on-disk SQLite
ApplicationUnitOfWork, not static demo seed data.
Product behavior
- Clicking the left arrow moves the selected date back one day.
- Clicking the right arrow moves the selected date forward one day.
- Clicking the displayed date opens a date picker.
- Choosing a date immediately reloads the Today timeline for that date.
- Date switching does not mutate tasks by itself.
- Scheduling a backlog task while viewing a future or past date schedules into the selected date's planning window, subject to backend scheduling rules.
- Completing a task uses the real current clock for completion metadata, not the selected date as fake time.
- Date-specific task placement and done/not-done state survive close/reopen.
- If completion happened on a different local date than the scheduled slot, the card must show the completion date, not only the completion time.
Definition of done
Date Selection 01 is complete when all of the following are true:
TopBarexposes working previous-day, next-day, and date-picker callbacks.- The displayed date is an accessible button, not static text.
- The selected date is owned by controller/composition state and is not hardcoded into demo composition.
- Switching dates reloads
GetTodayStateQuerywith the selectedCivilDate. - Command controllers run schedule/complete/uncomplete actions against the current selected date.
- Any selected modal card is cleared or resynced safely when the date changes.
- Tasks scheduled on tomorrow or a previous day persist and reload on that day.
- Completed state persists when completion happens from a non-current selected day.
- Completion presentation includes date context whenever completed local date differs from scheduled local date.
- Widgets do not contain Drift, SQL, repository, or scheduling-engine logic.
- Existing compact timeline visuals remain stable except for the intended date controls and completion-date text.
- Backend, Flutter, and lifecycle validation gates pass, or unavailable gates are documented.
Non-goals
- No week/month calendar view.
- No drag-and-drop scheduling.
- No recurring task support.
- No calendar sync.
- No changes to the scheduling algorithm except bug fixes discovered while validating selected-date command behavior.
- No broad redesign of the compact timeline.
- No task-pushing menu; that is handled by Task Pushing 01.
- No backup/restore or export/import UI.
Architecture rule
Date selection is UI/session state. Scheduling truth remains in the backend read/command layer:
TopBar date controls
-> selected-date controller/state
-> Today read controller executes GetTodayStateQuery(date)
-> command controller passes selected CivilDate to use cases
-> ApplicationUnitOfWork persists domain changes
-> UI refreshes from read models
The selected date may choose which read model to request. It must not cause UI widgets to compute task placement or conflict resolution.
Important implementation decision
Do not make DemoSchedulerComposition.date the durable date-navigation model.
After Persistence Plan 1, the app should have a real runtime composition that can
create read and command controllers for whichever date is currently selected.
Use a selected-date controller or date-aware Today controller so date changes are
explicit, testable, and not hidden in widget-local rebuilds.