4.1 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec |
|---|---|---|---|---|---|---|
| 01-persist-task-row-presentation | Persist task-row presentation | complete | 1 | plan.md | ../../specs/ui/requirements/sidebar-task-row-presentation.md |
Task 01: Persist Task-Row Presentation
Acceptance
- Each saved sidebar view and draft can carry a complete task-row presentation through REST, SQLite, boot hydration, frontend state, save, save-as, duplicate, discard, and rollback flows.
- Missing or malformed data resolves to the current layout. Explicitly disabled details remain disabled after a round trip.
- A draft presentation previews as the effective view without mutating the saved view.
Verification
cd apps && pnpm install --frozen-lockfile
cd apps/backend && go test -tags fts5 ./internal/user/... ./internal/backendapp
make -C apps/backend test
cd apps && pnpm --filter @kandev/web test -- --run lib/state/slices/ui/sidebar-view-wire.test.ts lib/state/slices/ui/ui-slice-migration.test.ts lib/state/slices/ui/sidebar-view-actions.test.ts lib/state/slices/ui/ui-slice.test.ts
cd apps/web && pnpm run typecheck
Files Likely Touched
apps/backend/internal/user/models/models.goapps/backend/internal/user/store/sqlite.goapps/backend/internal/user/store/sqlite_test.goapps/backend/internal/user/service/service_test.goapps/backend/internal/user/handlers/handlers_test.goapps/backend/internal/backendapp/boot_state_routes.goapps/backend/internal/backendapp/boot_state_routes_test.goapps/web/lib/types/http-user-settings.tsapps/web/lib/state/slices/ui/sidebar-view-types.tsapps/web/lib/state/slices/ui/sidebar-view-wire.tsapps/web/lib/state/slices/ui/sidebar-view-builtins.tsapps/web/lib/state/slices/ui/sidebar-view-actions.tsapps/web/lib/state/slices/ui/ui-slice.tsapps/web/hooks/domains/sidebar/use-effective-sidebar-view.ts- Focused tests beside these files
Dependencies
None.
Parallelism
parallel-safe with Task 04. This task owns the saved-view contract and state files. Task 04 owns
the provider-neutral summary component.
Inputs
- The data and persistence rules in the sidebar task-row presentation spec.
- ADR 0041 backend ownership and complete-payload normalization rules.
- Existing sidebar view wire, migration, optimistic mutation, and boot-state mapping paths.
- The canonical current layout: details enabled, all fields visible in current order, and Git changes on the right.
TDD Sequence
- Add frontend normalization and wire tests for missing, valid, malformed, duplicate, and future fields. Record the expected failures.
- Add action tests for draft creation, save, save-as, duplicate, discard, and failed-write rollback.
- Add backend persistence and boot-map tests for an explicit presentation and a legacy missing object. Record the expected failures.
- Add the nullable backend model and explicit frontend API and domain types.
- Implement the pure frontend normalizer and extend wire, migration, built-in, action, and effective-view paths.
- Run focused backend and frontend tests, then frontend typecheck.
- Record exact results and synchronize the plan and task status.
Risks
- A plain boolean zero value cannot distinguish legacy missing data from explicit
false. - Full-array optimistic rollback must restore views, active view, and draft together.
- A future client can add a field that this client does not know. Unknown values must not corrupt known order or visibility.
Output Contract
Report RED failures, the final wire shape, normalization decisions, files changed, exact test results, compatibility behavior, blockers, risks, and synchronized task and plan status.
Results
RED coverage was added for missing and explicit task-row wire data before the production model and normalizer were implemented. The backend model, SQLite defaults/round trip, boot mapping, API wire mapping, migration, effective-view preview, and optimistic view actions now preserve the complete normalized object. Targeted backend coverage passed with 808 tests across 7 packages; frontend persistence coverage passed with 61 tests across 4 files; frontend typecheck passed.