fix: allow re-detailing phases after all tasks are deleted
The "Detail Tasks" button was hidden when an idle detail agent from a previous run was still associated with the phase. The frontend gate blocked any re-detail while a detail agent existed, even if it was idle (i.e. done). The backend already auto-dismisses stale idle agents, so the frontend just needed to allow idle agents through the gate.
This commit is contained in:
@@ -19,9 +19,12 @@ export function PhaseActions({
|
|||||||
const detailMutation = trpc.spawnArchitectDetail.useMutation();
|
const detailMutation = trpc.spawnArchitectDetail.useMutation();
|
||||||
const [isDetailingAll, setIsDetailingAll] = useState(false);
|
const [isDetailingAll, setIsDetailingAll] = useState(false);
|
||||||
|
|
||||||
// Phases eligible for detailing: no tasks AND no active detail agent
|
// Phases eligible for detailing: no tasks AND no actively running detail agent
|
||||||
const eligiblePhaseIds = useMemo(
|
const eligiblePhaseIds = useMemo(
|
||||||
() => phasesWithoutTasks.filter((id) => !detailAgentByPhase.has(id)),
|
() => phasesWithoutTasks.filter((id) => {
|
||||||
|
const agent = detailAgentByPhase.get(id);
|
||||||
|
return !agent || agent.status === "idle";
|
||||||
|
}),
|
||||||
[phasesWithoutTasks, detailAgentByPhase],
|
[phasesWithoutTasks, detailAgentByPhase],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ export function PhaseDetailPanel({
|
|||||||
detailAgent?.status === "running" ||
|
detailAgent?.status === "running" ||
|
||||||
detailAgent?.status === "waiting_for_input";
|
detailAgent?.status === "waiting_for_input";
|
||||||
const showDetailButton =
|
const showDetailButton =
|
||||||
!detailAgent && !hasTasks;
|
!hasTasks && (!detailAgent || detailAgent.status === "idle");
|
||||||
const showChangeSet =
|
const showChangeSet =
|
||||||
detailAgent?.status === "idle" && !!latestChangeSet;
|
detailAgent?.status === "idle" && !!latestChangeSet;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user