feat(tasks): align Task edit UI's AC editor with Task Draft#299
Merged
Conversation
…k Draft The real Task edit form rendered acceptance criteria as a single legacy Markdown textarea, while the Task Draft panel used a structured-rows editor (one row per item with required toggle). The two surfaces had drifted apart even though every other editable field was already aligned. Extract the structured AC editor into a shared, controlled component so both panels render the same UI by construction. Persist real-task edits through the existing replaceAcceptanceCriteria service via a small extension to updateTaskFieldsAction. Use client-side change detection so verification marks survive non-AC edits — the destructive replace runs only when the criteria set actually changed. OpenSpec: align-task-edit-ui-with-draft (archived). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Coverage Report
File CoverageNo changed files found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The real Task edit form rendered acceptance criteria as a legacy Markdown
<Textarea>, while the Task Draft panel used a structured-rows editor (one row per item with arequiredtoggle). Every other editable field on the form was already aligned with the draft panel — only the AC editor had drifted.This PR closes that gap:
replaceAcceptanceCriteriaservice via a small extension toupdateTaskFieldsAction— no new service, REST endpoint, or schema change.OpenSpec change
align-task-edit-ui-with-draftis included and archived in this PR.Changed files
src/components/acceptance-criteria-editor.tsxAcceptanceCriteriaEditor+AcceptanceCriteriaItemDrafttype +acCriteriaChanged(original, edited)change-detection helper.src/components/__tests__/acceptance-criteria-editor.test.tsacCriteriaChanged: identical, whitespace-only, length, description text, required flip, mid-list flip, reorder, add/remove, empty↔populated.src/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/task-draft-detail-panel.tsx<AcceptanceCriteriaEditor>. Behavior preserved (empty-row filtering on save remains inhandleSave).src/app/(dashboard)/projects/[uuid]/tasks/task-detail-panel.tsx<Textarea>+editAcceptanceCriteriastring state. AddseditCriteriaItemsseeded fromtask.acceptanceCriteriaItems, mounts the shared editor, and conditionally spreadsacceptanceCriteriaItemsintoupdateTaskFieldsActiononly whenacCriteriaChangedis true. Empty-set guard short-circuits with the i18n required-AC message.src/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/actions.tsUpdateTaskFieldsInputwith optionalacceptanceCriteriaItems. AfterupdateTask(...), when the field is provided (!== undefined) routes it toreplaceAcceptanceCriteria. Auth/scoping/error-handling preserved; required-AC error surfaced verbatim.messages/en.json,messages/zh.jsonacceptanceCriteria.atLeastOneRequiredfor the empty-clear inline error in both locales.openspec/changes/archive/2026-06-07-align-task-edit-ui-with-draft/openspec/specs/task-edit-ui/spec.mdtask-edit-uicapability, emitted byopenspec archive.Test plan
npx tsc --noEmit→ exit 0pnpm test -- src/components/__tests__/acceptance-criteria-editor.test.ts→ 12/12 passnpx eslinton the touched files → exit 0 (warnings only, all pre-existing)Out of scope / follow-ups
docs/design.penupdate for the new Task panel AC editor — Pencil MCP bridge to VS Code was unreachable during this work; will be picked up in a small follow-up once Pencil connectivity is restored.task.acceptanceCriteriaMarkdown column — left in the model since it requires a migration; noted as future cleanup.🤖 Generated with Claude Code