diff --git a/apps/code/src/renderer/App.tsx b/apps/code/src/renderer/App.tsx
index 4c93f2c99..e4e5ea40a 100644
--- a/apps/code/src/renderer/App.tsx
+++ b/apps/code/src/renderer/App.tsx
@@ -158,7 +158,12 @@ function App() {
log.warn(
`Foreign branch checkout detected: ${focusedBranch} -> ${foreignBranch}. Auto-unfocusing.`,
);
- await useFocusStore.getState().disableFocus();
+ const result = await useFocusStore.getState().disableFocus();
+ if (!result.success && result.error) {
+ toast.error("Could not unfocus workspace", {
+ description: result.error,
+ });
+ }
},
}),
);
diff --git a/apps/code/src/renderer/features/git-interaction/components/BranchSelector.tsx b/apps/code/src/renderer/features/git-interaction/components/BranchSelector.tsx
index ab6615bb1..0ea81f965 100644
--- a/apps/code/src/renderer/features/git-interaction/components/BranchSelector.tsx
+++ b/apps/code/src/renderer/features/git-interaction/components/BranchSelector.tsx
@@ -127,6 +127,13 @@ export function BranchSelector({
onError: (error, { branchName }) => {
const message =
error instanceof Error ? error.message : "Unknown error occurred";
+ if (/would be overwritten by checkout/i.test(message)) {
+ toast.error(`Can't switch to ${branchName}`, {
+ description:
+ "You have uncommitted changes that would be overwritten. Commit or stash them first.",
+ });
+ return;
+ }
toast.error(`Failed to checkout ${branchName}`, {
description: message,
});
diff --git a/apps/code/src/renderer/features/onboarding/components/CliInstallStep.tsx b/apps/code/src/renderer/features/onboarding/components/CliInstallStep.tsx
index 85a72636a..7c3cd4a17 100644
--- a/apps/code/src/renderer/features/onboarding/components/CliInstallStep.tsx
+++ b/apps/code/src/renderer/features/onboarding/components/CliInstallStep.tsx
@@ -1,16 +1,18 @@
+import { Tooltip } from "@components/ui/Tooltip";
import {
ArrowLeft,
ArrowRight,
ArrowSquareOut,
ArrowsClockwise,
+ Check,
CheckCircle,
CircleNotch,
+ Copy,
GitBranch,
GithubLogo,
- Terminal,
Warning,
} from "@phosphor-icons/react";
-import { Box, Button, Code, Flex, Text } from "@radix-ui/themes";
+import { Box, Button, Flex, IconButton, Text } from "@radix-ui/themes";
import builderHog from "@renderer/assets/images/hedgehogs/builder-hog-03.png";
import { trpcClient, useTRPC } from "@renderer/trpc/client";
import { useQuery, useQueryClient } from "@tanstack/react-query";
@@ -20,6 +22,45 @@ import { useCallback, useState } from "react";
import { OnboardingHogTip } from "./OnboardingHogTip";
import { StepActions } from "./StepActions";
+function CommandLine({ command }: { command: string }) {
+ const [copied, setCopied] = useState(false);
+
+ const handleCopy = useCallback(async () => {
+ await navigator.clipboard.writeText(command);
+ setCopied(true);
+ setTimeout(() => setCopied(false), 2000);
+ }, [command]);
+
+ return (
+
+
+
+ $
+
+
+ {command}
+
+
+
+ void handleCopy()}
+ aria-label="Copy command"
+ >
+ {copied ? : }
+
+
+
+ );
+}
+
interface CliInstallStepProps {
onNext: () => void;
onBack: () => void;
@@ -135,29 +176,13 @@ export function CliInstallStep({ onNext, onBack }: CliInstallStepProps) {
Install with Homebrew or Xcode Command Line Tools:
-
-
-
- brew install git
-
-
-
-
-
- xcode-select --install
-
-
+
+
-
+