diff --git a/frontend/src/features/assets/page.tsx b/frontend/src/features/assets/page.tsx index 229ad41..912fd31 100644 --- a/frontend/src/features/assets/page.tsx +++ b/frontend/src/features/assets/page.tsx @@ -48,6 +48,12 @@ import { ProfileForm, type ProfileFormCopy } from "../builds/page"; import { SectionSkeleton } from "../../components/ui/section-skeleton"; const text = localeMessageMap>("assetsText"); +type AssetTab = "ai" | "test-design" | "run-setup"; +const assetTabIds: AssetTab[] = ["ai", "test-design", "run-setup"]; +const assetTabFromLocation = (): AssetTab => { + const value = new URLSearchParams(window.location.search).get("tab"); + return assetTabIds.includes(value as AssetTab) ? (value as AssetTab) : "ai"; +}; const testBlank: TargetTestCaseSet = { id: "", name: "", @@ -1063,6 +1069,7 @@ function LegacyAssetsPage({ onUpdateWorkflow, onDelete, usage, + activeTab, }: { locale: Locale; workflows: Workflow[]; @@ -1075,6 +1082,7 @@ function LegacyAssetsPage({ onUpdateWorkflow: (id: string, values: unknown) => Promise; onDelete: (kind: "template" | "test-set" | "runner" | "workflow", id: string) => void; usage: AssetUsage; + activeTab: "ai" | "test-design" | "run-setup"; }) { const createLabel = locales[locale].ui.create, l: Record = { @@ -1118,7 +1126,7 @@ function LegacyAssetsPage({ ); return ( <> - onDelete("template", item.id)} /> ))} - - } + {activeTab === "test-design" && onDelete("test-set", item.id)} /> ))} - - } + {activeTab === "run-setup" && onDelete("workflow", item.id)} /> ))} - + } {template && ( Promise }) { +function PersonaCatalog({ builds, onRefresh, locale }: { builds: Build[]; onRefresh: () => Promise; locale: Locale }) { + const t = text[locale]; const [items, setItems] = useState([]), [draft, setDraft] = useState(null), [error, setError] = useState(""); const load = () => api("/api/personas").then(setItems); useEffect(() => { void load(); }, []); @@ -1928,7 +1937,7 @@ function PersonaCatalog({ builds, onRefresh }: { builds: Build[]; onRefresh: () .then(() => { setDraft(null); setError(""); return Promise.all([load(), onRefresh()]); }) .catch((value) => setError(value.message)); }; - return

Reusable user perspectives, goals, constraints, and product-specific context. Runtime identity and memory are never stored here.

{items.map((item) => build.persona_ids?.includes(item.id)).length} onClick={() => setDraft(item)} onDelete={() => api(`/api/personas/${item.id}`, "DELETE").then(() => Promise.all([load(), onRefresh()]).then(() => undefined)).catch((value) => setError(value.message))} />)}{draft && setDraft(null)}>