Show optimistic chat for new workspaces

This commit is contained in:
Mohamed Boudra
2026-05-25 21:26:31 +07:00
parent d271597ee8
commit 30a8bffc24
11 changed files with 452 additions and 140 deletions
@@ -0,0 +1,28 @@
import type { ComponentType } from "react";
import type { PanelDescriptor, PanelIconProps } from "@/panels/panel-registry";
export function buildDraftPanelDescriptor(input: {
isCreating: boolean;
pendingPrompt?: string | null;
icon: ComponentType<PanelIconProps>;
}): PanelDescriptor {
const { icon, isCreating, pendingPrompt } = input;
const creatingLabel = pendingPrompt?.trim() || "New Agent";
if (isCreating) {
return {
label: creatingLabel,
subtitle: "Creating agent",
titleState: "ready",
icon,
statusBucket: "running",
};
}
return {
label: "New Agent",
subtitle: "New Agent",
titleState: "ready",
icon,
statusBucket: null,
};
}