Skip to content

Commit b90c348

Browse files
authored
fix: properly style hand-off button + no-drag (#1914)
1 parent 3e8c403 commit b90c348

2 files changed

Lines changed: 29 additions & 18 deletions

File tree

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

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ import { HandoffConfirmDialog } from "@features/sessions/components/HandoffConfi
1010
import { useSessionForTask } from "@features/sessions/hooks/useSession";
1111
import { getLocalHandoffService } from "@features/sessions/service/localHandoffService";
1212
import { useHandoffDialogStore } from "@features/sessions/stores/handoffDialogStore";
13-
import { Button, Text } from "@radix-ui/themes";
13+
import { useFeatureFlag } from "@hooks/useFeatureFlag";
14+
import { Laptop, Spinner } from "@phosphor-icons/react";
15+
import { Button as QuillButton } from "@posthog/quill";
1416
import type { Task } from "@shared/types";
1517
import { useState } from "react";
1618

19+
const CLOUD_HANDOFF_FLAG = "phc-cloud-handoff";
20+
1721
interface CloudGitInteractionHeaderProps {
1822
taskId: string;
1923
task: Task;
@@ -25,6 +29,8 @@ export function CloudGitInteractionHeader({
2529
}: CloudGitInteractionHeaderProps) {
2630
const session = useSessionForTask(taskId);
2731
const localHandoff = getLocalHandoffService();
32+
const cloudHandoffEnabled =
33+
useFeatureFlag(CLOUD_HANDOFF_FLAG) || import.meta.env.DEV;
2834

2935
const confirmOpen = useHandoffDialogStore((s) => s.confirmOpen);
3036
const direction = useHandoffDialogStore((s) => s.direction);
@@ -78,20 +84,29 @@ export function CloudGitInteractionHeader({
7884
await localHandoff.resumePending();
7985
};
8086

87+
if (!cloudHandoffEnabled) return null;
88+
89+
const inProgress = session?.handoffInProgress ?? false;
90+
8191
return (
8292
<>
83-
<Button
84-
size="1"
85-
variant="soft"
86-
disabled={session?.handoffInProgress}
87-
onClick={() =>
88-
localHandoff.openConfirm(taskId, session?.cloudBranch ?? null)
89-
}
90-
>
91-
<Text className="text-[13px]">
92-
{session?.handoffInProgress ? "Transferring..." : "Continue locally"}
93-
</Text>
94-
</Button>
93+
<div className="no-drag flex items-center">
94+
<QuillButton
95+
variant="outline"
96+
size="sm"
97+
disabled={inProgress}
98+
onClick={() =>
99+
localHandoff.openConfirm(taskId, session?.cloudBranch ?? null)
100+
}
101+
>
102+
{inProgress ? (
103+
<Spinner size={14} className="shrink-0 animate-spin" />
104+
) : (
105+
<Laptop size={14} weight="regular" className="shrink-0" />
106+
)}
107+
{inProgress ? "Transferring..." : "Continue locally"}
108+
</QuillButton>
109+
</div>
95110
{confirmOpen && direction === "to-local" && (
96111
<HandoffConfirmDialog
97112
open={confirmOpen}

apps/code/src/renderer/features/sessions/components/HandoffConfirmDialog.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,7 @@ export function HandoffConfirmDialog({
3636
>
3737
<Text color="gray" className="text-[13px]">
3838
{isToLocal ? (
39-
<>
40-
This will bring your changes from the cloud run into your local
41-
environment on branch{" "}
42-
<Code className="text-[13px]">{branchName ?? "unknown"}</Code>.
43-
</>
39+
"This will bring your changes from the cloud run into your local environment."
4440
) : (
4541
<>
4642
This will send your changes on branch{" "}

0 commit comments

Comments
 (0)