diff --git a/ui/src/pages/CompanySkills.tsx b/ui/src/pages/CompanySkills.tsx index 980334a63f0..ca426134977 100644 --- a/ui/src/pages/CompanySkills.tsx +++ b/ui/src/pages/CompanySkills.tsx @@ -77,6 +77,7 @@ import { Boxes, Check, ChevronDown, + ChevronLeft, ChevronRight, Code2, Download, @@ -3647,15 +3648,6 @@ export function CompanySkills() { }); } - function setViewParam(view: "installed" | "catalog") { - setSearchParams((current) => { - const next = new URLSearchParams(current); - if (view === "installed") next.delete("view"); - else next.set("view", "catalog"); - return next; - }); - } - function setSourceFilter(next: SourceFilter) { setSearchParams((current) => { const params = new URLSearchParams(current); @@ -3688,16 +3680,15 @@ export function CompanySkills() { ]); }, [routeSkillToken, setBreadcrumbs]); - // The old split catalog view no longer exists — bundled/catalog skills live in - // the discovery grid and install dialog now. Strip legacy `view=catalog` / - // `catalog` params so stale deep links land on the new surface (PAP-10907). + // The old split catalog view no longer exists — catalog/bundled skills now open + // as a regular full page keyed by `?catalog=`. Strip the legacy `view` + // param so stale `?view=catalog` deep links land on the new surface (PAP-10907). useEffect(() => { - if (!searchParams.has("view") && !searchParams.has("catalog")) return; + if (!searchParams.has("view")) return; setSearchParams( (current) => { const next = new URLSearchParams(current); next.delete("view"); - next.delete("catalog"); return next; }, { replace: true }, @@ -4027,14 +4018,14 @@ export function CompanySkills() { const catalogDetailQuery = useQuery({ queryKey: queryKeys.companySkills.catalogDetail(selectedCatalogRef ?? ""), queryFn: () => companySkillsApi.catalogDetail(selectedCatalogRef!), - enabled: Boolean(selectedCompanyId && selectedCatalogRef && activeView === "catalog"), + enabled: Boolean(selectedCompanyId && selectedCatalogRef), staleTime: 60_000, }); const catalogFileQuery = useQuery({ queryKey: queryKeys.companySkills.catalogFile(selectedCatalogRef ?? "", catalogSelectedPath), queryFn: () => companySkillsApi.catalogFile(selectedCatalogRef!, catalogSelectedPath), - enabled: Boolean(selectedCompanyId && selectedCatalogRef && activeView === "catalog" && catalogSelectedPath), + enabled: Boolean(selectedCompanyId && selectedCatalogRef && catalogSelectedPath), staleTime: 60_000, }); @@ -4143,7 +4134,6 @@ export function CompanySkills() { pushToast({ tone: "warn", title: "Install warnings", body: result.warnings[0] }); } if (result.action === "created") { - setViewParam("installed"); navigate(routeForSkill(result.skill)); } }, @@ -4293,19 +4283,16 @@ export function CompanySkills() { importSkill.mutate(trimmedSource); } - // Opening a card stays inside the new store: installed skills go to their - // detail route; catalog/bundled skills open the install dialog inline. The - // legacy split catalog view is gone (PAP-10907). + // Opening a card stays inside the new store and always lands on a regular full + // page: installed skills go to their detail route; catalog/bundled/optional + // skills open the standalone catalog page (no modal, no legacy split view). function openDiscoveryCard(card: DiscoveryCard) { if (card.skillId) { navigate(routeForSkillId(card.skillId)); return; } if (card.catalogRef) { - const catalogSkill = (catalogListQuery.data ?? []).find( - (entry) => entry.id === card.catalogRef || entry.key === card.key, - ); - if (catalogSkill) openInstallDialog(catalogSkill); + selectCatalog(card.catalogRef); } } @@ -4568,257 +4555,70 @@ export function CompanySkills() { onDelete={openDeleteDialog} deletePending={deleteSkill.isPending} /> - ) : ( -
-
- setViewParam(value === "catalog" ? "catalog" : "installed")}> - - - Installed - {installedSkills.length} - - - Catalog - {catalogListQuery.data?.length ?? 0} - - - -
- {activeView === "installed" ? ( - - ) : null} - - - - - - setViewParam("catalog")}> - - Browse catalog - - { - setViewParam("installed"); - setEmptySourceHelpOpen(true); - }} - > - - Import from URL or path - - { - setViewParam("installed"); - openCreateWizard(); - }} - > - - Create blank skill - - - + ) : selectedCatalogRef ? ( + // Catalog / optional / bundled skills open as a regular full page in the + // new store — no modal, no legacy split view (PAP-10907). +
+
+ + + Back to store +
-
- - {activeView === "installed" ? ( -
- - -
- { - void updateStatusQuery.refetch(); - }} - checkUpdatesPending={updateStatusQuery.isFetching} - onInstallUpdate={() => installUpdate.mutate()} - installUpdatePending={installUpdate.isPending} - onDelete={openDeleteDialog} - deletePending={deleteSkill.isPending} - onSave={() => saveFile.mutate()} - savePending={saveFile.isPending} - attachAgents={eligibleAgentsForAttach} - versions={versionsQuery.data ?? []} - onSubmitAttach={handleAttachSubmit} - attachPending={attachAgentsMutation.isPending} - /> -
-
- ) : ( -
- +
+ openInstallDialog(selectedCatalogSkill)} + onUpdate={() => openInstallDialog(selectedCatalogSkill)} + onOpenInstalled={(skillId) => navigate(routeForSkillId(skillId))} + loadingPrimaryAction={installCatalog.isPending} + /> +
-
- )} -
+ )} +
+ ) : ( +
+ {skillsQuery.isLoading ? ( + + ) : ( + + )} +
)} );