Skip to content

A local-first multi-agent app development platform, built on PenguinHarness

feat(web): the Workspace finder offers a plain "Start in a temporary workspace" button and drops its hint line and title bar (#907)

Yaowei Zheng38cc260c8c85
diff --git a/changelog/unreleased/2026-09-30-finder-temp-button.md b/changelog/unreleased/2026-09-30-finder-temp-button.md
new file mode 100644
index 00000000..1a5fc418
--- /dev/null
+++ b/changelog/unreleased/2026-09-30-finder-temp-button.md
@@ -0,0 +1,19 @@
+# Workspace finder offers the temporary workspace as a button
+
+- **Date:** 2026-09-30
+- **Type:** feature
+- **Scope:** `web`, `docs`
+- **PR:** [#907](https://github.com/Prism-Shadow/penguin-harness/pull/907)
+
+[中文版](2026-09-30-finder-temp-button.zh.md)
+
+The Workspace finder's bottom-left became a button, **Start in a temporary workspace**. It replaced the underlined link and the hint "leave empty for a temporary workspace; if set, it must be an existing directory on the server".
+
+## Details
+
+- The button appears wherever the picker offers no folder (the chat draft, Project settings → Defaults, the schedule form), whether or not a folder is chosen. It is plain text.
+- Its tooltip names where the temporary Workspace would be created (`…/agents/<agent>/workspaces/tmp-…`), derived from the `stateDir` of the Agent's config. When the Agent is not known (Defaults with no default Agent) or another machine is being browsed, the tooltip states the rule instead.
+- The hint also left the picker's tooltip and the Workspace fields in Project settings → Defaults and the schedule form. The company workspace field dropped its own version of it.
+- The company workspace picker's button reads **Use the organization's own directory**, and the Agent create dialog's reads **Don't import from a directory**. The sidebar's new-workspace finder has no such button.
+- The finder has no title bar any more; Cancel is the way out.
+- On a narrow screen the label truncates, and Cancel and Choose keep their width.
diff --git a/changelog/unreleased/2026-09-30-finder-temp-button.zh.md b/changelog/unreleased/2026-09-30-finder-temp-button.zh.md
new file mode 100644
index 00000000..38b3cfd7
--- /dev/null
+++ b/changelog/unreleased/2026-09-30-finder-temp-button.zh.md
@@ -0,0 +1,19 @@
+# Workspace 选择器以按钮提供临时工作区
+
+- **Date:** 2026-09-30
+- **Type:** feature
+- **Scope:** `web`, `docs`
+- **PR:** [#907](https://github.com/Prism-Shadow/penguin-harness/pull/907)
+
+[English](2026-09-30-finder-temp-button.md)
+
+Workspace 选择器的左下角改为一枚按钮「从临时工作区开始」,取代原先带下划线的链接和「留空自动创建临时工作区;指定时必须是服务器上已存在的目录」这句提示。
+
+## 细节
+
+- 凡是选择器允许不选目录的地方(对话草稿、Project 设置 → 默认值、定时任务表单),这枚按钮都在,无论当前是否已选目录;按钮只有文字。
+- 悬停提示写明临时工作区将建在的位置(`…/agents/<agent>/workspaces/tmp-…`),由 Agent 配置的 `stateDir` 推得;不知道 Agent(默认值里未设置默认 Agent)或正在浏览其他机器时,悬停提示改为说明规则。
+- 这句提示同时从选择器的悬停提示、Project 设置 → 默认值与定时任务表单的 Workspace 字段下移除;公司工作区字段也去掉了自己的那一版。
+- 公司工作区选择器的按钮为「使用组织自己的目录」,新建 Agent 弹窗的为「不从目录导入」;侧边栏的新建工作区选择器没有这枚按钮。
+- 选择器不再有标题栏,由「取消」退出。
+- 窄屏下截断按钮文字,取消与选择保持原宽。
diff --git a/packages/docs/content/agents.en.md b/packages/docs/content/agents.en.md
index f1f75af3..3eea055d 100644
--- a/packages/docs/content/agents.en.md
+++ b/packages/docs/content/agents.en.md
@@ -355,7 +355,7 @@ Only the Project owner can create a task manually.
3. In **Period**, enter how often the task runs, such as `30m`, `12h` or `7d`. Leave it empty for a one-off task. The shortest period is 5 minutes.
4. Set **Start at**, and optionally **End at**.
5. Under **Target**, choose where the prompt goes:
- - **New session each time**: every run starts a new Session. Optionally choose a **Model** (the Project default if you choose none) and a **Workspace** (a temporary Workspace if you leave it empty).
+ - **New session each time**: every run starts a new Session. Optionally choose a **Model** (the Project default if you choose none) and a **Workspace** (a temporary Workspace if you choose none).
- **Bound Session**: every run goes to one existing Session. Choose it in **Session**.
6. In **Prompt**, enter what to send.
7. Leave **Enabled** selected to activate the task, then select **Create**.
diff --git a/packages/docs/content/agents.zh.md b/packages/docs/content/agents.zh.md
index e84ce981..d3332a94 100644
--- a/packages/docs/content/agents.zh.md
+++ b/packages/docs/content/agents.zh.md
@@ -355,7 +355,7 @@ PenguinHarness 依次连接每个 Server 并发现它的工具,不会保存任
3. 在**周期**中输入任务运行频率,例如 `30m`、`12h` 或 `7d`。一次性任务留空。最短周期为 5 分钟。
4. 设置**开始时间**,也可以设置**结束时间**。
5. 在**目标**下选择提示词发到哪里:
- - **每次新建会话**:每次运行都新建一个 Session。可以再选 **Model**(不选就用 Project 默认值)和 **Workspace**(留空就用临时 Workspace)。
+ - **每次新建会话**:每次运行都新建一个 Session。可以再选 **Model**(不选就用 Project 默认值)和 **Workspace**(不选就用临时 Workspace)。
- **绑定 Session**:每次运行都发给同一个已有的 Session。在 **Session** 中选择。
6. 在 **Prompt** 中输入要发送的内容。
7. 保持勾选**启用**以激活任务,然后选择**创建**。
diff --git a/packages/docs/content/chat.en.md b/packages/docs/content/chat.en.md
index 1bbef176..6b10f72e 100644
--- a/packages/docs/content/chat.en.md
+++ b/packages/docs/content/chat.en.md
@@ -17,7 +17,7 @@ The chat page is where you work with an agent. You start a conversation, follow
A new conversation starts as a draft. The Session is created when you send the first message.
1. In the sidebar, select **New chat**. The draft opens on the agent in the Project's **New chat defaults**, as long as that agent still exists in the Project; otherwise on `default_agent`, and otherwise on the first agent.
-2. Above the composer, pick the **Agent**, the **Workspace** (a directory on the server, chosen in a directory browser), the **Approval mode**, the **Model** and the **Thinking level**.
+2. Above the composer, pick the **Agent**, the **Workspace** (a directory on the server, chosen in a directory browser; to use none, select **Start in a temporary workspace** at its bottom left), the **Approval mode**, the **Model** and the **Thinking level**.
3. Type your message and press Enter.
Once the Session exists, its model and Workspace are locked. To move to another model later, see [Switch the model](#switch-the-model).
diff --git a/packages/docs/content/chat.zh.md b/packages/docs/content/chat.zh.md
index 4222214b..6af014b9 100644
--- a/packages/docs/content/chat.zh.md
+++ b/packages/docs/content/chat.zh.md
@@ -17,7 +17,7 @@ description: 与 Agent 开始对话,实时跟进它的工作,并在 Task 运
新对话从草稿开始,发送第一条消息时才创建 Session。
1. 在侧边栏选择**新建对话**。草稿默认使用 Project **新对话默认值**里的那个 Agent,前提是它还在这个 Project 里;否则用 `default_agent`,再没有就用第一个 Agent。
-2. 在输入框上方选择 **Agent**、**Workspace**(服务器上的一个目录,在目录浏览器中选取)、**审批模式**、**Model** 和**思考等级**。
+2. 在输入框上方选择 **Agent**、**Workspace**(服务器上的一个目录,在目录浏览器中选取;不选目录时点击其左下角的**从临时工作区开始**)、**审批模式**、**Model** 和**思考等级**。
3. 输入消息,按 Enter 发送。
Session 创建后,模型和 Workspace 就锁定了。之后想换模型,见[切换模型](#切换模型)。
diff --git a/packages/web/src/components/layout/project-dialogs.tsx b/packages/web/src/components/layout/project-dialogs.tsx
index 7b03a960..10b3f82c 100644
--- a/packages/web/src/components/layout/project-dialogs.tsx
+++ b/packages/web/src/components/layout/project-dialogs.tsx
@@ -17,7 +17,6 @@ import {
Button,
ConfirmModal,
FieldError,
- FieldHint,
FieldLabel,
ICONS,
InfoPopover,
@@ -716,14 +715,15 @@ function ChatDefaultsSection({ projectId, isOwner }: { projectId: string; isOwne
<div className="sm:col-span-2">
<FieldLabel>{S.chat.workspace}</FieldLabel>
{/* The draft page's folder finder: browse server directories, go to a typed
- path, or clear back to a temporary workspace. */}
+ path, or start in a temporary workspace. That one would belong to the
+ default Agent when one is set, so the finder can show where. */}
<WorkspaceSelect
projectId={projectId}
workspace={workspace}
onChange={setWorkspace}
+ {...(agentId ? { agentId } : {})}
variant="form"
/>
- <FieldHint>{S.chat.workspaceHintShort}</FieldHint>
</div>
</div>
<div className="mt-3 flex justify-end">
diff --git a/packages/web/src/components/layout/sidebar.tsx b/packages/web/src/components/layout/sidebar.tsx
index 66ccf0c5..f7533737 100644
--- a/packages/web/src/components/layout/sidebar.tsx
+++ b/packages/web/src/components/layout/sidebar.tsx
@@ -2285,6 +2285,7 @@ export function Sidebar({
// machine is chosen; the draft and settings pickers edit a workspace that
// already has one.
chooseMachine
+ clearable={false}
trigger={(open, toggle) => (
<SidebarControl
label={newEntityLabel}
diff --git a/packages/web/src/features/agents/agents-page.tsx b/packages/web/src/features/agents/agents-page.tsx
index 12644746..cd60bac0 100644
--- a/packages/web/src/features/agents/agents-page.tsx
+++ b/packages/web/src/features/agents/agents-page.tsx
@@ -931,7 +931,6 @@ export function AgentsPage() {
variant="form"
fieldLabel={S.agent.createDirSkills}
emptyLabel={S.agent.createDirSkillsPick}
- menuHint={S.agent.createDirSkillsHint}
clearLabel={S.agent.createDirSkillsClear}
/>
{skillsDir && dirSkills !== null && dirSkills.length > 0 && (
diff --git a/packages/web/src/features/chat/draft-view.tsx b/packages/web/src/features/chat/draft-view.tsx
index 5f1329b9..a0fdee77 100644
--- a/packages/web/src/features/chat/draft-view.tsx
+++ b/packages/web/src/features/chat/draft-view.tsx
@@ -931,6 +931,7 @@ export function DraftView({
machineId={workspaceMachine}
onChange={changeWorkspace}
chooseMachine
+ {...(agentId ? { agentId } : {})}
/>
</div>
diff --git a/packages/web/src/features/chat/workspace-finder-model.ts b/packages/web/src/features/chat/workspace-finder-model.ts
index 7d57cf42..03d82c37 100644
--- a/packages/web/src/features/chat/workspace-finder-model.ts
+++ b/packages/web/src/features/chat/workspace-finder-model.ts
@@ -2,8 +2,8 @@
* The Workspace finder's decisions, kept apart from the modal so they are testable without a
* DOM: path breadcrumbs, back/forward history, what the list shows and in which order,
* type-to-select, the sidebar's places (Quick access, with the user's own additions and
- * removals), the context menu's items, the keyboard map, and what the box for a folder the
- * server may not read offers.
+ * removals), the context menu's items, the keyboard map, what the box for a folder the
+ * server may not read offers, and the footer's no-folder button.
*
* Paths come from whichever machine is being browsed, so nothing here asks the browser's own
* platform about a path — a Windows server's `C:\Users\me` and a Linux one's `/home/me` both
@@ -79,6 +79,11 @@ export function baseName(path: string): string {
return crumbs[crumbs.length - 1]?.label ?? path;
}
+/** The separator a path's own family uses: a drive path or a UNC share splits on `\`. */
+function separatorOf(path: string): string {
+ return /^[A-Za-z]:|^\\\\/.test(path) ? "\\" : "/";
+}
+
/** Back/forward history: the visited folders and where in them the finder stands. */
export interface NavHistory {
entries: string[];
@@ -527,3 +532,43 @@ export function deniedBox(input: {
retry: false,
};
}
+
+/**
+ * The folder a temporary Workspace would get. Core creates `<agent dir>/workspaces/tmp-<8hex>`
+ * for a Session started without one, and the Agent's config names `<agent dir>/agent_state`,
+ * which locates that Agent directory. The random part is drawn only with the Session, so it
+ * stays `tmp-…`. Null for a directory not shaped like an Agent State one: no path beats a
+ * wrong one.
+ */
+export function tempWorkspacePath(stateDir: string): string | null {
+ const agentDir = parentOf(stateDir);
+ if (agentDir === null || baseName(stateDir) !== "agent_state") return null;
+ const sep = separatorOf(agentDir);
+ return `${agentDir}${agentDir.endsWith(sep) ? "" : sep}workspaces${sep}tmp-…`;
+}
+
+/** The footer's "no folder" button (see clearButton). */
+export interface ClearButton {
+ /** The folder a temporary Workspace would get, for the tooltip; null when not known here. */
+ fullPath: string | null;
+}
+
+/**
+ * The footer's "no folder" button: there whenever the host offers going back to no folder,
+ * whatever is chosen now. Its tooltip names the folder a temporary Workspace would get once the
+ * Agent's `agent_state` directory is known, and only while this server is browsed: that
+ * directory is this server's, and another machine lays out its own.
+ */
+export function clearButton(input: {
+ /** The host offers no folder: a temporary Workspace, or its own empty value. */
+ offered: boolean;
+ /** The Agent's `agent_state` directory on this server; null when unknown. */
+ stateDir: string | null;
+ /** The machine being browsed (null: this server). */
+ machine: string | null;
+}): ClearButton | null {
+ if (!input.offered) return null;
+ const full =
+ input.stateDir !== null && input.machine === null ? tempWorkspacePath(input.stateDir) : null;
+ return { fullPath: full };
+}
diff --git a/packages/web/src/features/chat/workspace-finder.tsx b/packages/web/src/features/chat/workspace-finder.tsx
index 105b2d54..ce600e00 100644
--- a/packages/web/src/features/chat/workspace-finder.tsx
+++ b/packages/web/src/features/chat/workspace-finder.tsx
@@ -61,6 +61,7 @@ import {
baseName,
canGoBack,
canGoForward,
+ clearButton,
defaultPlaces,
deniedBox,
drivePlaces,
@@ -158,9 +159,10 @@ export function WorkspaceFinder({
workspace,
machineId,
chooseMachine,
+ agentId,
title,
- hint,
clearLabel,
+ clearTitle,
}: {
open: boolean;
onClose: () => void;
@@ -175,9 +177,13 @@ export function WorkspaceFinder({
machineId?: string | null;
/** Offer the Machines section. */
chooseMachine?: boolean;
+ /** The Agent a temporary Workspace would belong to: the footer button then shows the folder it would get. */
+ agentId?: string;
title: string;
- hint: string;
+ /** The footer button that takes `onClear`. */
clearLabel: string;
+ /** That button's tooltip while the folder it stands for is not known here. */
+ clearTitle?: string;
}) {
const f = S.chat.finder;
const isMac = useMemo(isMacPlatform, []);
@@ -350,6 +356,27 @@ export function WorkspaceFinder({
};
}, [open, chooseMachine, projectId]);
+ /**
+ * The `agent_state` directory of the Agent a temporary Workspace would belong to, from that
+ * Agent's config on this server: the footer button's path is built from it. Kept per Agent,
+ * the way the home listing is kept per machine.
+ */
+ const [agentState, setAgentState] = useState<{ agentId: string; dir: string } | null>(null);
+ useEffect(() => {
+ if (!open || agentId === undefined || agentState?.agentId === agentId) return;
+ let cancelled = false;
+ void api
+ .getAgentConfig(projectId, agentId)
+ .then((res) => {
+ if (!cancelled) setAgentState({ agentId, dir: res.stateDir });
+ })
+ .catch(() => undefined);
+ return () => {
+ cancelled = true;
+ };
+ // Not keyed on `agentState`, which is what this fills in.
+ }, [open, agentId, projectId]);
+
const { workspaceLatestByAgent } = useSessions();
const recents = useMemo(
() =>
@@ -1288,21 +1315,27 @@ export function WorkspaceFinder({
});
}
+ const clear = clearButton({
+ offered: onClear !== undefined,
+ stateDir: agentState !== null && agentState.agentId === agentId ? agentState.dir : null,
+ machine,
+ });
+
const footer = (
<>
- <div className="mr-auto flex min-w-0 flex-col justify-center gap-0.5 self-center">
- {onClear !== undefined && workspace.trim() !== "" && (
- <button
- type="button"
- onClick={() => onClear(machine)}
- className="self-start text-xs text-gray-500 underline decoration-gray-300 underline-offset-2 transition-colors duration-150 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200"
- >
- {clearLabel}
- </button>
- )}
- <p className="line-clamp-2 text-xs leading-5 text-gray-400 dark:text-gray-500">{hint}</p>
- </div>
- {/* The buttons keep their width; on a phone the hint beside them wraps instead. */}
+ {/* The host's "no folder" choice: a plain text button whatever is chosen now; the folder a
+ temporary Workspace would get is its tooltip. */}
+ {clear !== null && (
+ <Button
+ size="sm"
+ title={clear.fullPath ?? clearTitle}
+ className="mr-auto min-w-0 self-center"
+ onClick={() => onClear?.(machine)}
+ >
+ <span className="min-w-0 truncate">{clearLabel}</span>
+ </Button>
+ )}
+ {/* The buttons keep their width; on a phone the button beside them truncates instead. */}
<Button size="sm" className="shrink-0 self-center whitespace-nowrap" onClick={onClose}>
{S.common.cancel}
</Button>
@@ -1324,6 +1357,9 @@ export function WorkspaceFinder({
open={open}
title={title}
onClose={onClose}
+ // No title bar: Cancel in the footer (and Escape, and the backdrop) is the way out, and
+ // the title still names the dialog for assistive tech.
+ headerless
bare
fullScreenOnPhone
widthClass="sm:h-[min(36rem,85vh)] sm:max-w-3xl"
diff --git a/packages/web/src/features/chat/workspace-select.tsx b/packages/web/src/features/chat/workspace-select.tsx
index 804ca469..29d401f8 100644
--- a/packages/web/src/features/chat/workspace-select.tsx
+++ b/packages/web/src/features/chat/workspace-select.tsx
@@ -26,7 +26,7 @@ export const pillClass =
/**
* Workspace selection: the trigger shows the selected directory's name (empty = a temporary
* workspace, or the host's `emptyLabel`) and opens the finder. Callers get `onChange(path,
- * machineId)` on Choose, and `onChange("", machineId)` from the finder's clear link.
+ * machineId)` on Choose, and `onChange("", machineId)` from the finder's no-folder button.
*/
export function WorkspaceSelect({
projectId,
@@ -34,12 +34,13 @@ export function WorkspaceSelect({
onChange,
machineId,
chooseMachine,
+ agentId,
variant = "pill",
trigger,
fieldLabel,
emptyLabel,
- menuHint,
clearLabel,
+ clearable = true,
}: {
projectId: string;
workspace: string;
@@ -49,6 +50,8 @@ export function WorkspaceSelect({
machineId?: string | null;
/** Offer the Machines section. Off where a machine cannot be meaningfully chosen yet. */
chooseMachine?: boolean;
+ /** The Agent a temporary Workspace would belong to, so the finder can show where it would be created. */
+ agentId?: string;
/** Trigger style: the draft page's pill (default), or a dialog form control (see the header comment). */
variant?: "pill" | "form";
/**
@@ -66,9 +69,17 @@ export function WorkspaceSelect({
*/
fieldLabel?: string;
emptyLabel?: string;
- menuHint?: string;
- /** Copy for the "back to a temporary workspace" link, which for a non-Workspace host just clears the field. */
+ /**
+ * The finder's no-folder button, for a host whose empty value is not a temporary Workspace
+ * (the organization's own directory, or no directory at all): it shows this label alone,
+ * since the path it would name and the rule behind it are the temporary Workspace's.
+ */
clearLabel?: string;
+ /**
+ * Offer that button (the default). Off for the sidebar's new-workspace button, which adds a
+ * folder and has no empty value to go back to.
+ */
+ clearable?: boolean;
}) {
const fieldName = fieldLabel ?? S.chat.workspace;
const [open, setOpen] = useState(false);
@@ -76,8 +87,8 @@ export function WorkspaceSelect({
const trimmed = workspace.trim();
// Short name: the last segment of the directory (a root keeps its own spelling); "temporary workspace" when empty.
const label = trimmed ? baseName(trimmed) : (emptyLabel ?? S.chat.workspaceAuto);
- const hint = menuHint ?? S.chat.workspaceHint;
- const title = trimmed ? `${fieldName}:${trimmed}` : hint;
+ // The field and its value, the whole path where the label shows only its last segment.
+ const title = `${fieldName}:${trimmed || label}`;
const finder = (
<WorkspaceFinder
@@ -87,17 +98,22 @@ export function WorkspaceSelect({
onChange(path, machine);
setOpen(false);
}}
- onClear={(machine) => {
- onChange("", machine);
- setOpen(false);
- }}
+ onClear={
+ clearable
+ ? (machine) => {
+ onChange("", machine);
+ setOpen(false);
+ }
+ : undefined
+ }
projectId={projectId}
workspace={workspace}
machineId={machineId}
chooseMachine={chooseMachine}
+ agentId={agentId}
title={fieldName}
- hint={hint}
clearLabel={clearLabel ?? S.chat.workspaceClear}
+ clearTitle={clearLabel === undefined ? S.chat.workspaceTempRule : undefined}
/>
);
diff --git a/packages/web/src/features/company/org-dialogs.tsx b/packages/web/src/features/company/org-dialogs.tsx
index 9f870e97..c5d0ed67 100644
--- a/packages/web/src/features/company/org-dialogs.tsx
+++ b/packages/web/src/features/company/org-dialogs.tsx
@@ -225,10 +225,8 @@ function WorkspaceField({
variant="form"
fieldLabel={S.company.workspaceField}
emptyLabel={S.company.workspaceEmpty}
- menuHint={S.company.workspaceMenuHint}
clearLabel={S.company.workspaceClear}
/>
- <FieldHint>{S.company.workspaceHint}</FieldHint>
</div>
);
}
diff --git a/packages/web/src/features/schedules/schedule-form-modal.tsx b/packages/web/src/features/schedules/schedule-form-modal.tsx
index 63807e13..a21bd71b 100644
--- a/packages/web/src/features/schedules/schedule-form-modal.tsx
+++ b/packages/web/src/features/schedules/schedule-form-modal.tsx
@@ -24,7 +24,6 @@ import {
Button,
Checkbox,
FieldError,
- FieldHint,
FieldLabel,
FormPicker,
Input,
@@ -468,9 +467,9 @@ function ScheduleFormDialog({
projectId={projectId}
workspace={form.workspace}
onChange={(workspace) => set({ workspace })}
+ agentId={agentId}
variant="form"
/>
- <FieldHint>{S.chat.workspaceHintShort}</FieldHint>
</div>
</>
)}
diff --git a/packages/web/src/lib/strings-en.ts b/packages/web/src/lib/strings-en.ts
index a0b1dd07..14b12f3b 100644
--- a/packages/web/src/lib/strings-en.ts
+++ b/packages/web/src/lib/strings-en.ts
@@ -1050,7 +1050,7 @@ export const en: Strings = {
createDirSkillsEmpty: "This directory carries no installable Skills",
createDirSkillsFound: (n: number): string =>
`${n} skill${n === 1 ? "" : "s"} found in this directory`,
- createDirSkillsClear: "Clear the selected directory",
+ createDirSkillsClear: "Don't import from a directory",
createSnapshot: "Initialize from a snapshot",
createSnapshotPick: "Choose a snapshot package",
createSnapshotHint:
@@ -2291,7 +2291,9 @@ export const en: Strings = {
"no-identity": "not identified",
},
workspaceAuto: "Temporary workspace",
- workspaceClear: "Use a temporary workspace instead",
+ /** The finder's no-folder button; `workspaceTempRule` is its tooltip while the folder it would get is unknown. */
+ workspaceClear: "Start in a temporary workspace",
+ workspaceTempRule: "A new empty folder inside the agent's workspaces/ folder",
workspaceDirInvalid: "Directory does not exist or is inaccessible; reverted",
/** The Workspace finder: the modal the Workspace pickers open (workspace-finder.tsx). */
finder: {
@@ -2585,10 +2587,6 @@ Scenarios:
agent: "Agent",
model: "Model",
workspace: "Workspace",
- workspaceHint:
- "Leave empty for an auto-created temporary workspace; if set, it must be an existing directory on the server",
- /** The same rule as `workspaceHint`, short enough to sit under a form field. */
- workspaceHintShort: "Leave empty for a temporary workspace",
approvalMode: "Approval mode",
/** The composer's permission button: one colored shield for the level, a menu of Fs / Network / More. */
permission: {
@@ -4041,11 +4039,8 @@ Scenarios:
workspaceField: "Company workspace",
workspaceInfo:
"The directory the employees work in together: each employee's workspace is one of its sub-directories (or all of it), and desk and ticket sessions run inside it.",
- workspaceHint:
- "Leave empty for the organization's own workspace/ directory; a path must be an existing directory on the server",
workspaceEmpty: "The organization's own workspace/ directory",
- workspaceMenuHint: "Pick an existing directory as the company workspace",
- workspaceClear: "Back to the organization's own directory",
+ workspaceClear: "Use the organization's own directory",
/** CEO budget field (create dialog): the CEO's ceiling is the company's, since everyone reports to it. */
ceoBudget: "CEO budget",
ceoBudgetHint: "A monthly cap; the CEO's budget is the whole company's",
diff --git a/packages/web/src/lib/strings.ts b/packages/web/src/lib/strings.ts
index 911a12e6..9b32daa3 100644
--- a/packages/web/src/lib/strings.ts
+++ b/packages/web/src/lib/strings.ts
@@ -1095,7 +1095,7 @@ export const zh = {
createDirSkillsHint: "选择一个项目目录,读取其 .agents/skills 与 .claude/skills 下的技能",
createDirSkillsEmpty: "该目录下没有可安装的技能",
createDirSkillsFound: (n: number): string => `该目录下找到 ${n} 个技能`,
- createDirSkillsClear: "清除已选目录",
+ createDirSkillsClear: "不从目录导入",
/** Create dialog's optional snapshot seed: the new Agent starts from an exported package. */
createSnapshot: "从快照初始化",
createSnapshotPick: "选择快照包",
@@ -2326,7 +2326,9 @@ export const zh = {
"no-identity": "待识别",
},
workspaceAuto: "临时工作区",
- workspaceClear: "改用临时工作区",
+ /** The finder's no-folder button; `workspaceTempRule` is its tooltip while the folder it would get is unknown. */
+ workspaceClear: "从临时工作区开始",
+ workspaceTempRule: "在 Agent 目录的 workspaces/ 下新建一个空目录",
workspaceDirInvalid: "目录不存在或无法访问,已回退",
/** The Workspace finder: the modal the Workspace pickers open (workspace-finder.tsx). */
finder: {
@@ -2632,9 +2634,6 @@ Benchmark:
agent: "Agent",
model: "Model",
workspace: "Workspace",
- workspaceHint: "留空自动创建临时工作区;指定时必须是服务器上已存在的目录",
- /** The same rule as `workspaceHint`, short enough to sit under a form field. */
- workspaceHintShort: "留空自动创建临时工作区",
approvalMode: "审批模式",
/** The composer's permission button: one colored shield for the level, a menu of Fs / Network / More. */
permission: {
@@ -4067,10 +4066,8 @@ Benchmark:
workspaceField: "公司工作区",
workspaceInfo:
"员工共同工作的目录:每位员工的工作区是它的一个子目录(或整个目录),工位会话与工单会话都在其中运行。",
- workspaceHint: "留空则使用组织自己的 workspace/ 目录;指定时必须是服务器上已存在的目录",
workspaceEmpty: "组织自己的 workspace/ 目录",
- workspaceMenuHint: "选一个已存在的目录作为公司工作区",
- workspaceClear: "改回组织自己的目录",
+ workspaceClear: "使用组织自己的目录",
/** CEO budget field (create dialog): the CEO's ceiling is the company's, since everyone reports to it. */
ceoBudget: "CEO 预算",
ceoBudgetHint: "每月上限;CEO 的预算就是整家公司的预算",
diff --git a/packages/web/test/deslop.test.ts b/packages/web/test/deslop.test.ts
index 8e613079..60f6866f 100644
--- a/packages/web/test/deslop.test.ts
+++ b/packages/web/test/deslop.test.ts
@@ -60,7 +60,7 @@ const POLICY: DeslopPolicy = {
const ALLOWLIST: DeslopAllowlist = {
"features/builtin-browser/browser-tab-strip.tsx": { 12: [2, "W10"] },
"features/chat/model-picker-modal.tsx": { 12: [1, "W10"] },
- "features/chat/workspace-finder.tsx": { 12: [6, "W10"] },
+ "features/chat/workspace-finder.tsx": { 12: [5, "W10"] },
"features/settings/shortcut-recorder.tsx": { 12: [1, "W10"], 13: [1, "W10"] },
"features/settings/shortcuts-section.tsx": { 13: [1, "W10"] },
"features/terminal/terminal-appearance.ts": { 9: [1, "W10"] },
diff --git a/packages/web/test/workspace-finder.test.ts b/packages/web/test/workspace-finder.test.ts
index 74c9386f..40088b7d 100644
--- a/packages/web/test/workspace-finder.test.ts
+++ b/packages/web/test/workspace-finder.test.ts
@@ -2,11 +2,12 @@
* The Workspace finder (src/features/chat/workspace-finder*.tsx): the modal every Workspace
* picker opens. Its decisions live in workspace-finder-model.ts and are exercised directly —
* breadcrumbs for both path families, back/forward history, type-to-select, the keyboard map,
- * Quick access per platform with the user's own edits, the context menu's rows, Recent, and
- * what the box for a refused folder offers. The suite has no DOM, so the few JSX facts that
- * fail silently are pinned against the source: the finder is a Modal (no second overlay
- * system), a permission refusal renders its own box instead of an empty folder, the address
- * bar is the one place a path is typed, and a folder row carries its own way in.
+ * Quick access per platform with the user's own edits, the context menu's rows, Recent, what
+ * the box for a refused folder offers, and the footer's no-folder button. The suite has no DOM,
+ * so the few JSX facts that fail silently are pinned against the source: the finder is a Modal
+ * (no second overlay system), a permission refusal renders its own box instead of an empty
+ * folder, the address bar is the one place a path is typed, a folder row carries its own way
+ * in, and no folder is a footer button rather than a sentence.
*/
import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
@@ -18,6 +19,7 @@ import {
addToQuickAccess,
canGoBack,
canGoForward,
+ clearButton,
defaultPlaces,
deniedBox,
drivePlaces,
@@ -35,6 +37,7 @@ import {
saveQuickAccess,
splitBreadcrumbs,
stepSelection,
+ tempWorkspacePath,
typeSelectIndex,
visibleEntries,
} from "../src/features/chat/workspace-finder-model";
@@ -385,6 +388,35 @@ describe("a folder the server may not read", () => {
});
});
+describe("the footer's no-folder button", () => {
+ const stateDir = "/home/me/.penguin/data/default_project/agents/writer/agent_state";
+ const base = { offered: true, stateDir: null, machine: null };
+
+ it("is there whenever the host offers no folder", () => {
+ expect(clearButton({ ...base, offered: false })).toBeNull();
+ expect(clearButton(base)).not.toBeNull();
+ });
+
+ it("names the folder a temporary Workspace would get, in its tooltip", () => {
+ expect(clearButton({ ...base, stateDir })).toEqual({
+ fullPath: "/home/me/.penguin/data/default_project/agents/writer/workspaces/tmp-…",
+ });
+ });
+
+ it("names none without the Agent's directory, or while another machine is browsed", () => {
+ expect(clearButton(base)).toEqual({ fullPath: null });
+ expect(clearButton({ ...base, stateDir, machine: "far" })).toEqual({ fullPath: null });
+ });
+
+ it("keeps a Windows path's separator, and names nothing for an unknown layout", () => {
+ expect(tempWorkspacePath("C:\\Users\\me\\.penguin\\data\\p\\agents\\a\\agent_state")).toBe(
+ "C:\\Users\\me\\.penguin\\data\\p\\agents\\a\\workspaces\\tmp-…",
+ );
+ expect(tempWorkspacePath("/srv/agents/a/state")).toBeNull();
+ expect(tempWorkspacePath("/")).toBeNull();
+ });
+});
+
describe("the modal (source contract)", () => {
const read = (rel: string) =>
readFileSync(fileURLToPath(new URL(`../src/${rel}`, import.meta.url)), "utf8");
@@ -393,6 +425,8 @@ describe("the modal (source contract)", () => {
it("is the shared Modal, so it stacks on a host dialog through the one Escape stack", () => {
expect(finder).toContain("<Modal");
+ // No title bar: Cancel is the way out; the title still names the dialog.
+ expect(finder).toMatch(/<Modal[\s\S]*?headerless[\s\S]*?>/);
expect(finder).not.toContain("createPortal");
expect(finder).not.toMatch(/fixed inset-0/);
expect(select).not.toContain("Dropdown");
@@ -418,4 +452,13 @@ describe("the modal (source contract)", () => {
expect(finder).toContain("useRowContextMenu()");
expect(finder).toContain("anchorRect={menu.anchor}");
});
+
+ it("offers no folder as a footer button, with no rule spelled out beside it", () => {
+ expect(finder).toContain("title={clear.fullPath ?? clearTitle}");
+ expect(finder).not.toContain("clear.pressed");
+ expect(finder).toMatch(/api\s*\.getAgentConfig\(projectId, agentId\)/);
+ expect(finder).not.toMatch(/hint/i);
+ // The sidebar's new-workspace button adds a folder: it has no empty value to go back to.
+ expect(select).toMatch(/onClear=\{\s*clearable/);
+ });
});