Skip to content

Commit d107aac

Browse files
committed
feat(code): add PR actions to local tasks
1 parent 73e2848 commit d107aac

6 files changed

Lines changed: 498 additions & 369 deletions

File tree

apps/code/src/renderer/components/HeaderRow.tsx

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { useAuthStateValue } from "@features/auth/hooks/authQueries";
22
import { DiffStatsBadge } from "@features/code-review/components/DiffStatsBadge";
33
import { BranchSelector } from "@features/git-interaction/components/BranchSelector";
4-
import { CloudGitInteractionHeader } from "@features/git-interaction/components/CloudGitInteractionHeader";
5-
import { GitInteractionHeader } from "@features/git-interaction/components/GitInteractionHeader";
4+
import { TaskActionsMenu } from "@features/git-interaction/components/TaskActionsMenu";
65
import { useSessionForTask } from "@features/sessions/hooks/useSession";
76
import { useSessionCallbacks } from "@features/sessions/hooks/useSessionCallbacks";
87
import { SidebarTrigger } from "@features/sidebar/components/SidebarTrigger";
@@ -48,6 +47,29 @@ function LocalHandoffButton({ taskId, task }: { taskId: string; task: Task }) {
4847
);
4948
}
5049

50+
function CloudHandoffButton({ taskId, task }: { taskId: string; task: Task }) {
51+
const session = useSessionForTask(taskId);
52+
const { handleContinueLocally } = useSessionCallbacks({
53+
taskId,
54+
task,
55+
session: session ?? undefined,
56+
repoPath: null,
57+
});
58+
59+
return (
60+
<Button
61+
size="1"
62+
variant="soft"
63+
disabled={session?.handoffInProgress}
64+
onClick={handleContinueLocally}
65+
>
66+
<Text size="1">
67+
{session?.handoffInProgress ? "Transferring..." : "Continue locally"}
68+
</Text>
69+
</Button>
70+
);
71+
}
72+
5173
export const HEADER_HEIGHT = 36;
5274
const COLLAPSED_WIDTH = 110;
5375
/** Width reserved for Windows title bar buttons (Close/Minimize/Maximize) */
@@ -172,13 +194,11 @@ export function HeaderRow() {
172194
<DiffStatsBadge task={view.data} />
173195

174196
{isCloudTask ? (
175-
<CloudGitInteractionHeader taskId={view.data.id} task={view.data} />
197+
<CloudHandoffButton taskId={view.data.id} task={view.data} />
176198
) : (
177-
<>
178-
<LocalHandoffButton taskId={view.data.id} task={view.data} />
179-
<GitInteractionHeader taskId={view.data.id} />
180-
</>
199+
<LocalHandoffButton taskId={view.data.id} task={view.data} />
181200
)}
201+
<TaskActionsMenu taskId={view.data.id} isCloud={isCloudTask} />
182202
</Flex>
183203
)}
184204
</Flex>

apps/code/src/renderer/features/git-interaction/components/CloudGitInteractionHeader.tsx

Lines changed: 0 additions & 111 deletions
This file was deleted.

apps/code/src/renderer/features/git-interaction/components/GitInteractionHeader.tsx

Lines changed: 0 additions & 109 deletions
This file was deleted.

0 commit comments

Comments
 (0)