From 22568866e8669156b82df467df2f1e94b00274e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Sun, 7 Jun 2026 17:38:09 -0400 Subject: [PATCH] Add workspace creation to settings panel The workspace settings panel now includes an Add button that opens a dialog with name, local path (with directory picker), and optional project binding. Supports creating secondary workspaces beyond the initial bootstrap workspace. --- .../src/renderer/src/pages/SettingsPage.tsx | 2 +- .../src/pages/settings/WorkspacePanel.tsx | 92 +++++++++++++++---- 2 files changed, 76 insertions(+), 18 deletions(-) diff --git a/AgentCompany-New/src/renderer/src/pages/SettingsPage.tsx b/AgentCompany-New/src/renderer/src/pages/SettingsPage.tsx index b1a66363..8081ab10 100644 --- a/AgentCompany-New/src/renderer/src/pages/SettingsPage.tsx +++ b/AgentCompany-New/src/renderer/src/pages/SettingsPage.tsx @@ -123,7 +123,7 @@ export function SettingsPage({ snapshot, actions }: PageProps) {
- {tab === "workspace" && } + {tab === "workspace" && p.orgId === orgId)} orgId={orgId} actions={actions} />} {tab === "members" && ( { + const result = await window.agentCompany.pickDirectory(); + if (result.ok && result.data) { + const input = form.elements.namedItem("localPath") as HTMLInputElement | null; + if (input) input.value = result.data; + } + }; + + const submit = (event: FormEvent) => { + event.preventDefault(); + const form = new FormData(event.currentTarget); + void actions.run(() => window.agentCompany.createWorkspace({ + orgId, + name: text(form, "name"), + localPath: text(form, "localPath"), + projectId: optional(form, "projectId"), + })).then((result) => { if (result) setCreateOpen(false); }); + }; + return (

Workspace

@@ -30,22 +68,42 @@ export function WorkspacePanel({
- {workspaces.length > 0 && ( -
-
Workspaces
- {workspaces.map((workspace) => ( -
-
-
{workspace.name}
-
{workspace.localPath}
-
-
- {workspace.isPrimary ? Primary : Secondary} -
-
- ))} +
+
+
Workspaces
+
- )} + {workspaces.map((workspace) => ( +
+
+
{workspace.name}
+
{workspace.localPath}
+
+
+ {workspace.isPrimary ? Primary : Secondary} +
+
+ ))} + {workspaces.length === 0 &&
No workspaces configured
} +
+ + setCreateOpen(false)} onSubmit={submit}> + + +
+ + +
+
+ + + +
); }