2.6 KiB
2.6 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| 02-frontend-duplicate-ui | Add the frontend duplicate UI | done | 2 |
|
plan.md | ../../specs/agents/requirements/profile-duplicate.md |
Task 02: Frontend duplicate UI
Acceptance
duplicateAgentProfileAction(profileId)POSTs to/api/v1/agent-profiles/:id/duplicateand returns the normalizedAgentProfile.- Each profile row on
/settings/agentsshows a Duplicate icon button (outside the row link, beside the enabled switch) with an accessible labelDuplicate <name>,data-testid="duplicate-profile-<id>", and a touch target of at least 44×44px. Clicking it creates the copy and adds the new row to the store immediately (toast on success/failure). No navigation. - The profile settings page header (
/settings/agents/<agent>/profiles/<id>) shows a Duplicate button (data-testid="duplicate-profile-header",min-h-11touch target). On success it toasts and navigates to the copy's settings page. - All new user-facing copy goes through
t(); the persisted copy name stays server-side (<source> Copy) and is not localized. - New en keys exist in
agents.json; the pseudo locale is regenerated;i18n:checkandi18n:ratchetpass for changed lines.
Verification
- Component test:
cd apps/web && pnpm vitest run app/settings/agents/profile-list-item.test.tsx - i18n:
cd apps/web && pnpm run i18n:pseudo && pnpm run i18n:check - Typecheck + lint of changed files:
cd apps/web && pnpm run typecheckcd apps && pnpm --filter @kandev/web lint(or the repo's configured lint command)
Files likely touched
apps/web/app/actions/agents.tsapps/web/app/settings/agents/profile-list-item.tsxapps/web/app/settings/agents/profile-list-item.test.tsxapps/web/app/settings/agents/page.tsxapps/web/components/settings/agent-profile-page.tsxapps/web/src/locales/en/agents.jsonapps/web/src/locales/pseudo/agents.json(regenerated)
Dependencies
Task 01 (endpoint must exist for the action to hit).
Parallelism
Sequential by default; may run in parallel with Task 03 only with explicit user authorization.
Inputs
- Spec duplicate scenarios and API surface
useProfileEnabledToggle/applyEnabledProfileUpdatestore-merge pattern;agent-profile-page-state.tsdelete/navigate flow;normalizeAgentProfile;ws/handlers/agents.tshandleProfileCreatedupsert-by-ID behaviour (verify no double-row when the direct merge and WS both insert).
Output contract
Report RED and GREEN results, store-merge approach, toast keys, changed
files, and update this task plus plan.md status.