mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-04 09:13:08 +00:00
refactor: update graph view actions to include onViewDetails and remove onViewBranch
- Added onViewDetails callback to handle feature detail viewing. - Removed onViewBranch functionality and associated UI elements for a cleaner interface.
This commit is contained in:
@@ -67,7 +67,7 @@
|
|||||||
"class-variance-authority": "^0.7.1",
|
"class-variance-authority": "^0.7.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"cmdk": "^1.1.1",
|
"cmdk": "^1.1.1",
|
||||||
"apps/ui/src/components/views/graph-view/hooks/use-graph-filter.ts": "^0.8.5",
|
"dagre": "^0.8.5",
|
||||||
"dotenv": "^17.2.3",
|
"dotenv": "^17.2.3",
|
||||||
"geist": "^1.5.1",
|
"geist": "^1.5.1",
|
||||||
"lucide-react": "^0.562.0",
|
"lucide-react": "^0.562.0",
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import {
|
|||||||
DropdownMenu,
|
DropdownMenu,
|
||||||
DropdownMenuContent,
|
DropdownMenuContent,
|
||||||
DropdownMenuItem,
|
DropdownMenuItem,
|
||||||
DropdownMenuSeparator,
|
|
||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from '@/components/ui/dropdown-menu';
|
} from '@/components/ui/dropdown-menu';
|
||||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
|
||||||
@@ -225,7 +224,7 @@ export const TaskNode = memo(function TaskNode({ data, selected }: TaskNodeProps
|
|||||||
className="text-xs cursor-pointer"
|
className="text-xs cursor-pointer"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
data.onViewLogs?.();
|
data.onViewDetails?.();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Eye className="w-3 h-3 mr-2" />
|
<Eye className="w-3 h-3 mr-2" />
|
||||||
@@ -267,19 +266,6 @@ export const TaskNode = memo(function TaskNode({ data, selected }: TaskNodeProps
|
|||||||
Resume Task
|
Resume Task
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
)}
|
)}
|
||||||
{Boolean(data.branchName) && <DropdownMenuSeparator />}
|
|
||||||
{Boolean(data.branchName) && (
|
|
||||||
<DropdownMenuItem
|
|
||||||
className="text-xs cursor-pointer"
|
|
||||||
onClick={(e) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
data.onViewBranch?.();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<GitBranch className="w-3 h-3 mr-2" />
|
|
||||||
View Branch
|
|
||||||
</DropdownMenuItem>
|
|
||||||
)}
|
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -83,6 +83,12 @@ export function GraphView({
|
|||||||
onViewOutput(feature);
|
onViewOutput(feature);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onViewDetails: (featureId: string) => {
|
||||||
|
const feature = features.find((f) => f.id === featureId);
|
||||||
|
if (feature) {
|
||||||
|
onEditFeature(feature);
|
||||||
|
}
|
||||||
|
},
|
||||||
onStartTask: (featureId: string) => {
|
onStartTask: (featureId: string) => {
|
||||||
const feature = features.find((f) => f.id === featureId);
|
const feature = features.find((f) => f.id === featureId);
|
||||||
if (feature) {
|
if (feature) {
|
||||||
@@ -101,15 +107,8 @@ export function GraphView({
|
|||||||
onResumeTask?.(feature);
|
onResumeTask?.(feature);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onViewBranch: (featureId: string) => {
|
|
||||||
const feature = features.find((f) => f.id === featureId);
|
|
||||||
if (feature?.branchName) {
|
|
||||||
// TODO: Implement view branch action
|
|
||||||
console.log('View branch:', feature.branchName);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}),
|
}),
|
||||||
[features, onViewOutput, onStartTask, onStopTask, onResumeTask]
|
[features, onViewOutput, onEditFeature, onStartTask, onStopTask, onResumeTask]
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ export interface TaskNodeData extends Feature {
|
|||||||
isDimmed?: boolean;
|
isDimmed?: boolean;
|
||||||
// Action callbacks
|
// Action callbacks
|
||||||
onViewLogs?: () => void;
|
onViewLogs?: () => void;
|
||||||
|
onViewDetails?: () => void;
|
||||||
onStartTask?: () => void;
|
onStartTask?: () => void;
|
||||||
onStopTask?: () => void;
|
onStopTask?: () => void;
|
||||||
onResumeTask?: () => void;
|
onResumeTask?: () => void;
|
||||||
onViewBranch?: () => void;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TaskNode = Node<TaskNodeData, 'task'>;
|
export type TaskNode = Node<TaskNodeData, 'task'>;
|
||||||
@@ -30,10 +30,10 @@ export type DependencyEdge = Edge<{
|
|||||||
|
|
||||||
export interface NodeActionCallbacks {
|
export interface NodeActionCallbacks {
|
||||||
onViewLogs?: (featureId: string) => void;
|
onViewLogs?: (featureId: string) => void;
|
||||||
|
onViewDetails?: (featureId: string) => void;
|
||||||
onStartTask?: (featureId: string) => void;
|
onStartTask?: (featureId: string) => void;
|
||||||
onStopTask?: (featureId: string) => void;
|
onStopTask?: (featureId: string) => void;
|
||||||
onResumeTask?: (featureId: string) => void;
|
onResumeTask?: (featureId: string) => void;
|
||||||
onViewBranch?: (featureId: string) => void;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface UseGraphNodesProps {
|
interface UseGraphNodesProps {
|
||||||
@@ -94,6 +94,9 @@ export function useGraphNodes({
|
|||||||
onViewLogs: actionCallbacks?.onViewLogs
|
onViewLogs: actionCallbacks?.onViewLogs
|
||||||
? () => actionCallbacks.onViewLogs!(feature.id)
|
? () => actionCallbacks.onViewLogs!(feature.id)
|
||||||
: undefined,
|
: undefined,
|
||||||
|
onViewDetails: actionCallbacks?.onViewDetails
|
||||||
|
? () => actionCallbacks.onViewDetails!(feature.id)
|
||||||
|
: undefined,
|
||||||
onStartTask: actionCallbacks?.onStartTask
|
onStartTask: actionCallbacks?.onStartTask
|
||||||
? () => actionCallbacks.onStartTask!(feature.id)
|
? () => actionCallbacks.onStartTask!(feature.id)
|
||||||
: undefined,
|
: undefined,
|
||||||
@@ -103,9 +106,6 @@ export function useGraphNodes({
|
|||||||
onResumeTask: actionCallbacks?.onResumeTask
|
onResumeTask: actionCallbacks?.onResumeTask
|
||||||
? () => actionCallbacks.onResumeTask!(feature.id)
|
? () => actionCallbacks.onResumeTask!(feature.id)
|
||||||
: undefined,
|
: undefined,
|
||||||
onViewBranch: actionCallbacks?.onViewBranch
|
|
||||||
? () => actionCallbacks.onViewBranch!(feature.id)
|
|
||||||
: undefined,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user