Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
feat(control-ui): route Install Plugin to org area + link org name to Entries
Andy Pavia8a48b3e84d5b
diff --git a/control-ui/app/workflow-recipes/page.tsx b/control-ui/app/workflow-recipes/page.tsxindex b9a94dd45..431949d80 100644--- a/control-ui/app/workflow-recipes/page.tsx+++ b/control-ui/app/workflow-recipes/page.tsx@@ -1,16 +1,11 @@'use client'-import { Suspense, useEffect, useRef, useState } from 'react'+import { Suspense, useEffect, useState } from 'react'import { useRouter, useSearchParams } from 'next/navigation'import { useAuth } from '@components/AuthContext'-import { CreateFlowSkeleton } from '@components/CreateFlowSkeleton'-import { CreatePageHeader } from '@components/CreatePageHeader'import { DashboardLayout } from '@components/DashboardLayout'import { LoadingScreen } from '@components/LoadingScreen'-import { RecipeEditor } from '@components/RecipeEditor'import { RecipesTab } from '@components/RecipesTab'-import { IconWorkflow } from '@components/Sidebar/icons'-import { CREATE_FLOW_LOADING } from '@constants/createFlowLoading'import { CONTROL_ROUTES } from '@constants/routes'import { isSilentApiError } from '@lib/api'import { buildControlUiLoginPath, getCurrentControlUiPath } from '@lib/authRedirect'@@ -32,9 +27,6 @@ function WorkflowRecipesPageContent() {const searchParams = useSearchParams()const [pageError, setPageError] = useState('')- const [installerOpen, setInstallerOpen] = useState(false)- const [installerStarting, setInstallerStarting] = useState(false)- const installerTimerRef = useRef<number | null>(null)const { recipes, loading, error, refresh } = useRecipePolling({enabled: authState.isLoggedIn && !authState.isLoading,onError: fetchError => {@@ -63,23 +55,6 @@ function WorkflowRecipesPageContent() {}}, [authState.isLoading, authState.isLoggedIn, router])- useEffect(() => {- if (!installerStarting) return- // Keep the skeleton visible briefly so the install drawer transition can settle- // before the heavier installer content renders, avoiding a one-frame layout flash.- installerTimerRef.current = window.setTimeout(() => {- setInstallerOpen(true)- setInstallerStarting(false)- installerTimerRef.current = null- }, 120)- return () => {- if (installerTimerRef.current !== null) {- window.clearTimeout(installerTimerRef.current)- installerTimerRef.current = null- }- }- }, [installerStarting])-if (authState.isLoading) {return <LoadingScreen />}@@ -89,52 +64,14 @@ function WorkflowRecipesPageContent() {}return (- <DashboardLayout isDetailPage={installerOpen || installerStarting}>- {installerStarting ? (- <CreateFlowSkeleton- {...CREATE_FLOW_LOADING.installPlugin}- onBack={() => {- setPageError('')- setInstallerStarting(false)- }}- backDisabled={false}- />- ) : installerOpen ? (- <RecipeEditor- onSaved={() => {- setPageError('')- setInstallerOpen(false)- void refresh()- }}- onCancel={() => {- setPageError('')- setInstallerOpen(false)- }}- pageHeader={- <CreatePageHeader- icon={<IconWorkflow />}- title="Install Plugin"- subtitle="Prepare a plugin manifest, validate policy, and deploy it."- backLabel="Back to plugins"- onBack={() => {- setPageError('')- setInstallerOpen(false)- }}- />- }- />- ) : (- <RecipesTab- items={recipes}- loading={loading}- error={surfaceError}- onInstall={() => {- setPageError('')- setInstallerStarting(true)- }}- onRefresh={refresh}- />- )}+ <DashboardLayout>+ <RecipesTab+ items={recipes}+ loading={loading}+ error={surfaceError}+ onInstall={() => router.push(CONTROL_ROUTES.marketplace.org)}+ onRefresh={refresh}+ /></DashboardLayout>)}diff --git a/control-ui/components/MarketplaceOrgArea/index.tsx b/control-ui/components/MarketplaceOrgArea/index.tsxindex 0c19a3961..d1733aef9 100644--- a/control-ui/components/MarketplaceOrgArea/index.tsx+++ b/control-ui/components/MarketplaceOrgArea/index.tsx@@ -1,5 +1,6 @@'use client'+import Link from 'next/link'import { CONTROL_ROUTES } from '@constants/routes'import { useInboundGrants } from '../../lib/hooks/useInboundGrants'import { useRegistryCapability } from '../../lib/hooks/useRegistryCapability'@@ -48,6 +49,16 @@ export function MarketplaceOrgArea({ activeTab }: { activeTab: OrgAreaTab }) {const orgName = capability?.orgName ?? nullconst orgLabel = orgName ? `@${orgName}` : loading ? 'Organization' : 'Your org'+ // Once we know the org, its name is a shortcut into the org's own published+ // plugins (the Entries tab). While the name is still resolving, keep it plain+ // text so we don't link a placeholder label.+ const orgTitle = orgName ? (+ <Link className="cu-link" href={CONTROL_ROUTES.marketplace.orgEntries}>+ {orgLabel}+ </Link>+ ) : (+ orgLabel+ )const orgScope = capability?.scope ?? nullconst canManageOrg = capability?.canManageOrg === true// Cross-org sharing availability, mirrored from the inbound-grants probe.@@ -58,7 +69,7 @@ export function MarketplaceOrgArea({ activeTab }: { activeTab: OrgAreaTab }) {<section><div className="cu-card cu-card--viewport-fill"><MarketplaceTabs active="org" />- <TablePanelHeader title={orgLabel} subtitle="Everything your org owns on the registry" />+ <TablePanelHeader title={orgTitle} subtitle="Everything your org owns on the registry" /><div className="cu-card__body"><TabBar<OrgAreaTab>ariaLabel="Organization sections"diff --git a/control-ui/components/__tests__/MarketplaceOrgArea.test.tsx b/control-ui/components/__tests__/MarketplaceOrgArea.test.tsxindex 253535625..ca0638724 100644--- a/control-ui/components/__tests__/MarketplaceOrgArea.test.tsx+++ b/control-ui/components/__tests__/MarketplaceOrgArea.test.tsx@@ -49,18 +49,20 @@ beforeEach(() => {})describe('MarketplaceOrgArea', () => {- it('labels the area with the org name when connected', () => {+ it('labels the area with the org name, linked to the Entries tab', () => {vi.mocked(capHook.useRegistryCapability).mockReturnValue(cap({ orgName: 'acme', scope: '@acme', canManageOrg: true }))render(<MarketplaceOrgArea activeTab="entries" />)- expect(screen.getByText('@acme')).toBeInTheDocument()+ const orgLink = screen.getByRole('link', { name: '@acme' })+ expect(orgLink).toHaveAttribute('href', '/marketplace/org/entries')})- it('labels the area "Your org" before the deployment is claimed', () => {+ it('labels the area "Your org" (plain text, not a link) before the deployment is claimed', () => {vi.mocked(capHook.useRegistryCapability).mockReturnValue(cap({}))render(<MarketplaceOrgArea activeTab="entries" />)expect(screen.getByText('Your org')).toBeInTheDocument()+ expect(screen.queryByRole('link', { name: 'Your org' })).toBeNull()})it('entries: shows OwnedEntries when the org can manage', () => {diff --git a/control-ui/package-lock.json b/control-ui/package-lock.jsonindex ca3bce59c..bbf998248 100644--- a/control-ui/package-lock.json+++ b/control-ui/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-ui",- "version": "0.1.363",+ "version": "0.1.364","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-ui",- "version": "0.1.363",+ "version": "0.1.364","dependencies": {"@clerum/llm-providers": "file:../packages/llm-providers","@clerum/workflow-recipe-capability-policy": "file:../packages/workflow-recipe-capability-policy",diff --git a/control-ui/package.json b/control-ui/package.jsonindex 03d2c79d7..62dfdb3d4 100644--- a/control-ui/package.json+++ b/control-ui/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-ui",- "version": "0.1.363",+ "version": "0.1.364","private": true,"scripts": {"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",