|
1 | 1 | import { useAuthStateValue } from "@features/auth/hooks/authQueries"; |
2 | 2 | import { DiffStatsBadge } from "@features/code-review/components/DiffStatsBadge"; |
3 | 3 | 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"; |
6 | 5 | import { useSessionForTask } from "@features/sessions/hooks/useSession"; |
7 | 6 | import { useSessionCallbacks } from "@features/sessions/hooks/useSessionCallbacks"; |
8 | 7 | import { SidebarTrigger } from "@features/sidebar/components/SidebarTrigger"; |
@@ -48,6 +47,29 @@ function LocalHandoffButton({ taskId, task }: { taskId: string; task: Task }) { |
48 | 47 | ); |
49 | 48 | } |
50 | 49 |
|
| 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 | + |
51 | 73 | export const HEADER_HEIGHT = 36; |
52 | 74 | const COLLAPSED_WIDTH = 110; |
53 | 75 | /** Width reserved for Windows title bar buttons (Close/Minimize/Maximize) */ |
@@ -172,13 +194,11 @@ export function HeaderRow() { |
172 | 194 | <DiffStatsBadge task={view.data} /> |
173 | 195 |
|
174 | 196 | {isCloudTask ? ( |
175 | | - <CloudGitInteractionHeader taskId={view.data.id} task={view.data} /> |
| 197 | + <CloudHandoffButton taskId={view.data.id} task={view.data} /> |
176 | 198 | ) : ( |
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} /> |
181 | 200 | )} |
| 201 | + <TaskActionsMenu taskId={view.data.id} isCloud={isCloudTask} /> |
182 | 202 | </Flex> |
183 | 203 | )} |
184 | 204 | </Flex> |
|
0 commit comments