| ... | @@ -176,7 +176,7 @@ import { | ... | @@ -176,7 +176,7 @@ import { |
| 176 | VisualStudioCode, | 176 | VisualStudioCode, |
| 177 | Zed, | 177 | Zed, |
| 178 | } from "./Icons"; | 178 | } from "./Icons"; |
| 179 | import { cn, isMacPlatform, isWindowsPlatform } from "~/lib/utils"; | 179 | import { cn, isMacPlatform, isWindowsPlatform, randomUUID } from "~/lib/utils"; |
| 180 | import { Badge } from "./ui/badge"; | 180 | import { Badge } from "./ui/badge"; |
| 181 | import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; | 181 | import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; |
| 182 | import { Command, CommandItem, CommandList } from "./ui/command"; | 182 | import { Command, CommandItem, CommandList } from "./ui/command"; |
| ... | @@ -426,7 +426,7 @@ function readFileAsDataUrl(file: File): Promise<string> { | ... | @@ -426,7 +426,7 @@ function readFileAsDataUrl(file: File): Promise<string> { |
| 426 | | 426 | |
| 427 | function buildTemporaryWorktreeBranchName(): string { | 427 | function buildTemporaryWorktreeBranchName(): string { |
| 428 | // Keep the 8-hex suffix shape for backend temporary-branch detection. | 428 | // Keep the 8-hex suffix shape for backend temporary-branch detection. |
| 429 | const token = crypto.randomUUID().slice(0, 8).toLowerCase(); | 429 | const token = randomUUID().slice(0, 8).toLowerCase(); |
| 430 | return `${WORKTREE_BRANCH_PREFIX}/${token}`; | 430 | return `${WORKTREE_BRANCH_PREFIX}/${token}`; |
| 431 | } | 431 | } |
| 432 | | 432 | |
| ... | @@ -1363,13 +1363,13 @@ export default function ChatView({ threadId }: ChatViewProps) { | ... | @@ -1363,13 +1363,13 @@ export default function ChatView({ threadId }: ChatViewProps) { |
| 1363 | }, [activeThreadId, setTerminalOpen, terminalState.terminalOpen]); | 1363 | }, [activeThreadId, setTerminalOpen, terminalState.terminalOpen]); |
| 1364 | const splitTerminal = useCallback(() => { | 1364 | const splitTerminal = useCallback(() => { |
| 1365 | if (!activeThreadId || hasReachedTerminalLimit) return; | 1365 | if (!activeThreadId || hasReachedTerminalLimit) return; |
| 1366 | const terminalId = `terminal-${crypto.randomUUID()}`; | 1366 | const terminalId = `terminal-${randomUUID()}`; |
| 1367 | storeSplitTerminal(activeThreadId, terminalId); | 1367 | storeSplitTerminal(activeThreadId, terminalId); |
| 1368 | setTerminalFocusRequestId((value) => value + 1); | 1368 | setTerminalFocusRequestId((value) => value + 1); |
| 1369 | }, [activeThreadId, storeSplitTerminal, hasReachedTerminalLimit]); | 1369 | }, [activeThreadId, storeSplitTerminal, hasReachedTerminalLimit]); |
| 1370 | const createNewTerminal = useCallback(() => { | 1370 | const createNewTerminal = useCallback(() => { |
| 1371 | if (!activeThreadId || hasReachedTerminalLimit) return; | 1371 | if (!activeThreadId || hasReachedTerminalLimit) return; |
| 1372 | const terminalId = `terminal-${crypto.randomUUID()}`; | 1372 | const terminalId = `terminal-${randomUUID()}`; |
| 1373 | storeNewTerminal(activeThreadId, terminalId); | 1373 | storeNewTerminal(activeThreadId, terminalId); |
| 1374 | setTerminalFocusRequestId((value) => value + 1); | 1374 | setTerminalFocusRequestId((value) => value + 1); |
| 1375 | }, [activeThreadId, storeNewTerminal, hasReachedTerminalLimit]); | 1375 | }, [activeThreadId, storeNewTerminal, hasReachedTerminalLimit]); |
| ... | @@ -1438,7 +1438,7 @@ export default function ChatView({ threadId }: ChatViewProps) { | ... | @@ -1438,7 +1438,7 @@ export default function ChatView({ threadId }: ChatViewProps) { |
| 1438 | const shouldCreateNewTerminal = | 1438 | const shouldCreateNewTerminal = |
| 1439 | wantsNewTerminal && terminalState.terminalIds.length < MAX_THREAD_TERMINAL_COUNT; | 1439 | wantsNewTerminal && terminalState.terminalIds.length < MAX_THREAD_TERMINAL_COUNT; |
| 1440 | const targetTerminalId = shouldCreateNewTerminal | 1440 | const targetTerminalId = shouldCreateNewTerminal |
| 1441 | ? `terminal-${crypto.randomUUID()}` | 1441 | ? `terminal-${randomUUID()}` |
| 1442 | : baseTerminalId; | 1442 | : baseTerminalId; |
| 1443 | | 1443 | |
| 1444 | setTerminalOpen(true); | 1444 | setTerminalOpen(true); |
| ... | @@ -2331,7 +2331,7 @@ export default function ChatView({ threadId }: ChatViewProps) { | ... | @@ -2331,7 +2331,7 @@ export default function ChatView({ threadId }: ChatViewProps) { |
| 2331 | const previewUrl = URL.createObjectURL(file); | 2331 | const previewUrl = URL.createObjectURL(file); |
| 2332 | nextImages.push({ | 2332 | nextImages.push({ |
| 2333 | type: "image", | 2333 | type: "image", |
| 2334 | id: crypto.randomUUID(), | 2334 | id: randomUUID(), |
| 2335 | name: file.name || "image", | 2335 | name: file.name || "image", |
| 2336 | mimeType: file.type, | 2336 | mimeType: file.type, |
| 2337 | sizeBytes: file.size, | 2337 | sizeBytes: file.size, |