{ setTrash(value === "trash"); setSelectedPath(null); setCheckedFiles(new Set()); }} className={cn("flex min-h-0 flex-col gap-3", fillHeight && "flex-1")}>
@@ -89,7 +98,7 @@ export function WorkFolderBrowser({ owner, exampleFiles, readOnly = false, fillH
{!trash && canManageTrash && checkedPaths.length > 0 && }
{!readOnly && }
- {saving ? "Saving…" : mutation.isError ? "Save failed" : failures.length > 0 ? "Run save failed" : "Saved"}
+ {saveLabel}
{lastSaved && Last agent save {new Date(lastSaved).toLocaleTimeString()}}
{lastOperation && (!lastSaved || lastOperation > lastSaved) && Files updated {new Date(lastOperation).toLocaleTimeString()}}
diff --git a/ui/storybook/fixtures/workFolders.ts b/ui/storybook/fixtures/workFolders.ts
index f90402e6fe..3b6a4a6fa1 100644
--- a/ui/storybook/fixtures/workFolders.ts
+++ b/ui/storybook/fixtures/workFolders.ts
@@ -8,6 +8,7 @@ import type {
export type WorkFolderScenario =
| "saved"
| "saving"
+ | "waiting"
| "failed"
| "olderFailure"
| "multipleFailures"
@@ -84,7 +85,7 @@ export function createWorkFolderFixture(
});
contents.set(path, blob);
}
- if (scenario !== "empty") {
+ if (scenario !== "empty" && scenario !== "waiting") {
add(
"README.md",
`# ${workFolderLabels[scope as WorkFolderScope]}\n\nFiles available to this ${scope}'s sandbox runs.\n\n## Current work\n\n- Review the launch brief\n- Keep the original uploads\n- Share the final report\n`,
@@ -151,13 +152,13 @@ export function createWorkFolderFixture(
runId: "run-storybook",
agentId: workFolderOwners.agent.ownerId,
state:
- scenario === "saving"
+ scenario === "waiting" ? "starting" : scenario === "saving"
? "saving"
: scenario === "failed"
? "failed"
: "saved",
- lastSavedAt: savedAt,
- active: scenario === "saving" || scenario === "failed",
+ lastSavedAt: scenario === "waiting" ? null : savedAt,
+ active: scenario === "waiting" || scenario === "saving" || scenario === "failed",
refreshRequested: false,
error:
scenario === "failed"
diff --git a/ui/storybook/stories/work-folders.stories.tsx b/ui/storybook/stories/work-folders.stories.tsx
index 33e3814f5d..947c24a808 100644
--- a/ui/storybook/stories/work-folders.stories.tsx
+++ b/ui/storybook/stories/work-folders.stories.tsx
@@ -31,6 +31,7 @@ const meta = {
options: [
"saved",
"saving",
+ "waiting",
"failed",
"olderFailure",
"multipleFailures",
@@ -100,6 +101,7 @@ export const LargeFilePreview: Story = {
};
export const EmptyFolder: Story = { args: { scenario: "empty" } };
export const Loading: Story = { args: { scenario: "loading" } };
+export const WaitingForFirstSave: Story = { args: { scenario: "waiting" } };
export const Saving: Story = { args: { scenario: "saving" } };
export const SaveFailed: Story = { args: { scenario: "failed" } };
export const SharedFolderWithEarlierFailure: Story = { args: { scope: "agent", scenario: "olderFailure" } };