feat(FN-3889): add bulk delete with dependency conflict detection to ListVi
Bulk delete in ListView is now complete with dependency conflict detection and user-facing recovery options, backed by shared utility logic and tests. The feature touched ListView's core behavior, companion tests, and a small changeset documenting the user-facing recovery behavior. Fusion-Task-Id: FN-3889
This commit is contained in:
@@ -16,6 +16,7 @@ import { getUnifiedTaskProgress } from "../utils/taskProgress";
|
||||
import { getEndToEndDurationMs, getTimedDurationMs, getWorkflowRuntimeMs, parseTimestampToMs } from "../utils/taskTiming";
|
||||
import type { ToastType } from "../hooks/useToast";
|
||||
import { useConfirm } from "../hooks/useConfirm";
|
||||
import { extractDependencyDeleteConflict } from "../utils/taskDelete";
|
||||
|
||||
// ── Mission title caching ───────────────────────────────────────────────────
|
||||
|
||||
@@ -315,24 +316,6 @@ function getIssueUrlFromMetadata(metadata: Task["sourceMetadata"]): string | und
|
||||
return typeof issueUrl === "string" && issueUrl.length > 0 ? issueUrl : undefined;
|
||||
}
|
||||
|
||||
function extractDependencyDeleteConflict(err: unknown): { dependentIds: string[] } | null {
|
||||
if (!(err instanceof Error)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const details = (err as { details?: { code?: string; dependentIds?: unknown } }).details;
|
||||
if (details?.code === "TASK_HAS_DEPENDENTS" && Array.isArray(details.dependentIds)) {
|
||||
return { dependentIds: details.dependentIds.filter((id): id is string => typeof id === "string") };
|
||||
}
|
||||
|
||||
const idsInMessage = err.message.match(/[A-Z]+-\d+/g) ?? [];
|
||||
if (idsInMessage.length > 1) {
|
||||
return { dependentIds: [...new Set(idsInMessage.slice(1))] };
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function areTaskWorkflowResultsEqual(previous?: Task["workflowStepResults"], next?: Task["workflowStepResults"]): boolean {
|
||||
if (!previous && !next) return true;
|
||||
if (!previous || !next) return false;
|
||||
|
||||
Reference in New Issue
Block a user