fix(board): preserve waiting_approval state when stopping commit operation

When a feature with skipTests=true is stopped during commit operation, it now
returns to waiting_approval status instead of backlog, allowing users to retry
commit or perform follow-up actions without losing the approval workflow state.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
This commit is contained in:
Kacper
2025-12-09 23:49:46 +01:00
parent 6f9d90b199
commit b901d2bb6c
2 changed files with 26 additions and 3 deletions

View File

@@ -61,5 +61,15 @@
"startedAt": "2025-12-09T22:09:13.684Z",
"imagePaths": [],
"skipTests": true
},
{
"id": "feature-1765319491258-x933j6kbq",
"category": "Core",
"description": "When running new feature in skip automated testing once its got finished its moved to waiting approval for us to manual test it / follow up prompt. Once we are satisfied we can click commit button so ai agent can commit it work this is only hapening in this scenerio because if we have unchecked the skip automated testing its do it automaticly and commit already. But the issue is when its going to commit we move it to in progress state where we can use stop button and if user use that button its moved to backlog column and. that kinda break what we are doing becase we have no longer even abbility to move it back to waiting approval or to run commit button / follow up again so if user use manual one and stop the commit i want it to be again moved back to waiting approval state / column",
"steps": [],
"status": "verified",
"startedAt": "2025-12-09T22:31:41.946Z",
"imagePaths": [],
"skipTests": true
}
]

View File

@@ -877,10 +877,23 @@ export function BoardView() {
const handleForceStopFeature = async (feature: Feature) => {
try {
await autoMode.stopFeature(feature.id);
// Move the feature back to backlog status after stopping
moveFeature(feature.id, "backlog");
// Determine where to move the feature after stopping:
// - If it's a skipTests feature that was in waiting_approval (i.e., during commit operation),
// move it back to waiting_approval so user can try commit again or do follow-up
// - Otherwise, move to backlog
const targetStatus = feature.skipTests && feature.status === "waiting_approval"
? "waiting_approval"
: "backlog";
if (targetStatus !== feature.status) {
moveFeature(feature.id, targetStatus);
}
toast.success("Agent stopped", {
description: `Stopped working on: ${feature.description.slice(0, 50)}${feature.description.length > 50 ? "..." : ""}`,
description: targetStatus === "waiting_approval"
? `Stopped commit - returned to waiting approval: ${feature.description.slice(0, 50)}${feature.description.length > 50 ? "..." : ""}`
: `Stopped working on: ${feature.description.slice(0, 50)}${feature.description.length > 50 ? "..." : ""}`,
});
} catch (error) {
console.error("[Board] Error stopping feature:", error);