fix(FN-1818): fix milestone/slice status tracking on feature changes

- Add SSE listener for milestone:updated events in MissionManager to refresh UI on status changes
- Trigger slice and milestone status recompute when task feature status changes
- Add diagnostic log when task feature resolution fails for easier debugging
- Add regression tests for milestone status recompute logic
This commit is contained in:
Fusion
2026-04-15 01:15:29 -07:00
committed by gsxdsm
parent 8aeb14772a
commit cfc2e16148
4 changed files with 100 additions and 5 deletions

View File

@@ -805,6 +805,14 @@ export function MissionManager({ isOpen, isInline = false, onClose, addToast, pr
}
};
const handleMilestoneUpdated = (_rawEvent: Event) => {
refreshHealth();
// Reload the selected mission detail to reflect updated milestone status
if (selectedMission) {
void loadMissionDetail(selectedMission.id);
}
};
// Handler for validator run started - refresh feature loop state and validation runs
const handleValidatorRunStarted = (rawEvent: Event) => {
const messageEvent = rawEvent as MessageEvent<string>;
@@ -938,6 +946,7 @@ export function MissionManager({ isOpen, isInline = false, onClose, addToast, pr
eventSource.addEventListener("mission:updated", handleMissionUpdated);
eventSource.addEventListener("slice:updated", handleSliceUpdated);
eventSource.addEventListener("feature:updated", handleFeatureUpdated);
eventSource.addEventListener("milestone:updated", handleMilestoneUpdated);
eventSource.addEventListener("mission:event", handleMissionEvent);
// Validation events
eventSource.addEventListener("validator-run:started", handleValidatorRunStarted);
@@ -954,6 +963,7 @@ export function MissionManager({ isOpen, isInline = false, onClose, addToast, pr
eventSource.removeEventListener("mission:updated", handleMissionUpdated);
eventSource.removeEventListener("slice:updated", handleSliceUpdated);
eventSource.removeEventListener("feature:updated", handleFeatureUpdated);
eventSource.removeEventListener("milestone:updated", handleMilestoneUpdated);
eventSource.removeEventListener("mission:event", handleMissionEvent);
eventSource.removeEventListener("validator-run:started", handleValidatorRunStarted);
eventSource.removeEventListener("validator-run:completed", handleValidatorRunCompleted);