3.5 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| 02-frontend-bootstrap-workspace | Frontend: use the bootstrap workspace | completed | 2 |
|
plan.md | ../../specs/workspaces/requirements/improve-kandev.md |
Task 02: Frontend — create tasks in the bootstrap workspace
The Improve Kandev dialog must create tasks in the dedicated workspace the bootstrap response returns, not in the user's active workspace.
Acceptance
ImproveKandevBootstrapResponseincludesworkspace_id: string.useBootstrapKandevlists repositories and populates the store fordata.workspace_id(not the active workspace), so the locked repo chip resolves a label for the dedicated workspace's repository.CreateModeViewpassesready.data.workspace_idtoTaskCreateDialogwhen bootstrap is ready, so the created task lands in the dedicated workspace. While loading/error the active workspace id remains the fallback and submit stays blocked.
Verification
cd apps && pnpm --filter @kandev/web typecheck
cd apps/web && pnpm vitest run components/improve-kandev-dialog.test.tsx
Unit coverage (added with the change): components/improve-kandev-dialog.test.tsx
asserts bootstrap is called with the workspace-choice flag, repositories are
listed and stored for the bootstrap's workspace_id (not the active one), and
the workspace-creation choice gates bootstrap when the dedicated workspace is
missing. The task-landing-in-the-dedicated-workspace behavior itself is covered
by the E2E isolation test in task 03.
Files likely touched
apps/web/lib/api/domains/improve-kandev-api.tsapps/web/components/improve-kandev-dialog.tsxapps/web/components/improve-kandev-dialog-create.tsx
Dependencies
Task 01 (response contract: workspace_id).
Parallelism
Sequential (wave 2).
Inputs
- Spec: "API surface" (
workspace_idin the bootstrap response) and "Scenarios" (task lands in the dedicated workspace). - Plan:
docs/plans/improve-kandev-workspace/plan.mdFrontend section. - Existing wiring:
useBootstrapKandevinimprove-kandev-dialog.tsx(currentlylistRepositories(workspaceId)+setRepositories(workspaceId, ...)),CreateModeViewinimprove-kandev-dialog-create.tsx(currently passesprops.workspaceIdtoTaskCreateDialog).
Output contract
Summary, files changed, typecheck result, blockers, risks, and task/plan status update in the same conversation.
Risks
- The dialog's
useGitHubAuthCheckkeeps using the active workspace for the fix URL — intentional; do not switch it to the dedicated workspace. - If
data.workspace_idis missing (stale backend),listRepositories(undefined)would 400 — the E2E mocks and the real backend both return it after task 01; treat a missing field as a bootstrap error surfaced by the existing catch.
Results
Shipped in 09733d2f2, cc7b66550 (PR #2347). The app boot payload's
workspace_id/workspaces now drive the Improve Kandev dialog; the dialog's
WorkspaceChoicePanel + CreateWorkspaceCheckbox opt into workspace creation
(default checked) when the dedicated workspace does not exist, and
useBootstrapKandev sends create_workspace accordingly. "New Task" in the
dedicated workspace opens the Improve Kandev dialog via the shared
appSidebar.improveDialogOpen store flag. Unit coverage:
components/improve-kandev-dialog.test.tsx (bootstrap wiring + copy), all pass
with pnpm vitest run components/improve-kandev-dialog.test.tsx.