mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-01-31 06:42:06 +00:00
feat: add feature editing capability for pending/in-progress features
Add the ability for users to edit features that are not yet completed,
allowing them to provide corrections or additional instructions when the
agent is stuck or implementing a feature incorrectly.
Backend changes:
- Add FeatureUpdate schema in server/schemas.py with optional fields
- Add PATCH /api/projects/{project_name}/features/{feature_id} endpoint
- Validate that completed features (passes=True) cannot be edited
Frontend changes:
- Add FeatureUpdate type in ui/src/lib/types.ts
- Add updateFeature() API function in ui/src/lib/api.ts
- Add useUpdateFeature() React Query mutation hook
- Create EditFeatureForm.tsx component with pre-filled form values
- Update FeatureModal.tsx with Edit button for non-completed features
The edit form allows modifying category, name, description, priority,
and test steps. Save button is disabled until changes are detected.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import type {
|
||||
FeatureListResponse,
|
||||
Feature,
|
||||
FeatureCreate,
|
||||
FeatureUpdate,
|
||||
FeatureBulkCreate,
|
||||
FeatureBulkCreateResponse,
|
||||
AgentStatusResponse,
|
||||
@@ -119,6 +120,17 @@ export async function skipFeature(projectName: string, featureId: number): Promi
|
||||
})
|
||||
}
|
||||
|
||||
export async function updateFeature(
|
||||
projectName: string,
|
||||
featureId: number,
|
||||
update: FeatureUpdate
|
||||
): Promise<Feature> {
|
||||
return fetchJSON(`/projects/${encodeURIComponent(projectName)}/features/${featureId}`, {
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify(update),
|
||||
})
|
||||
}
|
||||
|
||||
export async function createFeaturesBulk(
|
||||
projectName: string,
|
||||
bulk: FeatureBulkCreate
|
||||
|
||||
@@ -82,6 +82,14 @@ export interface FeatureCreate {
|
||||
priority?: number
|
||||
}
|
||||
|
||||
export interface FeatureUpdate {
|
||||
category?: string
|
||||
name?: string
|
||||
description?: string
|
||||
steps?: string[]
|
||||
priority?: number
|
||||
}
|
||||
|
||||
// Agent types
|
||||
export type AgentStatus = 'stopped' | 'running' | 'paused' | 'crashed'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user