mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
feat(graph-view): implement task deletion and dependency management enhancements
- Added onDeleteTask functionality to allow task deletion from both board and graph views. - Integrated delete options for dependencies in the graph view, enhancing user interaction. - Updated ancestor context section to clarify the role of parent tasks in task descriptions. - Improved layout handling in graph view to preserve node positions during updates. This update enhances task management capabilities and improves user experience in the graph view.
This commit is contained in:
@@ -25,6 +25,7 @@ export interface TaskNodeData extends Feature {
|
||||
onStopTask?: () => void;
|
||||
onResumeTask?: () => void;
|
||||
onSpawnTask?: () => void;
|
||||
onDeleteTask?: () => void;
|
||||
}
|
||||
|
||||
export type TaskNode = Node<TaskNodeData, 'task'>;
|
||||
@@ -33,6 +34,7 @@ export type DependencyEdge = Edge<{
|
||||
targetStatus: Feature['status'];
|
||||
isHighlighted?: boolean;
|
||||
isDimmed?: boolean;
|
||||
onDeleteDependency?: (sourceId: string, targetId: string) => void;
|
||||
}>;
|
||||
|
||||
export interface NodeActionCallbacks {
|
||||
@@ -42,6 +44,8 @@ export interface NodeActionCallbacks {
|
||||
onStopTask?: (featureId: string) => void;
|
||||
onResumeTask?: (featureId: string) => void;
|
||||
onSpawnTask?: (featureId: string) => void;
|
||||
onDeleteTask?: (featureId: string) => void;
|
||||
onDeleteDependency?: (sourceId: string, targetId: string) => void;
|
||||
}
|
||||
|
||||
interface UseGraphNodesProps {
|
||||
@@ -117,6 +121,9 @@ export function useGraphNodes({
|
||||
onSpawnTask: actionCallbacks?.onSpawnTask
|
||||
? () => actionCallbacks.onSpawnTask!(feature.id)
|
||||
: undefined,
|
||||
onDeleteTask: actionCallbacks?.onDeleteTask
|
||||
? () => actionCallbacks.onDeleteTask!(feature.id)
|
||||
: undefined,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -146,6 +153,7 @@ export function useGraphNodes({
|
||||
targetStatus: feature.status,
|
||||
isHighlighted: edgeIsHighlighted,
|
||||
isDimmed: edgeIsDimmed,
|
||||
onDeleteDependency: actionCallbacks?.onDeleteDependency,
|
||||
},
|
||||
};
|
||||
edgeList.push(edge);
|
||||
|
||||
Reference in New Issue
Block a user