From f0135da82e49d876e76a16d72112eb270621cde5 Mon Sep 17 00:00:00 2001 From: kumarabhirup Date: Mon, 2 Mar 2026 18:35:13 -0800 Subject: [PATCH] feat(web): add copyConfigAuth option to create-workspace-dialog --- .../workspace/create-workspace-dialog.tsx | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/apps/web/app/components/workspace/create-workspace-dialog.tsx b/apps/web/app/components/workspace/create-workspace-dialog.tsx index 8272f25be6b..731b262d2d8 100644 --- a/apps/web/app/components/workspace/create-workspace-dialog.tsx +++ b/apps/web/app/components/workspace/create-workspace-dialog.tsx @@ -10,7 +10,14 @@ type CreateWorkspaceDialogProps = { }; function shortenPath(p: string): string { - return p.replace(/^\/Users\/[^/]+/, "~").replace(/^\/home\/[^/]+/, "~"); + return p + .replace(/^\/Users\/[^/]+/, "~") + .replace(/^\/home\/[^/]+/, "~") + .replace(/^[A-Za-z]:[/\\]Users[/\\][^/\\]+/, "~"); +} + +function pathBasename(p: string): string { + return p.replaceAll("\\", "/").split("/").pop() || p; } export function CreateWorkspaceDialog({ isOpen, onClose, onCreated }: CreateWorkspaceDialogProps) { @@ -19,6 +26,7 @@ export function CreateWorkspaceDialog({ isOpen, onClose, onCreated }: CreateWork const [useCustomPath, setUseCustomPath] = useState(false); const [showDirPicker, setShowDirPicker] = useState(false); const [seedBootstrap, setSeedBootstrap] = useState(true); + const [copyConfigAuth, setCopyConfigAuth] = useState(true); const [creating, setCreating] = useState(false); const [error, setError] = useState(null); const [result, setResult] = useState<{ workspaceDir: string; seededFiles: string[] } | null>(null); @@ -32,6 +40,7 @@ export function CreateWorkspaceDialog({ isOpen, onClose, onCreated }: CreateWork setCustomPath(""); setUseCustomPath(false); setShowDirPicker(false); + setCopyConfigAuth(true); setError(null); setResult(null); setTimeout(() => inputRef.current?.focus(), 100); @@ -67,6 +76,7 @@ export function CreateWorkspaceDialog({ isOpen, onClose, onCreated }: CreateWork const body: Record = { profile: name, seedBootstrap, + copyConfigAuth, }; if (useCustomPath && customPath.trim()) { body.path = customPath.trim(); @@ -161,7 +171,7 @@ export function CreateWorkspaceDialog({ isOpen, onClose, onCreated }: CreateWork border: "1px solid var(--color-border)", }} > - {result.workspaceDir.replace(/^\/Users\/[^/]+/, "~")} + {shortenPath(result.workspaceDir)} {result.seededFiles.length > 0 && (

- {customPath.split("/").pop()} + {pathBasename(customPath)}

{shortenPath(customPath)} @@ -307,6 +317,21 @@ export function CreateWorkspaceDialog({ isOpen, onClose, onCreated }: CreateWork Seed bootstrap files and workspace database + {error && (