4.4 KiB
4.4 KiB
id, title, status, wave, depends_on, plan, spec, decision
| id | title | status | wave | depends_on | plan | spec | decision | |
|---|---|---|---|---|---|---|---|---|
| 04-session-delete-contract-and-e2e | Verify session deletion preserves workspaces | done | 4 |
|
plan.md | ../../specs/tasks/requirements/session-delete-resource-cleanup.md | ../../decisions/2026-08-08-task-owned-worktree-lifetime.md |
Task 04: Verify Session Deletion Preserves Workspaces
Acceptance
- Desktop and mobile confirmation dialogs say that conversation history is deleted while the task workspace and files are retained.
- Neither dialog fetches or warns about uncommitted/unpushed state; destructive workspace warnings remain on task archive/delete.
- Deleting the only session leaves the task with zero sessions, its directory, Git worktree registration, and uncommitted file intact; a new session reuses the retained workspace.
- Deleting one of two sessions sharing a workspace leaves the other session operational in that workspace.
- The existing mobile session-actions sheet and viewport-safe confirmation dialog remain the native entry point with unchanged action semantics and touch targets.
- Public docs distinguish ordinary session deletion from task archive/delete and keep Quick Chat's task-backed cleanup semantics separate.
- Operations and Kubernetes upgrade docs require a verified PostgreSQL backup, stopped mixed-version backends, one successful schema initializer, and backup restore before binary downgrade; they explain SQLite's automatic pre-upgrade snapshot.
- All new copy is localized in English, pseudo, Portuguese, and Simplified Chinese catalogs.
TDD Sequence
- RED: extend desktop and mobile rendered-component tests for the retained- workspace copy and absence of uncommitted/unpushed warnings.
- RED: add a managed desktop E2E that writes an uncommitted marker, deletes the only session through visible UI, verifies zero sessions plus directory/Git registration/marker preservation, and creates a replacement session that observes the marker.
- RED: add the two-session shared-workspace case and verify the remaining session continues to operate.
- RED: extend the mobile E2E to assert the same confirmation contract from the native session-actions sheet.
- GREEN: update localized dialog copy without adding new warning-fetch state.
- GREEN: update public session documentation.
- GREEN: update the existing operations/Kubernetes upgrade and rollback guides with the one-time ownership-schema cutover requirements.
- REFACTOR: share only translation keys or test helpers that reduce duplication; retain the existing desktop and mobile compositions.
Verification
cd apps && pnpm install --frozen-lockfile
cd apps && pnpm --filter @kandev/web test -- components/task/session-tab-menu.test.tsx components/task/mobile/mobile-sessions-section.test.tsx
cd apps/web && pnpm run typecheck
cd apps && pnpm run i18n:ratchet && pnpm run i18n:check
cd apps/web && pnpm e2e:run tests/session/multi-session-ux.spec.ts
cd apps/web && pnpm e2e:run --project mobile-chrome tests/session/mobile-session-deletion.spec.ts
node --test scripts/validate-public-docs.test.mjs
node scripts/validate-public-docs.mjs
Files likely touched
apps/web/components/task/session-tab-menu.tsxapps/web/components/task/session-tab-menu.test.tsxapps/web/components/task/mobile/mobile-sessions-section.tsxapps/web/components/task/mobile/mobile-sessions-section.test.tsxapps/web/src/locales/en/task.jsonapps/web/src/locales/pseudo/task.jsonapps/web/src/locales/pt-pt/task.jsonapps/web/src/locales/zh-cn/task.jsonapps/web/e2e/tests/session/multi-session-ux.spec.tsapps/web/e2e/tests/session/mobile-session-deletion.spec.tsdocs/public/sessions-and-review.mddocs/public/operations.mddocs/public/k8s.md
Dependencies
- Task 03 completes the backend ownership and durable task-cleanup contract.
Inputs
- Current desktop
DeleteSessionDialogand mobileDeleteSessionConfirmDialogcompositions. - Existing task archive/delete cleanup summaries and warnings.
- Existing session Playwright fixtures and Git helpers.
Output contract
Report desktop/mobile rendered test results, the exact user-visible contract, zero-session and shared-session E2E evidence, Git registration and uncommitted marker results, replacement-session reuse evidence, the documented SQLite/PostgreSQL upgrade and downgrade procedure, i18n/typecheck/docs results, and screenshots or traces for any failed mobile state.