Skip to content

Allow editing completed features from the UI - #305

Open
zwanski-start wants to merge 1 commit into
AutoForgeAI:masterfrom
zwanski-start:swarm/issue-25-ken
Open

zwanski-start wants to merge 1 commit into
AutoForgeAI:masterfrom
zwanski-start:swarm/issue-25-ken

Conversation

@zwanski-start

Copy link
Copy Markdown

Closes #25

What changed

Pending and in-progress features could already be edited, but completed ("Done") features had no Edit button and the API refused with "Cannot edit a completed feature". This PR removes that restriction.

  • Backend (server/routers/features.py, server/schemas.py): PATCH /api/projects/{name}/features/{id} now accepts edits to completed features. Added an optional reopen: bool = False field to FeatureUpdate. When it is true and the feature is done, the feature goes back to pending (passes=False, in_progress=False).
  • UI:
    • FeatureModal shows an Edit button for completed features. Skip and Delete stay hidden for them, as before.
    • EditFeatureForm shows a "Move back to pending" switch when the feature is done. It is off by default, so a small wording fix keeps the feature done. Turning the switch on alone counts as a change you can save.
  • Tests: new test_feature_update.py with 4 tests: editing a done feature keeps it done, editing with reopen moves it to pending, reopen on a pending feature does nothing, and a missing feature returns 404.

Verification

  • pytest test_feature_update.py: 4 passed
  • ruff check .: clean
  • npm run lint: 0 errors; the 6 warnings were already there
  • npm run build: succeeds
  • Manual check in the browser on a scratch project with one done and one pending feature: opened the done feature, clicked Edit, changed the description, switched on "Move back to pending" and saved. The card moved to Pending with the new description, and the API returned passes: false.

Assumptions

  • Editing a done feature keeps its status unless you choose to re-open it. Most "edit a little bit" changes are fixes to the text, so they shouldn't make the agent redo the work.
  • The PR does not add a way to edit dependencies in the form. The issue only asks for light edits, and the graph view already handles dependencies.

🤖 Generated with Claude Code

Remove the backend restriction that made done features immutable and
show the Edit button for completed features. Add an optional 'reopen'
flag to FeatureUpdate so an edited feature can be moved back to pending
for the agent to re-implement and re-verify.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zwanski-start

Copy link
Copy Markdown
Author

QA round 1 came back with an empty summary, so there was no specific defect to fix. The only failing signal is the CI run (39751500901), which shows action_required: GitHub is waiting for a maintainer to approve workflows on this fork PR, so no job has actually run yet. I re-ran the CI steps locally on f4ce360, which is up to date with master: ruff check . passes, python test_security.py passes, pytest test_feature_update.py test_ws_security.py passes (14 tests), npm ci && npm run lint gives 0 errors, and npm run build succeeds. A maintainer needs to approve the workflow run for CI to execute.

@zwanski-start

Copy link
Copy Markdown
Author

🔍 QA report: ✅ Passed

Tester: Dennis (cubefarm agent, in a fresh session) · Round: 2 · Author: Ken

Done features now show an Edit button, and the PATCH endpoint accepts edits to them. Without reopen the feature stays done; with reopen: true it goes back to pending. I confirmed this in a real browser and against the live API. New unit tests, ruff, UI build and lint pass, and the pre-existing pytest and mypy failures are the same as on master. Small note: after reopening, the sidebar progress badge stays stale until a refetch, while the Dashboard's live progress updates straight away.

Check Details
✅ Issue #25: done features can be edited from the UI Opened done feature #1 on the Kanban board. Its details window now shows an Edit button (no Skip or Delete). The Edit form loads the current values and shows a 'Move back to pending' switch, off by default.
✅ Small edit keeps the feature done Changed the description and saved with the switch off. The card updated in the Done column, and GET /features/1 returned passes=true with the new description.
✅ Turning the switch on alone counts as a change At 390x844 (phone size), opened done feature #3's Edit form and turned on only the switch. Save was enabled, and after saving the card moved to Pending. The API returned passes=false, in_progress=false, with dependencies kept.
✅ Pending features unchanged Pending feature #2's details window still shows Edit, Skip and Delete, and its Edit form has no switch. Save starts disabled until something changes.
✅ API checks (PATCH /api/projects/{name}/features/{id}) Edit of a done feature without reopen: 200, passes stays true. reopen=true on its own: 200, passes=false. reopen='maybe': 422 bool_parsing. Missing id 99: 404. An empty name is accepted (200); the schema on master doesn't block this either, so it isn't from this PR.
✅ Live progress, graph and console After reopening, the Dashboard's live (WebSocket) progress showed 1/3 (33.3%). The Graph view showed the right colours (one done, two pending) and the 1→3 edge. The console had 0 errors; the only warnings are Radix 'Missing Description' warnings on dialogs. Minor: the sidebar progress badge (projects query) stayed at 66.7% until a refetch.
✅ Backend lint, types and tests compared with master ruff is clean. mypy shows the same 24 errors as on master. pytest: 148 passed, 21 failed, and the same 21 fail on master (test_devserver_security and others, not from this PR). The new test_feature_update.py: 4 passed.
✅ Frontend build and lint tsc -b plus vite build succeeds. ESLint: 0 errors, 6 warnings, none new.
✅ Security and schema No changes to security.py, the middleware or the DB schema. The new reopen field defaults to False, so existing clients and databases are unaffected.
⏭️ Playwright e2e suite It starts its own Vite dev server on port 5173, outside my reserved port. Its two specs (conversation-history, tooltip) don't touch feature editing. The new flow was tested by hand in a real browser instead.
🧪 Commands run
Command Result
ruff check . All checks passed
mypy . 24 errors in 9 files, same as on master
python -m pytest -q 148 passed, 21 failed (the same 21 fail on master)
python -m pytest -q test_feature_update.py 4 passed
npm --prefix ui run lint 0 errors, 6 warnings, none new
npm --prefix ui run build success
HOME=<scratch> uvicorn server.main:app --host 127.0.0.1 --port 5247 booted, served the SPA and /api; stopped afterwards
curl -X PATCH .../features/{1,3,99} with these bodies: description only, reopen only, reopen='maybe', empty name 200 / 200 (passes=false) / 404 / 422 / 200

No browser screenshots were taken in this round.

Posted by cubefarm · merges automatically once GitHub's checks pass

cabana8471-arch pushed a commit to cabana8471-arch/autoforge that referenced this pull request Nov 8, 2026
Adaptations: none beyond listing the test in CLAUDE.md; merged on top of AutoForgeAI#245's FeatureModal changes.

Integrates AutoForgeAI#305

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeH26pcsqoxPb3CDs8g1VN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Edit Existing Features in The UI

1 participant