diff --git a/src/App.tsx b/src/App.tsx index 239a968e9..fc630a9ac 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -93,6 +93,7 @@ import { usePersistComposerSettings } from "./features/app/hooks/usePersistCompo import { useSyncSelectedDiffPath } from "./features/app/hooks/useSyncSelectedDiffPath"; import { useMenuAcceleratorController } from "./features/app/hooks/useMenuAcceleratorController"; import { useAppMenuEvents } from "./features/app/hooks/useAppMenuEvents"; +import { usePlanReadyActions } from "./features/app/hooks/usePlanReadyActions"; import { useWorkspaceActions } from "./features/app/hooks/useWorkspaceActions"; import { useWorkspaceCycling } from "./features/app/hooks/useWorkspaceCycling"; import { useThreadRows } from "./features/app/hooks/useThreadRows"; @@ -1711,6 +1712,17 @@ function MainApp() { ], ); + const { handlePlanAccept, handlePlanSubmitChanges } = usePlanReadyActions({ + activeWorkspace, + activeThreadId, + collaborationModes, + resolvedModel, + resolvedEffort, + connectWorkspace, + sendUserMessageToThread, + setSelectedCollaborationModeId, + }); + const orderValue = (entry: WorkspaceInfo) => typeof entry.settings.sortOrder === "number" ? entry.settings.sortOrder @@ -1880,6 +1892,8 @@ function MainApp() { handleApprovalDecision, handleApprovalRemember, handleUserInputSubmit, + onPlanAccept: handlePlanAccept, + onPlanSubmitChanges: handlePlanSubmitChanges, onOpenSettings: () => openSettings(), onOpenDictationSettings: () => openSettings("dictation"), onOpenDebug: handleDebugClick, diff --git a/src/features/app/components/PlanReadyFollowupMessage.tsx b/src/features/app/components/PlanReadyFollowupMessage.tsx new file mode 100644 index 000000000..7e5d78f8d --- /dev/null +++ b/src/features/app/components/PlanReadyFollowupMessage.tsx @@ -0,0 +1,61 @@ +import { useMemo, useState } from "react"; + +type PlanReadyFollowupMessageProps = { + onAccept: () => void; + onSubmitChanges: (changes: string) => void; +}; + +export function PlanReadyFollowupMessage({ + onAccept, + onSubmitChanges, +}: PlanReadyFollowupMessageProps) { + const [changes, setChanges] = useState(""); + const trimmed = useMemo(() => changes.trim(), [changes]); + + return ( +
+
+
+
Plan ready
+
+
+
+
+ Start building from this plan, or describe changes to the plan. +
+