<!-- SPDX-FileCopyrightText: 2026 FocusFlow contributors -->
<!-- SPDX-License-Identifier: AGPL-3.0-only -->


# Date Selection 01 Block 06 — Validation and Handoff

**Status:** Complete.
**Goal:** Prove date selection is stable, persisted, and ready for Task Pushing 01.

---

## Block outcome

After this block, Date Selection 01 should be complete and Task Pushing 01 can
begin from a date-aware, persistence-backed UI.

## Handoff notes

Date Selection 01 is complete on `date-selection-01-day-navigation`. The branch
is intentionally unmerged so behavior can be reviewed first.

Validation results:

1. `scripts/bootstrap_dev.sh`: passed.
2. `scripts/test.sh`: blocked before tests at `dart analyze` because the Dart
   analysis server failed with `OS Error: Too many open files, errno = 24`.
3. `cd packages/scheduler_core && dart analyze`: blocked by the same Dart
   analysis server file-watcher error.
4. `cd packages/scheduler_core && dart test`: passed, 300 tests.
5. `cd packages/scheduler_persistence_sqlite && dart test`: passed, 15 tests.
6. `cd apps/focus_flow_flutter && flutter analyze`: blocked by the same analyzer
   server failure in this environment.
7. `cd apps/focus_flow_flutter && flutter test`: passed, 39 tests.

The analyzer failure is an environment/tooling failure, not a reported Dart or
Flutter lint finding.

---

## Chunk 6.1 — Add end-to-end date navigation tests

### Required tests

1. Initial load shows the runtime-selected/current day.
2. Previous arrow changes the date label and reloads that day.
3. Next arrow changes the date label and reloads that day.
4. Date picker jumps directly to a chosen date.
5. Empty selected dates show empty state with the correct date label.
6. Rapid navigation settles on the final selected date.
7. Open modal closes when changing dates.

### Acceptance criteria

- Date navigation is covered by widget/controller tests.
- Tests do not depend on arbitrary demo seed tasks.

---

## Chunk 6.2 — Add persistence lifecycle tests across dates

### Required tests

1. Schedule a backlog task into tomorrow, close/reopen, reload tomorrow, assert
   it remains planned there.
2. Complete that tomorrow task, close/reopen, reload tomorrow, assert done state
   remains.
3. Uncomplete it, close/reopen, reload tomorrow, assert planned state remains.
4. Schedule or load a previous-day task if supported, close/reopen, assert its
   state remains.
5. Verify Backlog is still unified and not duplicated by date navigation.

### Acceptance criteria

- Multi-day persistence is proven using on-disk temp SQLite files.
- The test explicitly closes database/runtime handles before reopen assertions.

---

## Chunk 6.3 — Run validation gates

### Commands

Run the strongest available validation set:

```sh
scripts/test.sh
cd packages/scheduler_core
dart analyze
dart test
cd ../scheduler_persistence_sqlite
dart analyze
dart test
cd ../../apps/focus_flow_flutter
flutter analyze
flutter test
```

### Acceptance criteria

- All available gates pass.
- If a command is unavailable in the environment, record the exact command and
  failure reason in the plan handoff notes.

---

## Chunk 6.4 — Update minimal handoff/status docs

### Tasks

1. Update the plan summary/status to indicate completion.
2. Move the plan folder only if the project's completed-plan workflow calls for
   it.
3. Update `Codex Documentation/Current Software Plan/README.md` so Task Pushing
   01 is the next incomplete plan.
4. Do not create a broad overall report.

### Acceptance criteria

- Handoff docs identify Date Selection 01 as complete.
- Task Pushing 01 is clearly next.
- No unrelated planning docs are rewritten.

---

## Final plan acceptance criteria

- Previous/next/date-picker controls work.
- Selected date drives Today reads and relevant commands.
- Multi-day schedule and done state persist across restarts.
- Cross-date completion displays date + time.
- UI remains backend-driven.
- Validation status is documented.
