AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
refactor(platform): admin sub-pages in the sidebar, flat URLs, six groups (#15727)
moaaz039fd5d36269
diff --git a/brain/knowledge/ai-intelligence/ai-providers.md b/brain/knowledge/ai-intelligence/ai-providers.mdindex 13d7a3ba78c..be0a26e5ebb 100644--- a/brain/knowledge/ai-intelligence/ai-providers.md+++ b/brain/knowledge/ai-intelligence/ai-providers.md@@ -52,7 +52,7 @@ renders and preserves every real price; the cheapest in the set is 0.01.- **No egress to the CDN means no model metadata, permanently and silently.** Air-gapped installs, networks with an outbound allowlist, and CDN outages all fall back to the plain `{ id, name }` row with no message explaining it — every metadata field is optional, so nothing throws. `AP_MODEL_CATALOG_URL` points at a self-hosted mirror and is the only fix. This is a knowing exception to `.claude/rules/self-hosting.md` (decision 000032), so treat "self-hoster says prices are missing" as a network question, not a bug.- **A new provider needs an entry in the generator's `MODELS_DEV_PROVIDER` map or it silently ships with no metadata.** models.dev provider ids do not match ours: `bedrock` → `amazon-bedrock`, `qwen` → `alibaba`, `moonshot` → `moonshotai`, `activepieces` → aliased onto `openrouter` at lookup time. The six OpenAI-compatible vendors were merged before the map was updated and produced exactly this — the run prints `no upstream source: …`, which is the thing to read after adding a provider. `cloudflare-gateway` and `custom` legitimately have no source.- **The catalog object must be published before the code that reads it ships.** There is no bundled copy, so until a `workflow_dispatch` run puts it on the CDN, every install — including local dev — shows no metadata at all.-- **A fresh Cloud platform cannot connect any AI provider, and the UI says nothing about why.** The admin page at `/platform/setup/ai` sets `allowWrite = platform.plan.aiProvidersEnabled`, and that column defaults to **false** on the `free` plan (migration `1776…AddDefaultToAiProvidersEnabled`), so the connect button is simply absent rather than disabled-with-a-reason. On Cloud the flag is owned by Autumn (`autumn-utils.ts` lists it among the synced features), so there is nothing to configure locally and no `DEV_ENTERPRISE_PLAN` escape hatch on main. For local Cloud testing, flip it directly: `UPDATE platform_plan SET "aiProvidersEnabled" = true`. Then connect a **BYO key**, not the managed `ACTIVEPIECES` provider — per *Provider visibility* above, the managed row is hidden whenever `OPENROUTER_PROVISION_KEY` is unset, which is the normal local state, and a hidden provider makes `getChatProvider()` return null. Anything gated on a chat provider (chat itself, personalization research) stays silently disabled until a BYO row exists.+- **A fresh Cloud platform cannot connect any AI provider, and the UI says nothing about why.** The admin page at `/platform/ai` sets `allowWrite = platform.plan.aiProvidersEnabled`, and that column defaults to **false** on the `free` plan (migration `1776…AddDefaultToAiProvidersEnabled`), so the connect button is simply absent rather than disabled-with-a-reason. On Cloud the flag is owned by Autumn (`autumn-utils.ts` lists it among the synced features), so there is nothing to configure locally and no `DEV_ENTERPRISE_PLAN` escape hatch on main. For local Cloud testing, flip it directly: `UPDATE platform_plan SET "aiProvidersEnabled" = true`. Then connect a **BYO key**, not the managed `ACTIVEPIECES` provider — per *Provider visibility* above, the managed row is hidden whenever `OPENROUTER_PROVISION_KEY` is unset, which is the normal local state, and a hidden provider makes `getChatProvider()` return null. Anything gated on a chat provider (chat itself, personalization research) stays silently disabled until a BYO row exists.- **Every provider auth schema is written twice, and only one copy is the one the server reads.** `packages/core/utils/src/lib/ai-provider-credentials.ts` (plain zod) backs the API and the web app; `packages/core/piece-types/src/lib/ai-providers.ts` (`zod/mini`, so `.check(z.minLength(1))` and `z.optional(x)` instead of `.min(1)` / `.optional()`) is what `@activepieces/pieces-framework` re-exports to pieces and the engine. Adding a credential field to only one leaves the other silently stripping it — zod objects drop unknown keys, so the upsert still returns 200 and the failure surfaces later as a provider-side auth error. Change both.- **A schema change in `packages/core/utils` is invisible to another package's tests until you build it.** Sibling packages resolve `@activepieces/core-utils` through its `main` (`dist/src/index.js`), so vitest in `core/ai-providers` keeps parsing against the stale build and a new optional field reads back as dropped. `cd packages/core/utils && npm run build` first. The API dev server is the opposite: `serve` runs under tsx with the tsconfig path alias, so it reads `src` directly — but it only watches `packages/core/shared/src/**`, not `core/utils`, so a core-utils-only edit needs a restart to take effect. The same staleness makes a **branch** look green when it is not: `dist` is gitignored, so after `git checkout` it still holds whatever the previous branch built, and a test that depends on a field added by a sibling PR passes locally and fails in CI. Rebuild `core/utils` after every branch switch before trusting a run.@@ -153,9 +153,9 @@ renders and preserves every real price; the cheapest in the set is 0.01.- **Attribution headers are for `ACTIVEPIECES` only, and go through the factory's `extraHeaders` option rather than a local `createOpenRouter` call.** The managed provider is OpenRouter under the hood on our own key, so the `x-ap-*` headers are what tag *our* account's events: `x-ap-platform-id` / `x-ap-conversation-id` / `x-ap-run-id` on the agent path, `x-ap-project-id` / `x-ap-flow-id` / `x-ap-run-id` on the piece path. BYOK `OPENROUTER` is a customer's own account and must not get them. Constructing the provider inline to attach headers is also what silently drops `openRouterSettings` (the web-search plugin), since the factory is the only place that still passes them. (`CUSTOM` separately receives the piece-path metadata headers — that is #11700's metadata forwarding for self-hosted OpenAI-compatible endpoints, older than either the rename or the Autumn work and unrelated to OpenRouter attribution. Its precedence is deliberate: admin-configured `defaultHeaders` override the `x-ap-*` metadata, and the api key is applied last.)- **`mistralViaOpenRouter` does not mean "the managed provider"; it is read only inside the `MISTRAL` case, and that branch looks like dead legacy.** `ACTIVEPIECES` routes through OpenRouter unconditionally and ignores the flag, so the only thing the agent path's `mistralViaOpenRouter: true` does is send a `MISTRAL` chat row to openrouter.ai — carrying that row's *Mistral* key, which cannot authenticate there. `MISTRAL` also has no `ALLOWED_CHAT_MODELS_BY_PROVIDER` entry, so `getCuratedChatModels` returns `undefined` for it and the resolver falls back to a tier's OpenRouter-shaped id. The fall-through arrived as a drive-by in #13489, not as a routing decision. Don't infer "this provider is AP-managed" from that case group.- **AI Tool Configs** are a *sibling* feature (same `ai/` dir), distinct from AI Providers: they give the chat assistant external capabilities via `/v1/ai-tools` (platform-admin, EE/Cloud). **AiToolCapability** = `WEB_SEARCH`/`WEB_SCRAPING`/`IMAGE_GENERATION`; **AiToolProvider** = `TAVILY`/`FIRECRAWL`/`APIFY`/`FAL`. One config per capability (unique on platformId+capability); consumed by chat via `getEnabledTools()`. **Because the config is per-platform, it can never serve a first-run flow on Cloud.** A self-serve signup lands on a brand-new platform with no configs at all, so `getEnabledTools()` returns `{}` for exactly the users a new-signup feature is aimed at, and any capability read from it silently no-ops rather than failing loudly. A capability that has to work for someone who just signed up needs a cloud-wide `AppSystemProp` key instead, the way `TURNSTILE_SECRET_KEY`, `FEATUREBASE_API_KEY` and `APPSUMO_TOKEN` are sourced. Note there is no `ENRICHMENT` capability here, so anything needing people or company enrichment has nowhere to read a key from today.-- **`/v1/ai-tools` is registered only in the CLOUD and ENTERPRISE branches of `app.ts`, but the AI Center page that reads it is not edition-gated** — so a Community admin opening the Capabilities tab fired `useAiToolConfigs`, got Fastify's `Route not found`, and the page showed the global "Failed to load data" dialog of the day. Shipped that way from #13911 until the tab was gated on `ApFlagId.EDITION` in the page. What made this class of bug hard to place is that the surface was then page-independent (raised from `QueryCache.onError` in `query-client.ts`) and React Query's 3 default retries meant it landed several seconds later on whatever page you navigated to next (the report was against `/platform/setup/general`). The tab now renders `DataFetchErrorState` in place instead, so a repeat would at least accuse the right page. When a screenshot's edition is in doubt, read the sidebar: **Billing & subscription** and **Usage** carry a lock only when `edition === COMMUNITY`, every other lock there is plan-driven. Any new EE-only route needs its UI entry point gated the same way, `enabled:` on the query or hiding the surface.+- **`/v1/ai-tools` is registered only in the CLOUD and ENTERPRISE branches of `app.ts`, but the AI Center page that reads it is not edition-gated** — so a Community admin opening the Capabilities tab fired `useAiToolConfigs`, got Fastify's `Route not found`, and the page showed the global "Failed to load data" dialog of the day. Shipped that way from #13911 until the tab was gated on `ApFlagId.EDITION` in the page. What made this class of bug hard to place is that the surface was then page-independent (raised from `QueryCache.onError` in `query-client.ts`) and React Query's 3 default retries meant it landed several seconds later on whatever page you navigated to next (the report was against `/platform/general`). The tab now renders `DataFetchErrorState` in place instead, so a repeat would at least accuse the right page. When a screenshot's edition is in doubt, read the sidebar: **Billing & subscription** and **Usage** carry a lock only when `edition === COMMUNITY`, every other lock there is plan-driven. Any new EE-only route needs its UI entry point gated the same way, `enabled:` on the query or hiding the surface.- **The AI Center providers page renders its whole state machine off one query, so every branch needs an `isLoading` gate above it.** `ProvidersTab` derives the empty state, the grouped list *and* the `?config=<id>` detail view from `useAiProviderConfigs()`. While that query is pending, `data` is `undefined` — `configs` is `[]`, so the empty "Connect your first provider" screen paints for a frame, and a hard refresh on a `?config=` URL finds no matching row and falls through to the list before flipping to the detail page. The parent `SuspenseWrapper` does not cover it: the route chunk and the suspense-backed projects collection resolve first, then the component mounts with no providers yet. Any new branch added to this page belongs below the `if (isLoading) return <ProvidersSkeleton />` gate, not beside it.-- **A save bar in the AI Center needs a full-height column, not `fixed` and not bare `sticky`.** The page sits inside *two* nested scrollers — `PlatformLayout`'s `flex flex-col flex-1 overflow-auto` and the AI Center's own `flex-1 min-w-0 overflow-auto` beside the `w-60` tab rail — so `fixed inset-x-0` centres the bar on the viewport, roughly a sidebar-width left of the content column it belongs to. Swapping it to `sticky bottom-4` fixes the centring for free but pins nothing when the content is shorter than the viewport: the bar just lands wherever the content ends, mid-page. The working shape is `min-h-full` + `flex flex-col` on the tab-content wrapper, `flex-1` on the `TabsContent`, `grow` on the panel root, then `sticky bottom-4 mt-auto` on the bar — `mt-auto` handles the short page, `sticky` handles the long one. `min-h-full` resolves only because every ancestor up to `SidebarInset h-full` has a definite height; that chain is what makes the whole thing work, so check it before reusing this elsewhere.+- **A save bar in the AI Center needs a full-height column, not `fixed` and not bare `sticky`.** The page sits inside *two* nested scrollers — `PlatformLayout`'s `flex flex-col flex-1 overflow-auto` and the AI Center's own `flex-1 overflow-auto` column — so `fixed inset-x-0` centres the bar on the viewport, roughly a sidebar-width left of the content column it belongs to. Swapping it to `sticky bottom-4` fixes the centring for free but pins nothing when the content is shorter than the viewport: the bar just lands wherever the content ends, mid-page. The working shape is `min-h-full` + `flex flex-col` on the tab-content wrapper, `flex-1` on the `TabsContent`, `grow` on the panel root, then `sticky bottom-4 mt-auto` on the bar — `mt-auto` handles the short page, `sticky` handles the long one. `min-h-full` resolves only because every ancestor up to `SidebarInset h-full` has a definite height; that chain is what makes the whole thing work, so check it before reusing this elsewhere.- **A chat *tier* is our own idea, so it has no meaning on a provider we ship no curated model list for — resolve it by asking the key what it offers.** `ACTIVEPIECES_CHAT_TIERS` (fast/smart/premium) only maps to a real id through `ALLOWED_CHAT_MODELS_BY_PROVIDER`, which covers Anthropic, OpenAI, Google, Vertex and Activepieces. Everything else — Bedrock, Azure, Mistral, xAI, DeepSeek and the other OpenAI-compatible vendors — has an empty candidate list. The resolver used to invent an id from the tier (strip the vendor prefix, dots to dashes: `anthropic/claude-haiku-4.5` -> `claude-haiku-4-5`), which Bedrock rejected as "The provided model identifier is invalid" (GIT-1840, Pylon 5836). #15355 removed the invention and left a throw in its place, which was worse: every agent turn on those providers died with `ENTITY_NOT_FOUND: this AI provider key allows no text model a chat turn can run on` before the configured model handled anything (Pylon 6069). **The missing ingredient was never a smarter guess, it was the key's own model list.** `agentHelpers.resolveModelId` is now the single resolver for every surface: it tries our catalogue first and, only when that has nothing to say, reads `aiProviderService.listModels` (process-cached, cleared nightly by cron, already filtered by the key's `modelScope`), preferring a model whose id *contains* the tier's `nativeModelId` — Bedrock spells them `eu.anthropic.claude-sonnet-4-6-...`, so a tier still selects the model it names wherever the vendor hosts it, and otherwise degrades to the first text model the way `pickAllowedModel` already does for an admin-listed catalogue. Picking from a list the provider returned is the opposite of the fabrication #15355 removed. **Two traps, both learned the hard way.** First, an agent surface and generic chat are not symmetric: an agent *carries* a real model id (its picker lists `listModels` output unfiltered, precisely because these providers have no `ALLOWED_CHAT_MODELS_BY_PROVIDER` entry) while chat carries only a tier name, because `ChatModelSelector` falls back to tier options when `getCuratedChatModels` returns `undefined`. Second, **being listed proves the key can see a model, not that the account can invoke it** — so where a model is already settled the fast round reuses it rather than choosing again (`getAgentConfig` passes the model the turn resolved; the tool RPC reads the run's own model off the conversation or the agent via `pinnedModelOf` — and it has to read the *same* half the run did: an agent-page chat runs on `agent.draft` (`agent-conversation-controller.ts`), a Run Agent step on `agent.published`, so reading the wrong one silently lends the tool a stale model whenever the two differ). Resolving the fast tier independently once picked a Haiku the account could not invoke and failed a turn whose configured Sonnet worked fine. A borrowed model still has to pass the key's current `modelScope`, or resolution falls through to the list, which applies it. Nothing crosses the worker, so a rolling deploy has no version-skew window.- `packages/server/api/src/app/ai/` — backend module: provider controller, service, entity, module, plus the sibling ai-tool-config files- `packages/server/api/src/app/ai/providers/` — per-vendor strategies keyed by `AIProviderName`diff --git a/brain/knowledge/ai-intelligence/mcp-server.md b/brain/knowledge/ai-intelligence/mcp-server.mdindex 54e9bd3be4a..d28cb69017b 100644--- a/brain/knowledge/ai-intelligence/mcp-server.md+++ b/brain/knowledge/ai-intelligence/mcp-server.md@@ -95,7 +95,7 @@ Exposes an Activepieces project as an MCP server so AI clients (Claude Desktop,- **A row carries no payload; the input and output go to the `file` table as `MCP_CALL_PAYLOAD`.** That is what V1 got wrong — `mcp_run` had two non-null JSONB columns written synchronously per call. Keeping the fat bytes in a table the list query never reads also buys the retention for free: `MCP_CALL_PAYLOAD` is in `isExecutionDataFileThatExpires`, so it routes to S3 when configured and is swept by the hourly `FILE_CLEANUP_TRIGGER` already running. Row retention rides the same job via `mcpActivityRetention.deleteStale()`, in bounded passes modelled on `agentRetention`.- **`FileType` is declared twice and the two copies must stay in lockstep** — `core/shared/src/lib/core/file/index.ts` and `core-piece-types/src/lib/execution-contracts.ts`. Adding a member to only one breaks assignability at the seam (`sample-data.service.ts` is the first thing to fail to compile), with an error that points at the *consumer*, not at the enum you edited.-- **The Activity feed renders on two surfaces from one component, so editing its columns or filters edits a platform admin settings page too.** `ActivityFeed` (`app/routes/mcp-server/activity/`) is consumed by the project MCP page's Activity tab *and* by the third tab on `platform/setup/mcp` — a platform admin already sees the whole platform's rows there, because `GET /v1/mcp-activity` is platform-scoped and `resolveUserIdFilter` only narrows a *non*-privileged caller. The platform page is a `CenteredPage`, whose default `max-w-[40rem]` cannot hold a six-column table, so it is widened to the `max-w-[1198px]` band `PageBand` uses on the project page — which also widens its Connection and Tools tabs. The import is `app` → `app`, which the `import/no-restricted-paths` zone allows; had the feed lived in `src/features`, it could not have reached back for `useMcpNav` or `PageBand`.+- **The Activity feed renders on two surfaces from one component, so editing its columns or filters edits a platform admin settings page too.** `ActivityFeed` (`app/routes/mcp-server/activity/`) is consumed by the project MCP page's Activity tab *and* by `/platform/mcp/activity`, a sidebar child of the platform MCP page — a platform admin already sees the whole platform's rows there, because `GET /v1/mcp-activity` is platform-scoped and `resolveUserIdFilter` only narrows a *non*-privileged caller. The platform page is a `CenteredPage`, whose default `max-w-[40rem]` cannot hold a six-column table, so it is widened to the `max-w-[1198px]` band `PageBand` uses on the project page — which also widens its sibling Connection and Tools sections, since all three render through the same `CenteredPage`. The import is `app` → `app`, which the `import/no-restricted-paths` zone allows; had the feed lived in `src/features`, it could not have reached back for `useMcpNav` or `PageBand`.- **Filter options on a platform-scoped feed must be sourced by privilege, or an admin sees rows they cannot filter by.** `projectCollectionUtils.useAll()` is the member-scoped hook: it keeps TEAM projects plus only the *current user's* PERSONAL project, so on a platform-wide feed an admin gets rows from other members' personal projects with no matching entry in the Project dropdown. Use `useAllPlatformProjects()` when `useIsPlatformPrivileged()` — `/v1/projects` already scopes itself by `isUserPrivileged`, so the wider hook returns nothing extra to a member. The columns are unaffected either way: the server sends `projectName` on each row, so only the *filter* goes blind. Same shape as the platform Connections page, which sources its project filter the same way.diff --git a/brain/knowledge/data-storage-observability/index.md b/brain/knowledge/data-storage-observability/index.mdindex 75a895c7ef6..a771bd9f2e7 100644--- a/brain/knowledge/data-storage-observability/index.md+++ b/brain/knowledge/data-storage-observability/index.md@@ -40,7 +40,7 @@ All structured logging goes through **evlog** — one wide event per unit of wor### Product Telemetry-Anonymous product analytics to PostHog, from both the browser and the app container. Gated per platform by `platform_configuration.isProductTelemetryEnabled`, edited at Platform Admin > Infrastructure > Configurations; `AP_TELEMETRY_ENABLED` survives only as the value a platform's row is *born* with. See [000033](../decisions/000033-platform-configuration-rows-are-authoritative-and-created-on-first-read.md).+Anonymous product analytics to PostHog, from both the browser and the app container. Gated per platform by `platform_configuration.isProductTelemetryEnabled`, edited at Platform Admin > Account > Configurations; `AP_TELEMETRY_ENABLED` survives only as the value a platform's row is *born* with. See [000033](../decisions/000033-platform-configuration-rows-are-authoritative-and-created-on-first-read.md).Gotchas:- **Two independent PostHog paths exist and they are gated differently.** Product analytics obeys the per-platform switch; the license-key events (`total_runs_per_day`, `ai_usage_per_run`, `chat_message`) go through `captureLicenseKeyEvent` and deliberately do **not**, because PostHog is also the billing transport and a customer must not be able to switch off their own meter. Never "consistency-fix" that by routing a billing event through the gate.diff --git a/brain/knowledge/decisions/000035-platform-admin-is-fifteen-pages-derived-from-one-registry.md b/brain/knowledge/decisions/000035-platform-admin-is-fifteen-pages-derived-from-one-registry.mdindex a36376c7cd0..da5a4b3b20e 100644--- a/brain/knowledge/decisions/000035-platform-admin-is-fifteen-pages-derived-from-one-registry.md+++ b/brain/knowledge/decisions/000035-platform-admin-is-fifteen-pages-derived-from-one-registry.md@@ -4,6 +4,10 @@ status: accepted# Platform admin is fifteen pages derived from one registry+> **Partly superseded** by *platform-admin-sections-are-sidebar-sub-items-each-with-its-own-route* (#15727).+> The registry (`admin-pages.ts`), the overview pages and `?tab=` sections are gone. The gating-at-the-action+> and sample-mode sections below still hold.+## DecisionThe platform admin nav collapses from **22 items in 5 labelled groups to 15 items in 3 unlabelled blocks**,diff --git a/brain/knowledge/decisions/000039-platform-admin-sections-are-sidebar-sub-items-each-with-its-own-route.md b/brain/knowledge/decisions/000039-platform-admin-sections-are-sidebar-sub-items-each-with-its-own-route.mdnew file mode 100644index 00000000000..40f3ea46525--- /dev/null+++ b/brain/knowledge/decisions/000039-platform-admin-sections-are-sidebar-sub-items-each-with-its-own-route.md@@ -0,0 +1,41 @@+---+icon: 🧭+status: accepted+---++# Platform admin sections are sidebar sub-items, each with its own route++## Decision++The platform admin nav is six labelled groups (Platform, Catalogue, Security, Developers, Operations,+Account) written inline in `components/sidebar/platform`, and every section of a page is a sidebar sub-item+with a path of its own (`/platform/ai/capabilities`, `/platform/health/runs`), never a `?tab=`. URLs are+flat and never carry the group, so regrouping is a sidebar edit. There is no registry and there are no+overview pages. The full rule set is *platform-admin-structure*. This replaces the registry, overview and+`?tab=` parts of *platform-admin-is-fifteen-pages-derived-from-one-registry*; its gating and sample-mode+sections still hold.++## Context++PR #15563 merged the admin into fewer pages with tabs, derived from `routes/platform/admin-pages.ts`, and+gave six section parents an overview page. PR #15727 was moving in-page tabs into the sidebar at the same+time, and the two collided. The overviews repeated what the child pages already show, and a section that+lives on `?tab=` is invisible to the sidebar's path-based active state.++## Why++A path per section makes the sidebar's active state, deep links and the browser Back button work without a+tab-aware special case, and the nav stays a literal a reader can scan top to bottom. The registry was the+rejected alternative: it removed drift between nav, routes and gates, but needed `isHidden`, `hideInNav`,+`activeTabId` and `isCrowned` to describe a shape that a path per page expresses directly.++## Consequences++- Nav, routes and gates live in three places again (`sidebar/platform/index.tsx`, `platform-routes.tsx`,+ and the page), so a new admin page has to be added to all three.+- Old `?tab=` links are rewritten to the new paths by `LegacyTabRedirect`, one `*_TAB_PATHS` map per+ promoted page, and every retired `/platform/setup|security|infrastructure/*` URL by `LegacyPathRedirect`. The `?tab=` URLs #15563 introduced (`/platform/users?tab=sso`, `/platform/security?tab=…`)+ were live for a day and are not redirected.+- The sample-data overlay that the registry applied per page now sits on the route, via+ `routes/platform/plan-feature-sample.tsx`. A sampled page that is not wrapped there renders unlocked,+ because the nine sampled pages no longer carry a `LockedFeatureGuard` of their own.diff --git a/brain/knowledge/engineering/index.md b/brain/knowledge/engineering/index.mdindex 369abbb9918..b1cc8341b10 100644--- a/brain/knowledge/engineering/index.md+++ b/brain/knowledge/engineering/index.md@@ -32,6 +32,7 @@ The **Activepieces engineering brain**: how the system works, and *why* it was b- **Server Module Anatomy** — the six files of a server module (entity → migration → repo → service → controller → module), and the manual registration steps nothing auto-discovers- **Web Feature Anatomy** — the frontend feature folder, its barrel, route guards, and how a failed primary query reports itself in place- **Web Navigation Shell** — the rail, the three sidebars and the layouts that choose between them, which primitives are shared, and why platform admin renders without the rail+- **Platform Admin Structure** — the rules for what is a group, page, sub-page, section, sheet or dialog in platform admin, the six groups, flat URLs, and what is applied vs planned- **Cloud Deployment Paths** — canary → prod, the `cloud-hotfix` override, and the breaking-migration gate that blocks both- **Helm Chart** — the Kubernetes install we ship to self-hosters, its two competing paths for an `AP_*` variable, and the secrets it never creates- **CI Pipeline** — the PR checks that build and test a change: the affected-packages gate, the api matrix, and why install and test time grewdiff --git a/brain/knowledge/engineering/platform-admin-structure.md b/brain/knowledge/engineering/platform-admin-structure.mdnew file mode 100644index 00000000000..939600aeeee--- /dev/null+++ b/brain/knowledge/engineering/platform-admin-structure.md@@ -0,0 +1,169 @@+---+icon: 🗂️+---++# Platform Admin Structure++How the platform admin (`/platform/**`) is arranged: what earns a sidebar entry, what lives inside a+page, and what opens on top of one. Every rule here is marked **Applied** (true in the code today) or+**Planned** (agreed, not built yet). The project app and project settings are out of scope for now.++## Levels++Everything in the admin is exactly one of these.++| Level | What it is | Own route | In the sidebar |+| --- | --- | --- | --- |+| **Group** | A labelled run of pages, named for a job an admin comes to do | no | as a label |+| **Page** | A place you come to on purpose | yes | yes |+| **Sub-page** | One of several views of the same subject | yes | under its parent |+| **Detail page** | One object big enough to own lists of its own | yes | no, reached from a row |+| **Section** | A heading partway down a page | no | no |+| **Sheet** | The detail or edit of one row | no | no |+| **Dialog** | Create, confirm or delete | no | no |++A **filter** is not a level: the same list narrowed by scope, status or owner stays one page.++## Deciding where something goes++Ask in order and stop at the first yes.++1. **Would someone come here on purpose, or do other screens link here?** A page. Otherwise it is a+ section of the page they would look for it on.+2. **Is it the same subject asked a different way?** A sub-page of that subject. **Is it operated by+ different people at different times?** A separate page, even if the data is related.+3. **Is it one table or a couple of toggles?** It does not earn a sidebar slot; it becomes a section+ of its nearest neighbour.+4. **Is it the same list with a different scope?** A filter, not a sub-page.+5. **Is it one row's detail?** A sheet, unless it owns lists of its own, is linked from elsewhere, or+ takes several steps. Then it is a detail page.+6. **Is it create, confirm or delete?** A dialog, while it stays short. A dialog that grows into a+ wizard or a long form becomes a sheet or a page. A form launched from a sheet is a step inside+ that sheet, never a dialog on top of it.++Keep what you **change** apart from what you **watch**: a control you can fat-finger does not belong+on a screen people scroll through during an incident.++## Groups — Applied++Six groups, named for the job. The regroup renamed no page; see Naming for the planned renames.++| Group | Pages (sub-pages in brackets) |+| --- | --- |+| **Platform** | Projects · Users (Members, Project Roles) · Connections (All, Global Connections) |+| **Catalogue** | Pieces (Pieces, Piece Sets) · Templates · AI Center (Providers, Capabilities) |+| **Security** | Single Sign On · Secret Managers · Audit Logs (Events, Event Streaming) |+| **Developers** | API Keys · Embedding · MCP Server (Connection, Tools, Activity) |+| **Operations** | Workers (Health, Worker groups) · Health (System Health, Runs Health, Queue Health) · Triggers |+| **Account** | General · Billing & subscription · Usage · Configurations (not on Cloud) |++## Sidebar behaviour — Applied++- **Sub-pages unfold only while you are inside their parent**, so the rail stays short. Two levels at+ most: a sub-page never has children.+- **The first sub-page shares its parent's path** and carries `end: true`, otherwise it stays lit on+ every sibling.+- **A crown in the sidebar means the page itself is locked**, not that something on it is paid. A page+ that works with only some actions gated (Projects' New Project, the Pieces list's visibility changes)+ gets no crown; the gated action carries its own. A page is locked when it cannot be used on the plan:+ it shows the sample overlay, or its data is behind the plan (Piece Sets).+- **A parent wears the crown only when every sub-page under it is locked.** Otherwise the crown sits on+ the locked sub-pages. A locked parent locks all its children.+- **The crown is the only mark, and a locked row stays fully clickable.** No dimming: grey reads as+ "disabled", and the point of showing a paid page is that people open its preview. Hovering a crowned+ row names the plan on Cloud and Enterprise ("Included in the Team plan", from `PLATFORM_FEATURES`;+ Community, which cannot buy a Cloud plan, gets "Not included in your plan"), and clicking it sends+ `admin.nav.locked.clicked` with the path and tier (Cloud only, so it is not in the self-hosted "Events+ we track" list), so each locked entry can be judged by whether anyone opens it. A click that lands on+ the page you are already on is not counted.+- **Detail pages have no sidebar entry.** You always arrive from a row. Planned: the back link always+ goes somewhere concrete, never browser history.++## URLs — Applied++- **Flat, and the group is never in the URL.** `/platform/sso`, not `/platform/security/sso`. Moving a+ page to another group is a sidebar edit and nothing else.+- **The slug matches the page's name** (`/platform/embedding`, not `/embed`), singular for a log+ (`/platform/audit-log`). A sub-page nests under its parent (`/platform/users/roles`,+ `/platform/audit-log/streaming`).+- **An old URL keeps working.** `LegacyPathRedirect` maps every page that shipped under+ `/platform/setup/*`, `/platform/security/*` and `/platform/infrastructure/*` to its new home, keeping the+ rest of the path, the query and the hash; an unknown path under one of those folders lands on the+ page that folder used to open. Billing's Stripe return URL relies on the query surviving. `LegacyTabRedirect`+ turns a released `?tab=` link into the matching sub-page. Of the `?tab=` URLs #15563 used for one day+ before release, only the AI and Pieces ones map; the rest open the parent page.+- **A section carries only the query its pages share.** Moving between sub-pages keeps `?month=` (the+ Health pages) and drops everything else, because sibling tables read the same `status`, `cursor` and+ `limit` keys. A new shared key goes in `SECTION_SEARCH_KEYS` in `ap-sidebar-item-utils`.++## Thin pages — Planned++Rule 3 is agreed; the merges are deferred to keep #15727 small. Candidates, each still to confirm:++- **Triggers** (one read-only table) → a section of Health.+- **Queue Health** (two cards and a table) → a section of Health › Runs.+- **Configurations** (two telemetry toggles) → a section of General.+- **MCP Server › Connection** (a URL and a collapsible) → the top of MCP Server, no sub-page.+- **API Keys** (create and revoke) → check against rule 1 before merging; admins do come here on purpose.++## Overlays — Planned++Rules 5 and 6 are agreed. What breaks them today:++- **AI key detail** renders as a page through `?config=` with no route → `/platform/ai/keys/:id`.+- **Project Role editor** is a dialog with thirteen permission rows → a detail page.+- **SAML setup** is a 612-line two-step wizard inside a dialog → a sheet with steps, or a page.+- **Customize Selector** is a 601-line sheet that configures the builder → its own sub-page of Pieces.+- **Nested dialogs** (the SAML domain confirm inside the SAML dialog, the deactivate-users dialog+ chained from cancel-subscription) → steps inside their parent.++## Naming — Planned++**Labels name the job, not the technology.** The rule is agreed; no label changes yet.++- Single Sign On → Sign-in. Event Streaming → Forwarding.+- Triggers is called three things (sidebar "Triggers", tab "Trigger Health", header "Trigger Health+ Status"); pick one.+- "Allowed domains" means embed origins on Embedding and sign-in email domains on SSO; rename one.++## Locked features — Planned++Five treatments exist today (sample overlay, banner with disabled actions, silent redirect, silent+hiding, and the full-page teaser). Proposed, not yet agreed: a whole locked page uses the sample overlay+(`PlanFeatureSample`); a single locked control on an otherwise usable page carries a crown and asks for+the upgrade on click, as the sidebar rule above already assumes; nothing is hidden or redirected+silently. Worker groups is the last page on the old full-page teaser.++## Known overlaps — Planned++- **Connections appear in three places**: the all-connections list, Global Connections, and the+ Projects page's global-connections column and edit field. Global is a scope, so it should end up+ a filter on one list (rule 4).+- **Worker CPU and RAM** show on both Workers › Health and Health › System.+- **Billing and Usage** read the same subscription and credits; Billing's Credits section overlaps+ Usage's meters.+- **Project assignment** is done from four places: Edit Project, Edit Global Connection, a piece set's+ Assigned projects, and an AI key's Project access.+- **The DNS-verify block** is duplicated between Embedding and the SAML dialog.+- **One header per page**: pages use four header styles today (`DashboardPageHeader`, `CenteredPage`,+ and two hand-rolled `h1`s). Pick one and the two page widths (full for lists, narrow for forms).++## Gotchas++- **Adding an admin page is three edits**: the sidebar (`components/sidebar/platform`), the route+ (`platform-routes.tsx`), and global search (`components/global-search/static-pages.ts`). Nothing+ checks the three agree. A page whose locked state is the sample overlay also needs a+ `PlanFeatureSample` entry, or it opens unlocked.+- **Moving or renaming a route needs a `LEGACY_PATHS` row**, or every bookmark, doc link and in-flight+ Stripe checkout to the old URL lands on a 404.+- **Source folders still follow the old grouping** (`routes/platform/security/embed`,+ `routes/platform/infra/...`). The URL is the contract; the folder is not, so do not read a page's+ group from its path.++## Key files++- `packages/web/src/app/components/sidebar/platform` — the groups and pages, `PlatformSidebar`+- `packages/web/src/app/routes` — every admin route, in `platformRoutes`+- `packages/web/src/app/routes/platform` — the pages, `LegacyPathRedirect`, `LegacyTabRedirect`,+ `PlanFeatureSample`+- `packages/web/src/app/components/sidebar` — `ApSidebarItem`, which does sub-item unfolding and the crown rulediff --git a/brain/knowledge/engineering/web-feature-anatomy.md b/brain/knowledge/engineering/web-feature-anatomy.mdindex 9a56c4dcb9c..4971a24db18 100644--- a/brain/knowledge/engineering/web-feature-anatomy.md+++ b/brain/knowledge/engineering/web-feature-anatomy.md@@ -85,7 +85,7 @@ way back was to stash the handful of intended edits, `git checkout` the package,- **Clicking through a Radix/cmdk component in a jsdom test needs the React root mounted on `document.body`, or the click never reaches React.** `createRoot(container)` attaches React's delegated listeners to `container`, but Radix `Popover` portals its content to `document.body` — a sibling of a nested root div — so synthetic events bubble body-ward, away from the listener. Items are queryable in the DOM and everything *looks* wired: the handler simply never runs, the assertion passes vacuously, and nothing tells you. `createRoot(document.body)` puts the portal inside the root container and the same dispatch fires. Three shims are needed first, each surfacing as an unrelated-looking error: `ResizeObserver` (cmdk, at mount), `Element.prototype.scrollIntoView` (cmdk, on open), and `PointerEvent` (absent in jsdom — alias it to `MouseEvent`). **And a throw inside an event handler is not a test failure.** React error boundaries only catch render/lifecycle errors, so an event-handler `TypeError` is re-thrown outside the act() call: `expect(...).toThrow()` sees nothing, the suite reports *passed*, and the only trace is vitest's `Unhandled Errors` block after the summary — which is easy to scroll past and which a `grep` for `passed|failed` hides completely. Grep the run for `Unhandled` too, and read that block as a failure. This is exactly how a crash in the multi-select property stayed invisible to a 101/101-green suite.- **A panel that hand-rolls its draft state gets none of the form validation the rest of the app assumes.** react-hook-form + `zodResolver` is what surfaces `formErrors.required` and friends; a `useState` draft with a Save button has no schema, so the usual mistake is to *substitute* a fallback for an empty field (`name.trim().length > 0 ? name.trim() : existing.name`) instead of rejecting it. That reads as a silent failure: the request succeeds, the old value returns, and nothing explains why. When a surface cannot use react-hook-form, derive the invalid state, render the message next to the field, and disable the submit — do not paper over the empty value. Bit the AI Center key-detail panel while its sibling connect dialog, on a zod resolver, was correct. The second failure mode is that such a draft never resyncs: seeded once from a prop, it outlives any refetch of the row it mirrors, so a mutation that changes the row without changing its `key` (the AI Center replaces a key's credentials, and the panel is keyed on the config id) leaves the draft describing the old row — phantom "unsaved changes", and a save that reverts what the mutation just wrote. Bump a version segment into the `key` at the site that performs the mutation rather than diffing props inside the panel: TanStack Query hands back a new object identity on every refetch, so a naive identity comparison discards the admin's unsaved edits on a window refocus.- **Sonner centres its icon against the whole toast, so a two-line toast puts the icon beside the wrong line.** `[data-sonner-toast]` is a centred flex row: fine for one line, visibly wrong the moment a description wraps or carries a disclosure — the icon drifts down next to the body instead of the title. Pass `classNames: { toast: 'items-start!', icon: 'mt-0.5' }` on that toast (the icon is 16px against 13px title text, so it needs the nudge to sit on the title's baseline). The `!` is not optional: sonner ships its own stylesheet, and a plain Tailwind `items-start` loses to it. Per-toast rather than on the `Toaster`, unless every toast in the app is meant to move.-- **To see a fetch-failure placeholder in the dev app, force the branch in code — do not try to break the network.** Patching `XMLHttpRequest.prototype.open` to rewrite the path (the api client is axios, so patching `fetch` alone does nothing) works only sometimes and costs a lot of fiddling: React Query keeps rendering the last good data, so the placeholder needs a query key with no cache; a full reload wipes the patch before the app boots, so navigation has to stay client-side; and some surfaces never error at all even when the rewritten path is confirmed to 404. Temporarily flipping the branch itself — `) : isError ? (` to `) : true || isError ? (` in `DataTable`, plus the same in each hand-written list — makes every page reachable by plain URL with no timing at all. Two cautions: it proves the *rendering* and not that `isError` is ever set, and `true || x` breaks TypeScript's narrowing after the guard, so a forced early return can throw "possibly undefined" errors into the Vite overlay — force it from the caller's prop instead when that happens. Forcing the branch is often not enough on a Community instance: agents, the AI Capabilities tab and the embed subdomain steps are behind route guards, edition checks and `LockedFeatureGuard`, so those have to be forced open too (`AgentsFlagGuard`'s redirect, `capabilitiesEnabled`, `isCloud` + `locked`) before the page renders at all. Revert with a grep for `true ||` / `false &&` / `locked={false}` before finishing.+- **To see a fetch-failure placeholder in the dev app, force the branch in code — do not try to break the network.** Patching `XMLHttpRequest.prototype.open` to rewrite the path (the api client is axios, so patching `fetch` alone does nothing) works only sometimes and costs a lot of fiddling: React Query keeps rendering the last good data, so the placeholder needs a query key with no cache; a full reload wipes the patch before the app boots, so navigation has to stay client-side; and some surfaces never error at all even when the rewritten path is confirmed to 404. Temporarily flipping the branch itself — `) : isError ? (` to `) : true || isError ? (` in `DataTable`, plus the same in each hand-written list — makes every page reachable by plain URL with no timing at all. Two cautions: it proves the *rendering* and not that `isError` is ever set, and `true || x` breaks TypeScript's narrowing after the guard, so a forced early return can throw "possibly undefined" errors into the Vite overlay — force it from the caller's prop instead when that happens. Forcing the branch is often not enough on a Community instance: agents, the AI Capabilities section and the embed subdomain steps are behind route guards, edition checks and `LockedFeatureGuard`, so those have to be forced open too (`AgentsFlagGuard`'s redirect, the `edition === ApEdition.COMMUNITY` branch in `routes/platform/setup/ai/index.tsx`, `isCloud` + `locked`) before the page renders at all. Revert with a grep for `true ||` / `false &&` / `locked={false}` before finishing.- **A table that ORs a secondary query into `isLoading` can never reach its error state.** The runs table passes `isLoading={isLoading || isFetchingFlows}`, where `isFetchingFlows` belongs to the flow list behind the *filter dropdown*. While that second query is fetching or retrying, the skeleton branch wins over `isError`, so a failing runs endpoint shows spinning rows rather than the placeholder — and a failing flows endpoint traps the table there indefinitely. Gate the skeleton on the query that owns the rows, and let a secondary query resolve on its own.@@ -99,7 +99,6 @@ way back was to stash the handful of intended edits, `git checkout` the package,- **`useWarnBeforeLosingChanges`'s `standDown` ref has to be set *after* the destructive request succeeds, not before it.** `components/custom/leave-without-saving.tsx` guards a dirty panel against navigation and `beforeunload`; `standDown` is how a deliberate exit (deleting the thing being edited) avoids prompting on its own way out. Setting it before `await`ing the delete disarms the guard for the whole request, so a refresh or tab close mid-flight discards the draft silently — and if the delete then fails, the row is still there and the edits are not. A `finally` that restores the ref does not help: the window has already passed. The ordering only works if the mutation and the navigation are separable, so the panel can stand down between them — keep the delete prop to the mutation alone and let the panel call its own `onBack`, rather than handing it one callback that does both.- **`Button`'s `keyboardShortcut` does not stop firing while the button is loading, and its listener lags a render behind.** Two separate gaps in `components/ui/button.tsx`. The element gets `disabled={disabled || loading}`, but `useKeyboardShortcut` was handed the raw `disabled` prop, so a button mid-request still ran its handler on ⌘/Ctrl+key — latent for years because every caller before the AI Center Save button was a non-loading `variant="outline"` button. Fixing that still leaves a window: the listener is registered in a passive effect, which runs after paint, so between a click and the effect re-running the old closure keeps `disabled=false`. Anything whose handler must not run twice (a mutation) needs its own guard set synchronously inside the handler — a ref, not a `disabled` prop — because no prop can close an effect-timing window. Separately, `Shortcut` renders in `text-muted-foreground`, which is invisible on a filled button; `Button` now tints it per variant, so pass nothing.- **Exported types and constants belong at the *end* of the file**, after the components and logic. Reading a file should start with what it does, not its type declarations.-- **The lock icon on a platform-admin nav item is decorative, and paid gating is done four different ways behind it.** `ApSidebarItem` renders a `LockKeyhole` when `item.locked`, but the click handler ignores `locked` entirely and navigates anyway, so the real gate is always whatever the destination page does. What that page does is not consistent: twelve pages wrap their whole body in `LockedFeatureGuard`, Pieces instead keeps the page fully usable under a `LockedAlert` banner, the branding fields in `setup/general` only set `disabled` with no explanation and no upgrade path at all, and AI Center gates on `PlatformRole.ADMIN` rather than a plan flag (`aiProvidersEnabled` gates the connect button inside it, not the page). Two of the thirteen locked nav items have no in-page hook at all. So reading the sidebar tells you a feature is paid but not what the user will actually meet, and "remove the locks" is a smaller change than it looks while "make gating consistent" is a much larger one. The active-item check is `pathname.startsWith(item.to)` with no `?tab=` awareness, so folding pages into tabs needs the `isActive` override that prop already offers and the platform sidebar never passes.- **The web has two independent "something went wrong" surfaces, and they cover different failures.** `GlobalErrorBoundary` (`app/components/global-error-boundary.tsx`) is a React error boundary: it catches *render* crashes and replaces the page with a reload/go-home fallback. It structurally cannot see a React Query failure — a failed query is stored as state, not thrown during render, unless the query opts into `throwOnError` or Suspense. Nothing global covers that async gap any more: a failed primary query is reported by the surface itself, through `DataFetchErrorState`. The two landed independently (the query surface first, in #12476 for tables; the boundary later, in #13743) and were never calibrated against each other, so for a long stretch a single 404 got a *blocking modal with raw JSON* while an actual app crash got a friendly reload button. Keep that ordering right: a failed fetch on a page that still renders is an in-place placeholder, a dead render tree is the full-page fallback. A modal is only correct when the error payload is something the user must read and copy — flow publish showing the trigger piece's stderr (`flow-hooks.tsx`) is the one case that still earns `ApErrorDialog`.- **`FriendlyErrorView` is the one renderer for a `FriendlyPieceError` — reach for it before hand-rolling a message line.** `app/builder/data-display/friendly-error-view.tsx` already turns the parsed payload into a status-keyed headline and hint (401 → "Authentication failed" + "Try reconnecting the account…"), an `HTTP {status}` badge, a labelled message block that prefers `apiMessage` over `message`, and its own `Technical Details` disclosure; it is wired to the run-details and test-step panels. For an auth failure the status-keyed *hint* is the part that actually prevents a misdiagnosis — naming whose credentials to fix beats quoting the third party's own sentence, which is what made a rejected Linear key read to a customer as their Activepieces session expiring (Pylon 5833). Three things make it non-trivial to drop into `ApErrorDialog` and all three are local fixes: it renders a second `Technical Details` next to the dialog's own, its disclosure shows `raw ?? payload` so it drops `standardOutput` (the piece's stderr, often the useful half of a failed trigger enable), and `useChangeFlowStatus` has only `flowId` so `pieceDisplayName` falls back to "What the service said". Fix those rather than growing a parallel renderer — a second one means the `message`-is-JSON trap (see *building pieces*) has to be fixed twice.- **Stubbing Radix `Select` in a jsdom test: render each `SelectItem` as a button that calls the real `onValueChange`, and never match a click by button text alone.** The component under test passes `onValueChange` to `Select`, so a stub that captures it in a `vi.hoisted` box and has `SelectItem` call it with its own `value` gives you the real state update without Radix's portal, pointer and `ResizeObserver` machinery. The trap is finding the button afterwards: the dropdown items and the UI they control often carry the same words (a Text/Image type picker next to chips whose badge also reads "Text"), and a `textContent` match takes whichever comes first in the DOM — silently clicking the dropdown item and asserting a no-op. Match on something structural (`button[title="Model Type"]` inside the chip) and give each helper a name that says which one it clicks. Also note `expect(value, 'message')` — valid vitest — is rejected by the repo's `vitest/valid-expect` lint rule, so put the identifying detail in the helper name rather than the assertion message.diff --git a/brain/knowledge/engineering/web-navigation-shell.md b/brain/knowledge/engineering/web-navigation-shell.mdindex b1c7f47c70c..359c37d6fe0 100644--- a/brain/knowledge/engineering/web-navigation-shell.md+++ b/brain/knowledge/engineering/web-navigation-shell.md@@ -18,10 +18,9 @@ of the three that understands paid gating. Its groups and items are a literal burender, not a config.**Layouts** (`components/platform-layout.tsx`, `components/project-layout`) pick which of the above a-route gets. `PlatformLayout` is 44 lines and mounts the platform sidebar with no rail beside it.+route gets. `PlatformLayout` mounts the platform sidebar with no rail beside it.-`ap-sidebar-item` and `ap-sidebar-group` are the shared primitives, used by the dashboard and platform-sidebars only. The rail imports neither.+`ap-sidebar-item` is the item primitive, and only the platform sidebar uses it. The rail does not.## Gotchas@@ -33,9 +32,10 @@ sidebars only. The rail imports neither.since it bundled a navigation model change together with global search and the builder canvas. Keep anavigation change scoped to one surface and it stays revertable on its own.- **The rail and the platform admin nav are aligned by hand, not by shared code.** `primary-rail` imports- none of the sidebar primitives, so the two columns only look like one system because PR #15028 tuned- their widths and spacing to match. Any change to admin nav metrics needs re-checking against the rail,- and no type error or test will tell you it drifted.+ none of the sidebar item components (only `CreateProjectButton` borrows `SidebarMenuButton`), so the+ two columns only look like one system because PR #15028 tuned their widths and spacing to match. Any+ change to admin nav metrics needs re-checking against the rail, and no type error or test will tell you+ it drifted.- **Platform admin deliberately renders without the rail.** `PlatformLayout` mounts the platform sidebarstraight under `SidebarProvider`, because the rail beside it meant two left columns and a narrower adminnav, and the admin nav already carries its own way back out. This is a documented departure from the@@ -44,34 +44,37 @@ sidebars only. The rail imports neither.through `determineDefaultRoute`.- **A role check inside a platform admin page is dead code.** `PlatformLayout` calls `useIsPlatformAdmin()`and redirects away when it fails, so every component below it already knows the viewer is a platform- admin. AI Center nonetheless wrapped itself in a guard keyed on `platformRole !== PlatformRole.ADMIN`,+ admin. AI Center used to wrap itself in a guard keyed on `platformRole !== PlatformRole.ADMIN`,which can never be true where it sits, and that guard was the only thing standing in for a plan gate onthat page: reading it, the page looks gated when nothing gates it. Same shape as the `isCommunity` checksunder `BillingPageShell`. Before adding a guard to an admin page, check whether the layout above alreadydecided it.-- **`locked` is a platform-only concept living in a shared primitive.** `ap-sidebar-item` renders the lock- icon, but the dashboard sidebar passes `locked` zero times and the platform sidebar passes it fifteen.- So a change to lock or badge rendering edits a file two callers share to alter a path one caller uses.- Worth rendering platform-specific item chrome in the platform sidebar instead, rather than growing the- shared primitive for one consumer.+- **The crown on a nav item is a label, not a gate.** `ap-sidebar-item` draws it when `locked`, but the+ click still navigates, so what the user meets is whatever the destination page does: a+ `PlanFeatureSample` overlay, a banner with disabled actions, or nothing. Reading the sidebar tells you a+ feature is paid, not how its page behaves.- **`/platform` redirects without `replace`, so Back lands you right back on it.** Every other admin- redirect (`/platform/setup`, `/platform/security`, `/platform/infrastructure`, `/platform/setup/branding`,- `/platform/setup/ai-capabilities`) passes `replace` to `<Navigate>`, but the one on `/platform` does not,- so it pushes a history entry and the browser Back button re-enters the redirect instead of leaving the- admin. Anyone who opens platform admin from a link to `/platform` rather than a specific page is stuck- going forward. Preserved deliberately while the routes were being derived from a registry, so fixing it- is a one-word change wherever that redirect is declared.+ redirect passes `replace` to `<Navigate>`, but the one on `/platform` in `platform-routes.tsx` does not,+ so the browser Back button re-enters the redirect instead of leaving the admin. A one-word fix.-- **Four platform admin pages already carry their own tabs, so they cannot become tabs of something else without nesting two deep.** `setup/pieces` (Pieces, Piece sets, plus a `piece-sets/:id` child route), `infra/workers` (Health, Worker groups), `infra/health` (System, Runs, Queue) and `setup/mcp` (Connection, Tools). Any plan that groups admin pages under a parent has to answer this for each of them, and the answer decides the item count more than the grouping does: leaving all four as their own nav items lands around seventeen, folding them in lands around thirteen but puts a second tab row inside a tab. Count `TabsTrigger` occurrences per page before promising a number, because the mockups that drive this work are drawn from the nav and cannot see the second level.+- **Admin sections are routes, not tabs.** Pieces, Workers, Health, AI Center and MCP Server used to switch+ sections with in-page tabs; each section is now a sidebar sub-item with its own path, and+ `LegacyTabRedirect` rewrites an old `?tab=` link to that path (MCP's tabs never had one). A new section gets a route and a+ sub-item, plus an entry in the page's `*_TAB_PATHS` map if it replaces a tab.-- **The active item is a bare prefix match with no query-string awareness.** `pathname.startsWith(item.to)`,- plus an optional `isActive` override that the platform sidebar never passes. Any nav that needs to- distinguish tabs of one page has to pass that override, because `?tab=` is invisible to the default.+- **The active item is a `matchPath` on the pathname, so query strings never count.** A parent row is+ active for any path under it; a sub-item that shares its parent's path needs `end: true`, or it stays lit+ on every sibling. See `isRouteActive` in `ap-sidebar-item`.++- **Tailwind v4's `data-*:` variant matches the attribute's *presence*, so a component that always renders `data-active={bool}` styles every instance as active.** React writes `data-active="false"` for a false value rather than omitting the attribute, and `data-active:bg-sidebar-accent` compiles to `[data-active]` — so `SidebarMenuSubButton`, which defaults `isActive = false` and always spreads it, painted the accent background on *every* child row at once, leaving the URL as the only signal of which one you were on. Write `data-[active=true]:` whenever the attribute is always present. The same shape sits in `sidebarMenuButtonVariants`, where it is *not* harmless: `data-active:text-sidebar-accent-foreground` paints every row at the accent foreground, so a plain `text-*` class on a row — a muted treatment for a plan-locked entry, say — loses to it (0,2,0 beats 0,1,0) and silently does nothing. Fix the variant rather than reaching for `!` on the row: an `!important` colour also beats the base's `hover:text-sidebar-accent-foreground`, so the row silently stops responding to hover. Related: that cva has no active *background* at all, so a row cannot be highlighted through `isActive` alone — the platform rail sets the background with `cn()` and an explicit `hover:bg-sidebar-accent!`, because the base's `hover:bg-sidebar-accent` is (0,2,0) and a plain `bg-*` is (0,1,0); tailwind-merge does not collapse them, since the modifiers differ.+- **The animated icons in `components/icons/*` wrap their `<svg>` in a plain `<div>`, so a size class on the icon sizes the wrapper and not the drawing.** The wrapper takes `className`; the svg inside carries `width`/`height` from a `size` prop (28 in 32 of the 38, 16 in five, 20 in `zap.tsx` alone) and is then overridden by whatever `[&_svg]:size-*` the parent sets — a descendant selector, which outranks any plain class on the svg. A rail asking for 20px icons therefore rendered 16px ones until the *parent* said `[&_svg]:size-5` — which wins not on specificity (it is the identical selector to the base) but because `SidebarMenuButton` composes through `cn()` and tailwind-merge drops the base for the same key. On a component that does not run its classes through `cn()`, the two rules tie and the generated stylesheet's own ordering decides — not the order you write them in the class attribute. Worse, the svg is `display: inline`, so inside that wrapper it sits on the text baseline rather than centred: two pixels high, while any bare svg beside it (`McpSvg`, the user avatar) centres correctly — which reads as a rail where the icons are subtly, inconsistently off. `[&_svg]:block` removes the baseline gap for both shapes. Measure rather than eyeball: compare each icon's `getBoundingClientRect()` centre against its row's.+- **`SidebarContent` is already a scroll container, so wrapping it in another one gives you two scrollers.** It ships `overflow-auto`, and used to carry a `no-scrollbar` class that was defined nowhere (`styles.css` defines `scrollbar-none`); the dead class has since been removed. Note that the global "6px pill" in `styles.css` is not what Chrome draws: the same block sets the standard `scrollbar-width: thin` on `*`, and from Chrome 121 a standard `scrollbar-width` makes the browser ignore every `::-webkit-scrollbar` rule, so what renders is a ~10px track that takes layout width whenever the box overflows and shows arrow buttons at both ends once `*:hover` colours it. That track is why a scrolling list's right padding reads wider than its left. Reach for `ScrollArea` wherever a thin bar matters; its `type` decides whether it shows always or on hover. The platform rail had a hand-rolled `flex-1 overflow-y-auto` around it: two nested scrollers, wheel events chaining between them, and the visible thumb belonging to the outer box. Have exactly one scroller. The platform rail makes `SidebarContent` `overflow-hidden` and scrolls through `ScrollArea` instead, whose Radix scrollbar is an overlay: it takes no layout width and has no arrow buttons, so it can sit in the rail's right padding without unbalancing it. To say there is more below, pass `showGradient` to `ScrollArea`: it veils the bottom of the list into the sidebar colour only while the viewport can still scroll down, and `gradientClassName` sets its height (the default fifth of the viewport is far too tall for a nav rail).+- **A sidebar painted the same colour as the page is judged against the content card, not its own edge.** `bg-sidebar` is also the background behind the dashboard card, so the rail's right edge is invisible and the eye measures a row's right padding to the card's border. `ProjectDashboardLayout` puts the card flush against the rail (`pr-2 pt-3 pb-3`); a layout that pads the card on the left too (`p-2`) adds that padding to the rail's apparent right gutter, and the rail reads as lopsided however symmetric its own insets measure.## Key files- `packages/web/src/app/components/primary-rail`: the chat-first rail-- `packages/web/src/app/components/sidebar`: `ap-sidebar-item` / `ap-sidebar-group` primitives, plus the `dashboard`, `platform` and `project` navs+- `packages/web/src/app/components/sidebar`: the `ap-sidebar-item` primitive, plus the `dashboard` and `platform` navs- `packages/web/src/app/components/platform-layout.tsx`: `PlatformLayout`, the admin frame and its admin-role check- `packages/web/src/lib/route-utils.ts`: `determineDefaultRoute`, where "Back to app" goesdiff --git a/brain/knowledge/pieces-engine/piece-sets.md b/brain/knowledge/pieces-engine/piece-sets.mdindex 2c3470e3c5b..8add8ef26cb 100644--- a/brain/knowledge/pieces-engine/piece-sets.md+++ b/brain/knowledge/pieces-engine/piece-sets.md@@ -20,7 +20,7 @@ A named, reusable piece/action/trigger visibility configuration a platform admin### Gotchas- EE/Cloud only, gated behind `platform.plan.managePiecesEnabled`. On CE / flag off, piece sets are inert and filtering falls back to legacy project-plan allow/block lists.-- The **whole** `/v1/piece-sets` module is behind that flag, `GET` included — so on a locked plan the web list query is `enabled: false`, the table is simply empty, and row actions never render. Only toolbar/entry points need a UI guard. The `LockedAlert` + `RequestTrial featureKey="ENTERPRISE_PIECES"` lives once on `PlatformPiecesPage`, above the tabs, since the same flag gates both the Pieces and Piece Sets tabs; the details route redirects back to the tab rather than hanging on a spinner waiting for a query that will never run.+- The **whole** `/v1/piece-sets` module is behind that flag, `GET` included — so on a locked plan the web list query is `enabled: false`, the table is simply empty, and row actions never render. Only toolbar/entry points need a UI guard. `PiecesLockedBanner` renders at the top of both the Pieces and the Piece Sets pages, since the same flag gates both; the details route redirects back to `/platform/pieces/piece-sets` rather than hanging on a spinner waiting for a query that will never run.- There is **no** install-time sync and no `onPieceCreated` hook — resolution is purely read-time. See ADR 0001 (visibility derived, not materialized).- Embed auth: a v4 JWT carries a `pieceSet` key claim; legacy v2/v3 tokens carry `piecesTags` (only the first tag honored, resolved to `key = tag`, else Default). Enforcement (`applyProjectPieceAccess`) runs unconditionally, not gated by the flag.- **`usePieces({ skipProjectFilter: true })` is not a caching flag — it silently turns piece-set filtering off.** It drops `projectId` from `GET /v1/pieces`, and `resolveVisibility` (`ee/pieces/filters/piece-filtering-utils.ts`) bails to `null` the moment *either* `platformId` or `projectId` is nil, so the response is the unfiltered platform catalog. `platformId` still comes from the principal, so this is not a tenancy hole — but any surface using it advertises pieces a restricted project's flows and MCP server will not actually expose. Correct for platform-admin screens (the piece-set editor has to list pieces you have not permitted yet) and for a marketing-style showcase; wrong anywhere the list implies "what you can use here". The absence of `projectId` is easy to miss at the call site because the flag reads like a client-side concern. The mirror-image trap: with the flag off, `usePieces` scopes to `authenticationSession.getProjectId()` — the *session's* project — so a platform-admin screen inspecting some other project (the MCP Reach tab, with its project picker) must pass `projectId` explicitly or it will quietly render the admin's own project's pieces under another project's name.@@ -42,7 +42,7 @@ Entry point: `pieceSetService`, defined in `piece-set.service.ts` and wired to t- `packages/server/api/src/app/ee/managed-authn/managed-authn-service.ts` — embed token enforcement via `applyProjectPieceAccess`- `packages/server/api/src/app/ee/projects/ee-project-hooks.ts` — assigns the Default set on project `postCreate`- `packages/web/src/features/piece-sets/` — client api and hooks-- `packages/web/src/app/routes/platform/setup/pieces/piece-sets/` — management UI, tabs and dialogs+- `packages/web/src/app/routes/platform/setup/pieces/piece-sets/` — management UI and dialogs- `brain/decisions/000007-piece-set-visibility-is-derived-at-read-time.md` — why visibility is derived rather than materializedPaths verified 2026-07-17.diff --git a/brain/knowledge/platform-editions-ee/embed.md b/brain/knowledge/platform-editions-ee/embed.mdindex 80d91a8fe3a..d01dbe7528d 100644--- a/brain/knowledge/platform-editions-ee/embed.md+++ b/brain/knowledge/platform-editions-ee/embed.md@@ -50,7 +50,7 @@ That 3-minute TTL is the reason a freshly-added origin does not take effect imme## Admin UI-The Embed Onboarding stepper at `/platform/security/embed`. Four steps exist as files — `hostname-step`, `dns-step`, `allowed-domains-step`, `signing-keys-step` — and Cloud walks all four; self-hosted skips the two Cloudflare ones because it serves the embed from `FRONTEND_URL`.+The Embed Onboarding stepper at `/platform/embedding`. Four steps exist as files — `hostname-step`, `dns-step`, `allowed-domains-step`, `signing-keys-step` — and Cloud walks all four; self-hosted skips the two Cloudflare ones because it serves the embed from `FRONTEND_URL`.## Endpointsdiff --git a/brain/knowledge/platform-editions-ee/index.md b/brain/knowledge/platform-editions-ee/index.mdindex 4d16cd8c272..987cede997b 100644--- a/brain/knowledge/platform-editions-ee/index.md+++ b/brain/knowledge/platform-editions-ee/index.md@@ -22,7 +22,7 @@ All commercial modules live under `src/app/ee/`, registered only for EE/Cloud inAdds members, roles, git-sync releases, per-project piece sets on top of CE projects. RBAC: `rbacService.assertPrincipalAccessToProject()` branches by principal (USER→member role, ENGINE→projectId match, SERVICE→platform match). 3 default roles (ADMIN/EDITOR/VIEWER) + custom roles (`customRolesEnabled`) over 26 permissions. `ProjectRelease` (GIT_BRANCH/MANUAL/ROLLBACK) diffs then applies state atomically under a memory lock; gated by `environmentsEnabled`. Optional `workerGroupId` routes a project's flow jobs to a dedicated worker pool (`workerGroupsEnabled`).### Embed / Signing Keys-Platform admin configures embedded workflows at `/platform/security/embed` (Cloud: 4 steps incl. Cloudflare hostname + DNS; CE/EE: 2 steps). Core is RSA-4096 signing keys (`/v1/signing-keys`, platform-admin only): private key returned exactly once, only public key stored. Vendor signs JWTs (RS256, `kid` = key id); AP verifies on `POST /v1/managed-authn/external-token`. `platform.allowedEmbedOrigins`, merged with the `AP_ALLOWED_EMBED_ORIGINS` env list, drives the CSP `frame-ancestors` header. Gated by `plan.embeddingEnabled`.+Platform admin configures embedded workflows at `/platform/embedding` (Cloud: 4 steps incl. Cloudflare hostname + DNS; CE/EE: 2 steps). Core is RSA-4096 signing keys (`/v1/signing-keys`, platform-admin only): private key returned exactly once, only public key stored. Vendor signs JWTs (RS256, `kid` = key id); AP verifies on `POST /v1/managed-authn/external-token`. `platform.allowedEmbedOrigins`, merged with the `AP_ALLOWED_EMBED_ORIGINS` env list, drives the CSP `frame-ancestors` header. Gated by `plan.embeddingEnabled`.- *Avoid:* `allowedEmbedDomains` — the old field name, gone.### License Keysdiff --git a/brain/knowledge/platform-editions-ee/platform-configuration.md b/brain/knowledge/platform-editions-ee/platform-configuration.mdindex 1072f75adfb..da60246107e 100644--- a/brain/knowledge/platform-editions-ee/platform-configuration.md+++ b/brain/knowledge/platform-editions-ee/platform-configuration.md@@ -17,7 +17,7 @@ A **Platform** is the top-level tenant namespace in Activepieces. Every install- `GET /v1/platforms/assets/:id` — public asset download.### Gotchas-- **The platform name is editable on every edition, even though it lives inside the Appearance section.** `appearance-section.tsx` computes `brandingLocked = !platform.plan.customAppearanceEnabled` and passes `disabled={brandingLocked}` to the logo, icon, favicon and theme-colour inputs, but **not** to the `Platform Name` input, and `formdata.append('name', name)` sits outside the `if (!brandingLocked)` block. So a Community or unlicensed platform can rename itself at Settings > Platform > Setup > General while every other field on that form is locked. Reading the file top-down makes the whole section look gated; it is per-field. `UpdatePlatformRequestBody.name` is likewise ungated on the API and only validated against `SAFE_STRING_PATTERN` (no `.` or `/`).+- **The platform name is editable on every edition, even though it lives inside the Appearance section.** `appearance-section.tsx` computes `brandingLocked = !platform.plan.customAppearanceEnabled` and passes `disabled={brandingLocked}` to the logo, icon, favicon and theme-colour inputs, but **not** to the `Platform Name` input, and `formdata.append('name', name)` sits outside the `if (!brandingLocked)` block. So a Community or unlicensed platform can rename itself at Settings > Platform > Account > General while every other field on that form is locked. Reading the file top-down makes the whole section look gated; it is per-field. `UpdatePlatformRequestBody.name` is likewise ungated on the API and only validated against `SAFE_STRING_PATTERN` (no `.` or `/`).- Per-project piece/action/trigger visibility is done via **piece sets**, NOT the platform.- On GET for USER principals, `plan.chatEnabled` is rewritten to effective per-user chat visibility, and `licenseKey` is nulled for embedded users.- Updating SAML config clears the cached SAML client (`invalidateSamlClientCache`).diff --git a/docs/admin-guide/guides/ai-capabilities.mdx b/docs/admin-guide/guides/ai-capabilities.mdxindex 1412a7705b5..8c84c3fdc3d 100644--- a/docs/admin-guide/guides/ai-capabilities.mdx+++ b/docs/admin-guide/guides/ai-capabilities.mdx@@ -37,7 +37,7 @@ Image Generation lets the AI assistant create images such as realistic photos, mThe setup is similar across the available capabilities:-1. Go to **Platform Admin → AI Center → AI Capabilities**.+1. Go to **Platform Admin → Catalogue → AI Center → Capabilities**.2. Find the capability you want to configure.3. Click **Set up**.4. Enter the API key for the external service.diff --git a/docs/admin-guide/guides/event-streaming.mdx b/docs/admin-guide/guides/event-streaming.mdxindex 6e96bb0d826..9101bcccf51 100644--- a/docs/admin-guide/guides/event-streaming.mdx+++ b/docs/admin-guide/guides/event-streaming.mdx@@ -16,7 +16,7 @@ Use it to react to flow run failures, new sign-ins, project releases, or any othThe fastest way to get going is the **Generate handler flow** button in the New destination dialog. It builds a webhook-triggered flow with one router branch per event you select, plus a nested branch for failed runs when you pick `flow.run.finished`.-1. Open **Platform Admin → Event Streaming**.+1. Open **Platform Admin → Security → Audit Logs → Event Streaming**.2. Click **New Destination**, pick the events you want to handle, and click **Generate handler flow**.3. The flow lands in your personal project with a webhook trigger and a router branch per selected event. Sample data is pre-baked so you can hit Test right away, you can add a router step under any event branch to check for specific projects/flows ids.@@ -33,7 +33,7 @@ You can subscribe a destination to any audit event — flow lifecycle, run statuIf you already have a webhook URL — or you want to point Event Streaming at a SIEM, data warehouse, or any other external system — you can skip the handler flow and configure the destination by hand:-1. Go to **Platform Admin → Event Streaming**.+1. Go to **Platform Admin → Security → Audit Logs → Event Streaming**.2. Click **New Destination**.3. Select the **Events** you want to forward.4. Paste your **Webhook URL** (must be a valid HTTPS endpoint).diff --git a/docs/admin-guide/guides/global-connections.mdx b/docs/admin-guide/guides/global-connections.mdxindex 0172489fd87..906a93c5b47 100644--- a/docs/admin-guide/guides/global-connections.mdx+++ b/docs/admin-guide/guides/global-connections.mdx@@ -33,7 +33,7 @@ You can create a new global connection using either**OAuth2**-**Step 1**: Go to **Platform Admin → Global Connections**.+**Step 1**: Go to **Platform Admin → Platform → Connections → Global Connections**.**Step 2**: Click **New Connection**.@@ -53,7 +53,7 @@ You can create a new global connection using either#### **Custom OAuth2 App (Advanced) or Service Account (Advanced)**-**Step 1**: Go to **Platform Admin → Global Connections**.+**Step 1**: Go to **Platform Admin → Platform → Connections → Global Connections**.**Step 2**: Click **New Connection**.diff --git a/docs/admin-guide/guides/manage-oauth2.mdx b/docs/admin-guide/guides/manage-oauth2.mdxindex 80e91f7a9c8..7bc79ec662f 100644--- a/docs/admin-guide/guides/manage-oauth2.mdx+++ b/docs/admin-guide/guides/manage-oauth2.mdx@@ -18,7 +18,7 @@ When users connect to services like Google Sheets or Slack, they see "Activepiec## How to Configure-1. Go to **Platform Admin → Setup → Pieces**+1. Go to **Platform Admin → Catalogue → Pieces**2. Find the piece you want to configure (e.g., Google Sheets)3. Click the lock icon to open the OAuth2 settings4. Enter your own Client ID and Client Secretdiff --git a/docs/admin-guide/guides/manage-pieces.mdx b/docs/admin-guide/guides/manage-pieces.mdxindex d073ac29b78..1481a6be453 100644--- a/docs/admin-guide/guides/manage-pieces.mdx+++ b/docs/admin-guide/guides/manage-pieces.mdx@@ -31,7 +31,7 @@ There are **two levels** of piece management:## Platform-Level Management-Platform administrators can manage pieces for the entire Activepieces instance from **Platform Admin → Setup → Pieces**.+Platform administrators can manage pieces for the entire Activepieces instance from **Platform Admin → Catalogue → Pieces**.## Project-Level Management@@ -79,7 +79,7 @@ If you've built a custom piece for your organization, you can upload it directlyThis generates a tarball in `dist/packages/pieces/your-piece-name`.</Step><Step title="Navigate to Pieces Settings">- Go to **Platform Admin → Setup → Pieces** and click **Install Piece**.+ Go to **Platform Admin → Catalogue → Pieces** and click **Install Piece**.</Step><Step title="Select File Upload">Choose **Upload File** as the installation source.diff --git a/docs/admin-guide/guides/scim/providers/microsoft-entra-id.mdx b/docs/admin-guide/guides/scim/providers/microsoft-entra-id.mdxindex 32454b4fa3c..03f1bde222d 100644--- a/docs/admin-guide/guides/scim/providers/microsoft-entra-id.mdx+++ b/docs/admin-guide/guides/scim/providers/microsoft-entra-id.mdx@@ -12,7 +12,7 @@ Before you start, make sure you have:- **Admin access** to your Activepieces platform- **Admin access** to your Microsoft Entra ID- SSO already configured (recommended): [SAML with Microsoft Entra ID](/admin-guide/guides/sso#saml-with-microsoft-entra-id-azure-ad)-- Generated an API key from `/platform/security/api-keys` route in the Activepieces app+- Generated an API key from `/platform/api-keys` route in the Activepieces app## Configure SCIM Connection in Microsoft Entra IDdiff --git a/docs/admin-guide/guides/scim/providers/okta.mdx b/docs/admin-guide/guides/scim/providers/okta.mdxindex 98a93f26c2c..9309720be80 100644--- a/docs/admin-guide/guides/scim/providers/okta.mdx+++ b/docs/admin-guide/guides/scim/providers/okta.mdx@@ -12,7 +12,7 @@ Before you start, make sure you have:- **Admin access** to your Activepieces platform- **Admin access** to your Okta tenant- SSO already configured (recommended): [SAML with Okta](/admin-guide/guides/sso#saml-with-okta)-- Generated an API key from `/platform/security/api-keys` route in the Activepieces app+- Generated an API key from `/platform/api-keys` route in the Activepieces app## Configure SCIM Connection in Oktadiff --git a/docs/admin-guide/guides/setup-ai-providers.mdx b/docs/admin-guide/guides/setup-ai-providers.mdxindex f004698509c..2a746afa06b 100644--- a/docs/admin-guide/guides/setup-ai-providers.mdx+++ b/docs/admin-guide/guides/setup-ai-providers.mdx@@ -21,7 +21,7 @@ This is especially useful for larger teams that want to:### **How Connect to an AI Provider**-**Step 1**: Go to **Platform Admin → AI Center →AI Providers**.+**Step 1**: Go to **Platform Admin → Catalogue → AI Center → Providers**.**Step 2:** Find the provider you want to configure.diff --git a/docs/embedding/configure-embedding.mdx b/docs/embedding/configure-embedding.mdxindex c8a37a8cd52..8ebe56415ca 100644--- a/docs/embedding/configure-embedding.mdx+++ b/docs/embedding/configure-embedding.mdx@@ -6,7 +6,7 @@ icon: "sliders"<Snippet file="embed-feature.mdx" />-Before you provision users and generate signing keys, complete the embed onboarding in **Platform Settings → Security → Embedding**.+Before you provision users and generate signing keys, complete the embed onboarding in **Platform Admin → Developers → Embedding**.On **Cloud**, all four steps below are required. On **self-hosted** Enterprise, only steps 3 and 4 apply — your instance already runs on your own domain.diff --git a/docs/embedding/customize-pieces.mdx b/docs/embedding/customize-pieces.mdxindex fa3d123427a..cff7a66cb7e 100644--- a/docs/embedding/customize-pieces.mdx+++ b/docs/embedding/customize-pieces.mdx@@ -14,7 +14,7 @@ A piece set is a reusable, named selection of pieces (and, optionally, which of<Steps><Step title="Create a Piece Set">- Go to **Platform Admin -> Setup -> Pieces -> Piece Sets**, create a set, choose which pieces are visible, and give it a **Key** (e.g. `premium`). If you leave the key blank, one is generated from the name.+ Go to **Platform Admin -> Catalogue -> Pieces -> Piece Sets**, create a set, choose which pieces are visible, and give it a **Key** (e.g. `premium`). If you leave the key blank, one is generated from the name.</Step><Step title="Reference the set in the Provision Token">Issue a **v4** token and set the `pieceSet` claim to the set's key. Check how to generate a token in [provisioning users](./provision-users).@@ -37,7 +37,7 @@ Older integrations select pieces by tag using a **v3** token. New integrations s<Steps><Step title="Tag Pieces">- Tag the pieces you would like to show to your user by going to **Platform Admin -> Setup -> Pieces**, selecting the pieces you would like to tag and hit **Apply Tags**+ Tag the pieces you would like to show to your user by going to **Platform Admin -> Catalogue -> Pieces**, selecting the pieces you would like to tag and hit **Apply Tags**</Step>diff --git a/docs/embedding/predefined-connection.mdx b/docs/embedding/predefined-connection.mdxindex e65760ac61c..c5233b7b1f6 100644--- a/docs/embedding/predefined-connection.mdx+++ b/docs/embedding/predefined-connection.mdx@@ -18,7 +18,7 @@ The high-level steps are:<Steps><Step title="Create an API Key">- Go to **Platform Admin → Security → API Keys** and create an API key. Save it for use in the next step.+ Go to **Platform Admin → Developers → API Keys** and create an API key. Save it for use in the next step.</Step><Step title="Create a Global Connection via API">diff --git a/docs/handbook/engineering/playbooks/run-ee.mdx b/docs/handbook/engineering/playbooks/run-ee.mdxindex 367d5a397ba..244cc7eb02d 100644--- a/docs/handbook/engineering/playbooks/run-ee.mdx+++ b/docs/handbook/engineering/playbooks/run-ee.mdx@@ -42,7 +42,7 @@ AP_JWT_SECRET=secret</Step><Step title="Activate Your License Key">- After signing in, activate the license key by going to **Platform Admin -> Setup -> License Keys**+ After signing in, activate the license key by going to **Platform Admin -> Account -> Billing & subscription** and clicking **Activate license key**</Step>diff --git a/docs/handbook/engineering/playbooks/security-advisory-response.mdx b/docs/handbook/engineering/playbooks/security-advisory-response.mdxindex 58d45af9208..4df8f6f37cb 100644--- a/docs/handbook/engineering/playbooks/security-advisory-response.mdx+++ b/docs/handbook/engineering/playbooks/security-advisory-response.mdx@@ -129,7 +129,7 @@ Re-confirm the disclosure date with the reporter before sending.</Step><Step title="Confirm the advisory reaches admins">- Confirm the new advisory appears on the platform health page (`/platform/infrastructure/health`). Source feeds cache for 15 minutes, so allow that delay before troubleshooting.+ Confirm the new advisory appears on the platform health page (`/platform/health`). Source feeds cache for 15 minutes, so allow that delay before troubleshooting.<Note>Pending the security advisories panel reaching production. Until then, skip this step.diff --git a/docs/install/configure-operate/enterprise-license.mdx b/docs/install/configure-operate/enterprise-license.mdxindex 35520db8178..374f3d0e2af 100644--- a/docs/install/configure-operate/enterprise-license.mdx+++ b/docs/install/configure-operate/enterprise-license.mdx@@ -43,7 +43,7 @@ Your key activates whichever of these your plan includes.## How to activate a license key-Open **Platform Admin → Setup → Billing & subscription**, scroll to **Have a custom plan?**, and click **Activate license key**. Paste your key and save. No restart needed, and your flows and data stay as they are.+Open **Platform Admin → Account → Billing & subscription**, scroll to **Have a custom plan?**, and click **Activate license key**. Paste your key and save. No restart needed, and your flows and data stay as they are.<Frame><img src="/resources/screenshots/activation-license-key-settings.webp" alt="Activating a license key from Billing and subscription" />diff --git a/docs/install/configure-operate/telemetry.mdx b/docs/install/configure-operate/telemetry.mdxindex d937d47f806..e0acbfe3e85 100644--- a/docs/install/configure-operate/telemetry.mdx+++ b/docs/install/configure-operate/telemetry.mdx@@ -15,20 +15,20 @@ We have implemented a minimal tracking plan and provide a detailed list of the m# What Does Activepieces Collect?-We value transparency in data collection and assure you that we do not collect any personal information. The full list of events is in the app itself: go to **Platform → Infrastructure → Configurations** and open **See the events we track** under Product analytics. Alongside them we count page views inside the app.+We value transparency in data collection and assure you that we do not collect any personal information. The full list of events is in the app itself: go to **Platform Admin → Account → Configurations** and open **See the events we track** under Product analytics. Alongside them we count page views inside the app.[Exact Code](https://github.com/activepieces/activepieces/blob/main/packages/core/shared/src/lib/core/common/telemetry.ts)# Deployment setup-Licensed instances also send a daily snapshot of the *shape* of the deployment: how many app replicas and workers are running, their CPU / memory / disk sizes, their versions, worker configuration, the database / Redis / storage round-trips, the deployment settings shown on your diagnostics page (execution mode, storage location, sandbox memory limit, concurrency), and the release health check. It is the same information as **Platform → Infrastructure → Health**, and it carries no hostnames, no IP addresses, no storage endpoint, and nothing from your flows, your data or your connections.+Licensed instances also send a daily snapshot of the *shape* of the deployment: how many app replicas and workers are running, their CPU / memory / disk sizes, their versions, worker configuration, the database / Redis / storage round-trips, the deployment settings shown on your diagnostics page (execution mode, storage location, sandbox memory limit, concurrency), and the release health check. It is the same information as **Platform Admin → Operations → Health**, and it carries no hostnames, no IP addresses, no storage endpoint, and nothing from your flows, your data or your connections.We use it to answer support questions without asking you to gather diagnostics, and to see which deployment shapes a release is about to affect before we ship it.# Opting out?-Go to **Platform → Infrastructure → Configurations** and switch **Product analytics** off. The setting is stored per platform, so an instance hosting several platforms controls each one separately.+Go to **Platform Admin → Account → Configurations** and switch **Product analytics** off. The setting is stored per platform, so an instance hosting several platforms controls each one separately.**Deployment setup** is a separate switch in the same place, and is on by default. Unlike product analytics it does not read `AP_TELEMETRY_ENABLED` — switch it off in the UI to stop the daily snapshot.diff --git a/docs/install/configure-operate/worker-groups.mdx b/docs/install/configure-operate/worker-groups.mdxindex ab6b8d5d167..6bf8b79d8a2 100644--- a/docs/install/configure-operate/worker-groups.mdx+++ b/docs/install/configure-operate/worker-groups.mdx@@ -21,7 +21,7 @@ Use both together to guarantee capacity for busy projects and cap the rest.A worker joins a group by setting its group ID at startup. `AP_PROJECT_WORKER` selects the group's scope:-- **Project** group — leave `AP_PROJECT_WORKER=true` (the default). Assign individual projects to it from the platform's Workers → Assignments page.+- **Project** group — leave `AP_PROJECT_WORKER=true` (the default). Assign individual projects to it from **Platform Admin → Operations → Workers → Worker groups**.- **Platform** group — set `AP_PROJECT_WORKER=false`. Serves the whole platform's runs; used for dedicated/canary fleets.```bash@@ -49,7 +49,7 @@ Once a project is assigned to a group, its flow and webhook runs are routed to tYou can assign a project to a project group in two ways:-- **UI** — go to **Platform → Infrastructure → Workers** (`/platform/infrastructure/workers`), open the **Assignments** tab, and pick the group for each project.+- **UI** — go to **Platform admin → Operations → Workers → Worker groups** (`/platform/workers/groups`) and pick the group for each project.- **API** — set `workerGroupId` on the project via the projects API. Use the bare group name (the same value as the group's `AP_WORKER_GROUP_ID`); pass `null` to unassign and return the project to the shared queue.The same request also sets `maxConcurrentJobs` — the project's **concurrency limit** (the soft-cap ceiling). It's the maximum number of flow runs the project executes at once:diff --git a/docs/install/options/docker-compose.mdx b/docs/install/options/docker-compose.mdxindex db1bc1770c1..ba13b3d8127 100755--- a/docs/install/options/docker-compose.mdx+++ b/docs/install/options/docker-compose.mdx@@ -117,7 +117,7 @@ curl http://localhost:8080/api/v1/healthAll four containers should be `Up`, and the health endpoint should respond.-Then sign in and open **Platform Admin → Infrastructure → Workers**. You should see at least one worker. If the list is empty, see [Troubleshooting](#troubleshooting).+Then sign in and open **Platform Admin → Operations → Workers**. You should see at least one worker. If the list is empty, see [Troubleshooting](#troubleshooting).## What you've just set updiff --git a/docs/install/options/railway.mdx b/docs/install/options/railway.mdxindex 9e4c358c336..e61f2a4e604 100644--- a/docs/install/options/railway.mdx+++ b/docs/install/options/railway.mdx@@ -47,7 +47,7 @@ See the [Sandboxing](/install/architecture/sandboxing) documentation for details#### Other Important Variables-- `AP_TELEMETRY_ENABLED`: Starting value for product analytics (default: `true`). Each platform's setting is created from it on first read; change it afterwards at Platform → Infrastructure → Configurations.+- `AP_TELEMETRY_ENABLED`: Starting value for product analytics (default: `true`). Each platform's setting is created from it on first read; change it afterwards at Platform Admin → Account → Configurations.For a complete list of all available environment variables, see the [Environment Variables](/install/reference/environment-variables) documentation.diff --git a/docs/install/reference/environment-variables.mdx b/docs/install/reference/environment-variables.mdxindex 3d65b000982..1ed3106f421 100644--- a/docs/install/reference/environment-variables.mdx+++ b/docs/install/reference/environment-variables.mdx@@ -65,7 +65,7 @@ protect connections and tokens, and telemetry.| ❗ `AP_JWT_SECRET` | 32-character hexadecimal key used to sign JWT tokens. Generate one with `openssl rand -hex 32`. | `None` || `AP_CONFIG_PATH` | Path where the PGLite database and local settings are stored. | `~/.activepieces` || `AP_INTERNAL_URL` | (Beta) Internal URL used for SSO authentication, e.g. `https://demo.activepieces.com/api`. | `None` |-| `AP_TELEMETRY_ENABLED` | Starting value for product analytics. Each platform's setting is created from it on first read; after that, change it at Platform → Infrastructure → Configurations. | `true` |+| `AP_TELEMETRY_ENABLED` | Starting value for product analytics. Each platform's setting is created from it on first read; after that, change it at Platform Admin → Account → Configurations. | `true` |<Warning>`AP_FRONTEND_URL` is essential for webhooks and app triggers. It must bediff --git a/packages/core/shared/package.json b/packages/core/shared/package.jsonindex f047f5dcd0c..85f0c5826b7 100644--- a/packages/core/shared/package.json+++ b/packages/core/shared/package.json@@ -1,6 +1,6 @@{"name": "@activepieces/shared",- "version": "0.180.0",+ "version": "0.181.0","type": "commonjs","sideEffects": false,"main": "./dist/src/index.js",diff --git a/packages/core/shared/src/lib/core/common/telemetry.ts b/packages/core/shared/src/lib/core/common/telemetry.tsindex de495f92ef6..de456b1cbeb 100644--- a/packages/core/shared/src/lib/core/common/telemetry.ts+++ b/packages/core/shared/src/lib/core/common/telemetry.ts@@ -33,6 +33,11 @@ type OnboardingCompleted = {platformId: string}+type AdminNavLockedClicked = {+ path: string+ tier?: string+}+type PlanChange = {platformId: stringplan: string@@ -167,6 +172,7 @@ export enum TelemetryEventName {INVITE_SENT = 'invite.sent',INVITE_ACCEPTED = 'invite.accepted',SALES_HANDOFF_CLICKED = 'sales.handoff.clicked',+ ADMIN_NAV_LOCKED_CLICKED = 'admin.nav.locked.clicked',}export type TelemetryEvent =@@ -199,6 +205,7 @@ export type TelemetryEvent =| BaseTelemetryEvent<TelemetryEventName.INVITE_SENT, InviteSent>| BaseTelemetryEvent<TelemetryEventName.INVITE_ACCEPTED, InviteAccepted>| BaseTelemetryEvent<TelemetryEventName.SALES_HANDOFF_CLICKED, SalesHandoffClicked>+ | BaseTelemetryEvent<TelemetryEventName.ADMIN_NAV_LOCKED_CLICKED, AdminNavLockedClicked>export const CLOUD_ONLY_TELEMETRY_EVENTS: ReadonlySet<TelemetryEventName> = new Set([TelemetryEventName.ONBOARDING_COMPLETED,@@ -208,6 +215,7 @@ export const CLOUD_ONLY_TELEMETRY_EVENTS: ReadonlySet<TelemetryEventName> = newTelemetryEventName.PLAN_REACTIVATED,TelemetryEventName.TRIAL_STARTED,TelemetryEventName.SALES_HANDOFF_CLICKED,+ TelemetryEventName.ADMIN_NAV_LOCKED_CLICKED,TelemetryEventName.SIGNED_UP,TelemetryEventName.SIGNED_IN,TelemetryEventName.SIGN_UP_SUBMITTED,diff --git a/packages/server/api/test/unit/app/helper/telemetry-cloud-only-events.test.ts b/packages/server/api/test/unit/app/helper/telemetry-cloud-only-events.test.tsindex 594eebb3f5f..85872ebbc0b 100644--- a/packages/server/api/test/unit/app/helper/telemetry-cloud-only-events.test.ts+++ b/packages/server/api/test/unit/app/helper/telemetry-cloud-only-events.test.ts@@ -80,6 +80,7 @@ const CLOUD_ONLY_BILLING_AND_ONBOARDING_EVENTS: TelemetryEvent[] = [{ name: TelemetryEventName.PLAN_REACTIVATED, payload: { platformId: 'platform-1', plan: 'plus' } },{ name: TelemetryEventName.TRIAL_STARTED, payload: { platformId: 'platform-1', plan: 'plus', trialEndsAt: '2030-01-01T00:00:00.000Z' } },{ name: TelemetryEventName.SALES_HANDOFF_CLICKED, payload: { surface: 'plan-selector' } },+ { name: TelemetryEventName.ADMIN_NAV_LOCKED_CLICKED, payload: { path: '/platform/sso', tier: 'team' } },]const capturedEventNames = (): string[] => mockCapture.mock.calls.map(([message]) => message.event)diff --git a/packages/web/public/locales/en/translation.json b/packages/web/public/locales/en/translation.jsonindex 020c9857f83..a6d9e07c205 100644--- a/packages/web/public/locales/en/translation.json+++ b/packages/web/public/locales/en/translation.json@@ -3083,5 +3083,13 @@"billing": "billing","project roles": "project roles","infrastructure status": "infrastructure status",- "Plans, credits and usage tracking are part of the Enterprise and Cloud editions.": "Plans, credits and usage tracking are part of the Enterprise and Cloud editions."+ "Plans, credits and usage tracking are part of the Enterprise and Cloud editions.": "Plans, credits and usage tracking are part of the Enterprise and Cloud editions.",+ "Requires a plan upgrade": "Requires a plan upgrade",+ "Catalogue": "Catalogue",+ "Developers": "Developers",+ "Operations": "Operations",+ "Forward every audit event we emit to a webhook, then handle it in a flow.": "Forward every audit event we emit to a webhook, then handle it in a flow.",+ "Not included in your plan": "Not included in your plan",+ "Included in the {tier} plan": "Included in the {tier} plan",+ "Opened a paid admin page": "Opened a paid admin page"}diff --git a/packages/web/src/app/builder/pieces-selector/ai-tab-content/ai-actions-list.tsx b/packages/web/src/app/builder/pieces-selector/ai-tab-content/ai-actions-list.tsxindex 80b401c9ef8..e8b92bd1582 100644--- a/packages/web/src/app/builder/pieces-selector/ai-tab-content/ai-actions-list.tsx+++ b/packages/web/src/app/builder/pieces-selector/ai-tab-content/ai-actions-list.tsx@@ -83,7 +83,7 @@ export const AIPieceActionsList: React.FC<AIPieceActionsListProps> = ({action: {label: 'Set Up',onClick: () => {- navigate('/platform/setup/ai');+ navigate('/platform/ai');},},});diff --git a/packages/web/src/app/components/global-search/static-pages.ts b/packages/web/src/app/components/global-search/static-pages.tsindex e46f52582f7..2e13806d6f7 100644--- a/packages/web/src/app/components/global-search/static-pages.ts+++ b/packages/web/src/app/components/global-search/static-pages.ts@@ -74,112 +74,168 @@ export const STATIC_PAGES: StaticPage[] = [{id: 'page-platform-ai',label: 'Platform Admin — AI Center',- href: '/platform/setup/ai',+ href: '/platform/ai',icon: BotIcon,requiresPlatformAdmin: true,},+ {+ id: 'page-platform-ai-capabilities',+ label: 'Platform Admin — AI Capabilities',+ href: '/platform/ai/capabilities',+ icon: BotIcon,+ requiresPlatformAdmin: true,+ },+ {+ id: 'page-platform-mcp',+ label: 'Platform Admin — MCP Server',+ href: '/platform/mcp',+ icon: ConnectIcon,+ requiresPlatformAdmin: true,+ },+ {+ id: 'page-platform-mcp-tools',+ label: 'Platform Admin — MCP Tools',+ href: '/platform/mcp/tools',+ icon: ConnectIcon,+ requiresPlatformAdmin: true,+ },+ {+ id: 'page-platform-mcp-activity',+ label: 'Platform Admin — MCP Activity',+ href: '/platform/mcp/activity',+ icon: ConnectIcon,+ requiresPlatformAdmin: true,+ },{id: 'page-platform-branding',label: 'Platform Admin — General',- href: '/platform/setup/general',+ href: '/platform/general',icon: PaletteIcon,requiresPlatformAdmin: true,},{id: 'page-platform-connections',label: 'Platform Admin — Global Connections',- href: '/platform/setup/connections',+ href: '/platform/connections/global',icon: UnplugIcon,requiresPlatformAdmin: true,},{id: 'page-platform-pieces',label: 'Platform Admin — Pieces',- href: '/platform/setup/pieces',+ href: '/platform/pieces',+ icon: PuzzleIcon,+ requiresPlatformAdmin: true,+ },+ {+ id: 'page-platform-piece-sets',+ label: 'Platform Admin — Piece Sets',+ href: '/platform/pieces/piece-sets',icon: PuzzleIcon,requiresPlatformAdmin: true,},{id: 'page-platform-templates',label: 'Platform Admin — Templates',- href: '/platform/setup/templates',+ href: '/platform/templates',icon: LayoutGridIcon,requiresPlatformAdmin: true,},{id: 'page-platform-billing',label: 'Platform Admin — Billing',- href: '/platform/setup/billing',+ href: '/platform/billing',icon: ReceiptIcon,requiresPlatformAdmin: true,},{id: 'page-platform-embedding',label: 'Platform Admin — Embedding',- href: '/platform/security/embed',+ href: '/platform/embedding',icon: FrameIcon,requiresPlatformAdmin: true,},{id: 'page-platform-audit-logs',label: 'Platform Admin — Audit Logs',- href: '/platform/security/audit-logs',+ href: '/platform/audit-log',icon: SquareDashedBottomCodeIcon,requiresPlatformAdmin: true,},{id: 'page-platform-sso',label: 'Platform Admin — Single Sign On',- href: '/platform/security/sso',+ href: '/platform/sso',icon: LogInIcon,requiresPlatformAdmin: true,},{id: 'page-platform-project-roles',label: 'Platform Admin — Project Roles',- href: '/platform/security/project-roles',+ href: '/platform/users/roles',icon: Settings2Icon,requiresPlatformAdmin: true,},{id: 'page-platform-api-keys',label: 'Platform Admin — API Keys',- href: '/platform/security/api-keys',+ href: '/platform/api-keys',icon: FileJson2Icon,requiresPlatformAdmin: true,},{id: 'page-platform-secret-managers',label: 'Platform Admin — Secret Managers',- href: '/platform/security/secret-managers',+ href: '/platform/secret-managers',icon: KeyRoundIcon,requiresPlatformAdmin: true,},{id: 'page-platform-workers',label: 'Platform Admin — Workers',- href: '/platform/infrastructure/workers',+ href: '/platform/workers',+ icon: ServerIcon,+ requiresPlatformAdmin: true,+ },+ {+ id: 'page-platform-worker-groups',+ label: 'Platform Admin — Worker Groups',+ href: '/platform/workers/groups',icon: ServerIcon,requiresPlatformAdmin: true,},{id: 'page-platform-health',label: 'Platform Admin — Health',- href: '/platform/infrastructure/health',+ href: '/platform/health',+ icon: FileHeartIcon,+ requiresPlatformAdmin: true,+ },+ {+ id: 'page-platform-health-runs',+ label: 'Platform Admin — Runs Health',+ href: '/platform/health/runs',+ icon: FileHeartIcon,+ requiresPlatformAdmin: true,+ },+ {+ id: 'page-platform-health-queue',+ label: 'Platform Admin — Queue Health',+ href: '/platform/health/queue',icon: FileHeartIcon,requiresPlatformAdmin: true,},{id: 'page-platform-triggers',label: 'Platform Admin — Triggers',- href: '/platform/infrastructure/triggers',+ href: '/platform/triggers',icon: MousePointerClickIcon,requiresPlatformAdmin: true,},{id: 'page-platform-event-streaming',label: 'Platform Admin — Event Streaming',- href: '/platform/infrastructure/event-destinations',+ href: '/platform/audit-log/streaming',icon: WebhookIcon,requiresPlatformAdmin: true,},diff --git a/packages/web/src/app/components/platform-layout.tsx b/packages/web/src/app/components/platform-layout.tsxindex 5857e1a4e7e..ebcbb5d9209 100644--- a/packages/web/src/app/components/platform-layout.tsx+++ b/packages/web/src/app/components/platform-layout.tsx@@ -19,10 +19,10 @@ export function PlatformLayout({ children }: { children: React.ReactNode }) {<AllowOnlyLoggedInUserOnlyGuard><GlobalSearchProvider>{showPlatformAdminDashboard ? (- <SidebarProvider open={true}>+ <SidebarProvider open={true} style={PLATFORM_SIDEBAR_STYLE}><PlatformSidebar /><SidebarInset className="flex flex-col h-full overflow-hidden bg-sidebar">- <div className="flex-1 flex flex-col p-2 pt-3 pb-3 overflow-hidden">+ <div className="flex-1 flex flex-col pr-2 pt-3 pb-3 overflow-hidden"><divid="dashboard-content-container"className="relative flex flex-col h-full bg-background rounded-xl shadow-[2px_0px_4px_-2px_rgba(0,0,0,0.05),0px_2px_4px_-2px_rgba(0,0,0,0.05)] border overflow-clip"@@ -42,3 +42,9 @@ export function PlatformLayout({ children }: { children: React.ReactNode }) {</AllowOnlyLoggedInUserOnlyGuard>);}++const PLATFORM_SIDEBAR_STYLE: React.CSSProperties & {+ '--sidebar-width': string;+} = {+ '--sidebar-width': '16rem',+};diff --git a/packages/web/src/app/components/sidebar/ap-sidebar-item-utils.ts b/packages/web/src/app/components/sidebar/ap-sidebar-item-utils.tsnew file mode 100644index 00000000000..7ce7ea9c661--- /dev/null+++ b/packages/web/src/app/components/sidebar/ap-sidebar-item-utils.ts@@ -0,0 +1,10 @@+function sectionSearch(search: string): string {+ const params = new URLSearchParams(search);+ return new URLSearchParams(+ [...params].filter(([key]) => SECTION_SEARCH_KEYS.includes(key)),+ ).toString();+}++const SECTION_SEARCH_KEYS = ['month'];++export const sidebarItemUtils = { sectionSearch };diff --git a/packages/web/src/app/components/sidebar/ap-sidebar-item.tsx b/packages/web/src/app/components/sidebar/ap-sidebar-item.tsxindex bd67b348e8b..4d8cf31c668 100644--- a/packages/web/src/app/components/sidebar/ap-sidebar-item.tsx+++ b/packages/web/src/app/components/sidebar/ap-sidebar-item.tsx@@ -1,42 +1,70 @@-import { LockKeyhole } from 'lucide-react';+import { ApEdition, ApFlagId, TelemetryEventName } from '@activepieces/shared';+import { t } from 'i18next';+import { ChevronDown, ChevronRight, Crown } from 'lucide-react';import React, { ComponentType, useEffect, useRef, useState } from 'react';-import { useLocation, useNavigate } from 'react-router-dom';+import { Link, matchPath, useLocation } from 'react-router-dom';-import { Dot } from '@/components/custom/dot';+import { useTelemetry } from '@/components/providers/telemetry-provider';import {+ SidebarMenuAction,SidebarMenuButton,SidebarMenuItem,+ SidebarMenuSub,+ SidebarMenuSubButton,+ SidebarMenuSubItem,useSidebar,} from '@/components/ui/sidebar-shadcn';+import {+ Tooltip,+ TooltipContent,+ TooltipTrigger,+} from '@/components/ui/tooltip';+import { FeatureTier, TIER_LABELS } from '@/features/billing';+import { flagsHooks } from '@/hooks/flags-hooks';import { cn } from '@/lib/utils';-export type SidebarItemType = {- to: string;- label: string;- type: 'link';- icon?: ComponentType<{ className?: string }>;- notification?: boolean;- locked?: boolean;- newWindow?: boolean;- isActive?: (pathname: string) => boolean;- isSubItem?: boolean;- show?: boolean;- hasPermission?: boolean;- onClick?: () => void;- badge?: string;- iconClassName?: string;- highlight?: boolean;-};+import { sidebarItemUtils } from './ap-sidebar-item-utils';export const ApSidebarItem = (item: SidebarItemType) => {const location = useLocation();- const navigate = useNavigate();const { state } = useSidebar();+ const { capture } = useTelemetry();const iconRef = useRef<AnimatedIconHandle | null>(null);const [isHovered, setIsHovered] = useState(false);- const isLinkActive =- location.pathname.startsWith(item.to) || item.isActive?.(location.pathname);+ const pathname = location.pathname;+ const isLinkActive = isRouteActive({ pathname, to: item.to });const isCollapsed = state === 'collapsed';+ const subItems = item.subItems ?? [];+ const hasSubItems = subItems.length > 0;+ const [isExpanded, setIsExpanded] = useState(isLinkActive);+ const showSubItems = hasSubItems && isExpanded && !isCollapsed;+ const isSubItemLocked = (subItem: SidebarSubItemType) =>+ Boolean(item.locked) || Boolean(subItem.locked);+ const isCrowned = hasSubItems+ ? subItems.every(isSubItemLocked)+ : Boolean(item.locked);+ const isRowHighlighted = !hasSubItems && isLinkActive;+ const parentTier = item.tier ?? subItems.find(isSubItemLocked)?.tier;++ const captureLockedClick = ({ path, tier }: LockedClick) =>+ capture({+ name: TelemetryEventName.ADMIN_NAV_LOCKED_CLICKED,+ payload: { path, tier },+ });++ const keepSearchWithinSection = (to: string) => {+ if (!hasSubItems || !isLinkActive) {+ return to;+ }+ const shared = sidebarItemUtils.sectionSearch(location.search);+ return shared === '' ? to : `${to}?${shared}`;+ };++ useEffect(() => {+ if (isLinkActive) {+ setIsExpanded(true);+ }+ }, [isLinkActive]);useEffect(() => {if (isHovered) {@@ -48,54 +76,198 @@ export const ApSidebarItem = (item: SidebarItemType) => {const button = (<SidebarMenuButton- className={cn(- { 'bg-sidebar-accent hover:bg-sidebar-accent!': isLinkActive },- item.highlight && !isLinkActive && 'hover:bg-sidebar-accent/60',- )}- onClick={() => {- item.onClick?.();- navigate(item.to);- }}- onMouseEnter={() => setIsHovered(true)}- onMouseLeave={() => setIsHovered(false)}+ asChild+ className={cn('h-8 [&_svg]:block [&_svg]:size-5', {+ 'bg-sidebar-accent hover:bg-sidebar-accent!': isRowHighlighted,+ 'pr-8': hasSubItems && !isCollapsed,+ })}>- {item.icon && renderIcon(item.icon, iconRef, item.iconClassName)}- {!isCollapsed && (- <span className={cn('text-sm', { 'font-semibold': isLinkActive })}>- {item.label}- </span>- )}- {!isCollapsed && item.badge && (- <span className="ml-auto text-[10px] font-medium text-primary">- {item.badge}- </span>+ <Link+ to={keepSearchWithinSection(item.to)}+ aria-current={isRowHighlighted ? 'page' : undefined}+ onClick={() => {+ if (hasSubItems) {+ setIsExpanded(true);+ }+ if (+ isCrowned &&+ !isRouteActive({ pathname, to: item.to, end: true })+ ) {+ captureLockedClick({ path: item.to, tier: parentTier });+ }+ }}+ onMouseEnter={() => setIsHovered(true)}+ onMouseLeave={() => setIsHovered(false)}+ >+ {item.icon && renderIcon({ Icon: item.icon, ref: iconRef })}+ {!isCollapsed && (+ <span className="flex min-w-0 items-center gap-1.5">+ <span+ className={cn('truncate', { 'font-medium': isRowHighlighted })}+ >+ {item.label}+ </span>+ {isCrowned && <CrownMark />}+ </span>+ )}+ </Link>+ </SidebarMenuButton>+ );++ return (+ <SidebarMenuItem>+ {isCrowned && !isCollapsed ? (+ <LockedTooltip tier={parentTier}>{button}</LockedTooltip>+ ) : (+ button)}- {!isCollapsed && item.locked && !item.badge && (- <LockKeyhole className="size-3.5! ml-auto" />+ {!isCollapsed && hasSubItems && (+ <SidebarMenuAction+ className="right-1.5 text-sidebar-foreground/60"+ aria-label={isExpanded ? t('Collapse') : t('Expand')}+ aria-expanded={isExpanded}+ onClick={() => setIsExpanded((expanded) => !expanded)}+ >+ {isExpanded ? (+ <ChevronDown aria-hidden />+ ) : (+ <ChevronRight aria-hidden />+ )}+ </SidebarMenuAction>)}- {item.notification && !item.locked && (- <Dot- variant="destructive"- className="absolute right-1 top-2 transform -translate-y-1/2 size-2 rounded-full"- />+ {showSubItems && (+ <SidebarMenuSub className="mx-0 ml-7 border-0 px-0 py-1">+ {subItems.map((subItem) => {+ const shut = isSubItemLocked(subItem);+ const subItemActive = isRouteActive({+ pathname,+ to: subItem.to,+ end: subItem.end,+ });+ const subButton = (+ <SidebarMenuSubButton+ asChild+ isActive={subItemActive}+ className="h-8"+ >+ <Link+ to={keepSearchWithinSection(subItem.to)}+ aria-current={subItemActive ? 'page' : undefined}+ onClick={+ shut &&+ !isRouteActive({ pathname, to: subItem.to, end: true })+ ? () =>+ captureLockedClick({+ path: subItem.to,+ tier: subItem.tier,+ })+ : undefined+ }+ >+ <span className="flex min-w-0 items-center gap-1.5">+ <span className="truncate">{subItem.label}</span>+ {shut && !isCrowned && <CrownMark />}+ </span>+ </Link>+ </SidebarMenuSubButton>+ );+ return (+ <SidebarMenuSubItem key={subItem.to}>+ {shut && !isCrowned ? (+ <LockedTooltip tier={subItem.tier}>{subButton}</LockedTooltip>+ ) : (+ subButton+ )}+ </SidebarMenuSubItem>+ );+ })}+ </SidebarMenuSub>)}- </SidebarMenuButton>+ </SidebarMenuItem>);-- return <SidebarMenuItem>{button}</SidebarMenuItem>;};-function renderIcon(- Icon: ComponentType<{ className?: string }>,- ref: React.RefObject<AnimatedIconHandle | null>,- iconClassName?: string,-) {+function LockedTooltip({ tier, children }: LockedTooltipProps) {+ const { data: edition } = flagsHooks.useFlag<ApEdition>(ApFlagId.EDITION);+ const namedTier = edition === ApEdition.COMMUNITY ? undefined : tier;++ return (+ <Tooltip>+ <TooltipTrigger asChild>{children}</TooltipTrigger>+ <TooltipContent side="right" align="center">+ {namedTier === undefined+ ? t('Not included in your plan')+ : t('Included in the {tier} plan', { tier: TIER_LABELS[namedTier] })}+ </TooltipContent>+ </Tooltip>+ );+}++function CrownMark() {+ return (+ <>+ <Crown+ aria-hidden+ className="size-3.5! shrink-0 text-sidebar-foreground/50"+ />+ <span className="sr-only">{t('Requires a plan upgrade')}</span>+ </>+ );+}++function isRouteActive({+ pathname,+ to,+ end = false,+}: {+ pathname: string;+ to: string;+ end?: boolean;+}) {+ return matchPath({ path: to, end }, pathname) !== null;+}++function renderIcon({+ Icon,+ ref,+}: {+ Icon: ComponentType<{ className?: string }>;+ ref: React.RefObject<AnimatedIconHandle | null>;+}) {return React.createElement(Icon, {- className: cn('size-4 pointer-events-none', iconClassName),+ className: 'size-5 shrink-0 pointer-events-none',ref,} as { className: string });}+export type SidebarSubItemType = {+ to: string;+ label: string;+ end?: boolean;+ locked?: boolean;+ tier?: FeatureTier;+};++export type SidebarItemType = {+ to: string;+ label: string;+ type: 'link';+ icon?: ComponentType<{ className?: string }>;+ locked?: boolean;+ tier?: FeatureTier;+ subItems?: SidebarSubItemType[];+};++type LockedTooltipProps = {+ tier?: FeatureTier;+ children: React.ReactElement;+};++type LockedClick = {+ path: string;+ tier?: FeatureTier;+};+type AnimatedIconHandle = {startAnimation: () => void;stopAnimation: () => void;diff --git a/packages/web/src/app/components/sidebar/platform/index.tsx b/packages/web/src/app/components/sidebar/platform/index.tsxindex 4d96b291867..aad9d3f02a3 100644--- a/packages/web/src/app/components/sidebar/platform/index.tsx+++ b/packages/web/src/app/components/sidebar/platform/index.tsx@@ -1,14 +1,32 @@import { ApEdition, ApFlagId } from '@activepieces/shared';import { t } from 'i18next';-import { Fragment, useRef } from 'react';-import { Link, useLocation, useSearchParams } from 'react-router-dom';+import { useRef } from 'react';+import { Link } from 'react-router-dom';-import { adminPagesUtils } from '@/app/routes/platform/admin-pages';+import { McpSvg } from '@/assets/img/custom/mcp';+import { ChartLineIcon } from '@/components/icons/chart-line';import {ChevronLeftIcon,ChevronLeftIconHandle,} from '@/components/icons/chevron-left';+import { FileHeartIcon } from '@/components/icons/file-heart';+import { FileJson2Icon } from '@/components/icons/file-json2';+import { FrameIcon } from '@/components/icons/frame';+import { KeyRoundIcon } from '@/components/icons/key-round';+import { LayoutGridIcon } from '@/components/icons/layout-grid';+import { LogInIcon } from '@/components/icons/log-in';+import { MousePointerClickIcon } from '@/components/icons/mouse-pointer-click';+import { PuzzleIcon } from '@/components/icons/puzzle';+import { ReceiptIcon } from '@/components/icons/receipt';+import { ServerIcon } from '@/components/icons/server';+import { SettingsIcon } from '@/components/icons/settings';+import { Settings2Icon } from '@/components/icons/settings2';+import { SparklesIcon } from '@/components/icons/sparkles';+import { SquareDashedBottomCodeIcon } from '@/components/icons/square-dashed-bottom-code';+import { UnplugIcon } from '@/components/icons/unplug';+import { UsersIcon } from '@/components/icons/users';import { buttonVariants } from '@/components/ui/button';+import { ScrollArea } from '@/components/ui/scroll-area';import {Sidebar,SidebarContent,@@ -17,17 +35,18 @@ import {SidebarHeader,SidebarGroup,SidebarGroupContent,+ SidebarGroupLabel,} from '@/components/ui/sidebar-shadcn';+import { PLATFORM_FEATURES } from '@/features/billing';import { useAuthorization } from '@/hooks/authorization-hooks';import { flagsHooks } from '@/hooks/flags-hooks';import { platformHooks } from '@/hooks/platform-hooks';import { determineDefaultRoute } from '@/lib/route-utils';import { cn } from '@/lib/utils';+import { ApSidebarItem, SidebarItemType } from '../ap-sidebar-item';import { SidebarUser } from '../sidebar-user';-import { PlatformNavItem, PlatformNavSubItem } from './platform-nav-item';-export function PlatformSidebar() {const { platform } = platformHooks.useCurrentPlatform();const { data: edition } = flagsHooks.useFlag<ApEdition>(ApFlagId.EDITION);@@ -38,16 +57,237 @@ export function PlatformSidebar() {});const chevronRef = useRef<ChevronLeftIconHandle>(null);- const location = useLocation();- const context = { plan: platform.plan, edition };- const pages = adminPagesUtils.visibleNavPages(context);- const activeId = adminPagesUtils.activePageId(location.pathname);- const [searchParams] = useSearchParams();- const requestedTabId = searchParams.get('tab');+ const groups: { label: string; items: PlatformNavItem[] }[] = [+ {+ label: t('Platform'),+ items: [+ {+ to: '/platform/projects',+ label: t('Projects'),+ icon: LayoutGridIcon,+ },+ {+ to: '/platform/users',+ label: t('Users'),+ icon: UsersIcon,+ subItems: [+ { to: '/platform/users', label: t('Members'), end: true },+ {+ to: '/platform/users/roles',+ label: t('Project Roles'),+ locked: !platform.plan.projectRolesEnabled,+ tier: PLATFORM_FEATURES.projectRoles.tier,+ },+ ],+ },+ {+ to: '/platform/connections',+ label: t('Connections'),+ icon: UnplugIcon,+ subItems: [+ { to: '/platform/connections', label: t('All'), end: true },+ {+ to: '/platform/connections/global',+ label: t('Global Connections'),+ locked: !platform.plan.globalConnectionsEnabled,+ tier: PLATFORM_FEATURES.globalConnections.tier,+ },+ ],+ },+ ],+ },+ {+ label: t('Catalogue'),+ items: [+ {+ to: '/platform/pieces',+ label: t('Pieces'),+ icon: PuzzleIcon,+ subItems: [+ { to: '/platform/pieces', label: t('Pieces'), end: true },+ {+ to: '/platform/pieces/piece-sets',+ label: t('Piece Sets'),+ locked: !platform.plan.managePiecesEnabled,+ tier: PLATFORM_FEATURES.pieces.tier,+ },+ ],+ },+ {+ to: '/platform/templates',+ label: t('Templates'),+ icon: LayoutGridIcon,+ locked: !platform.plan.manageTemplatesEnabled,+ tier: PLATFORM_FEATURES.templates.tier,+ },+ {+ to: '/platform/ai',+ label: t('AI Center'),+ icon: SparklesIcon,+ subItems:+ edition === ApEdition.COMMUNITY+ ? undefined+ : [+ { to: '/platform/ai', label: t('Providers'), end: true },+ {+ to: '/platform/ai/capabilities',+ label: t('Capabilities'),+ },+ ],+ },+ ],+ },+ {+ label: t('Security'),+ items: [+ {+ to: '/platform/sso',+ label: t('Single Sign On'),+ icon: LogInIcon,+ locked: !platform.plan.ssoEnabled,+ tier: PLATFORM_FEATURES.sso.tier,+ },+ {+ to: '/platform/secret-managers',+ label: t('Secret Managers'),+ icon: KeyRoundIcon,+ locked: !platform.plan.secretManagersEnabled,+ tier: PLATFORM_FEATURES.secretManagers.tier,+ },+ {+ to: '/platform/audit-log',+ label: t('Audit Logs'),+ icon: SquareDashedBottomCodeIcon,+ subItems: [+ {+ to: '/platform/audit-log',+ label: t('Events'),+ end: true,+ locked: !platform.plan.auditLogEnabled,+ tier: PLATFORM_FEATURES.auditLogs.tier,+ },+ {+ to: '/platform/audit-log/streaming',+ label: t('Event Streaming'),+ locked: !platform.plan.eventStreamingEnabled,+ tier: PLATFORM_FEATURES.eventStreaming.tier,+ },+ ],+ },+ ],+ },+ {+ label: t('Developers'),+ items: [+ {+ to: '/platform/api-keys',+ label: t('API Keys'),+ icon: FileJson2Icon,+ locked: !platform.plan.apiKeysEnabled,+ tier: PLATFORM_FEATURES.apiKeys.tier,+ },+ {+ to: '/platform/embedding',+ label: t('Embedding'),+ icon: FrameIcon,+ locked: !platform.plan.embeddingEnabled,+ tier: PLATFORM_FEATURES.embedding.tier,+ },+ {+ to: '/platform/mcp',+ label: t('MCP Server'),+ icon: McpSvg,+ subItems: [+ { to: '/platform/mcp', label: t('Connection'), end: true },+ { to: '/platform/mcp/tools', label: t('Tools') },+ { to: '/platform/mcp/activity', label: t('Activity') },+ ],+ },+ ],+ },+ {+ label: t('Operations'),+ items: [+ {+ to: '/platform/workers',+ label: t('Workers'),+ icon: ServerIcon,+ subItems: [+ {+ to: '/platform/workers',+ label: t('Health'),+ end: true,+ },+ {+ to: '/platform/workers/groups',+ label: t('Worker groups'),+ locked: !platform.plan.workerGroupsEnabled,+ },+ ],+ },+ {+ to: '/platform/health',+ label: t('Health'),+ icon: FileHeartIcon,+ subItems: [+ {+ to: '/platform/health',+ label: t('System Health'),+ end: true,+ },+ {+ to: '/platform/health/runs',+ label: t('Runs Health'),+ },+ {+ to: '/platform/health/queue',+ label: t('Queue Health'),+ },+ ],+ },+ {+ to: '/platform/triggers',+ label: t('Triggers'),+ icon: MousePointerClickIcon,+ },+ ],+ },+ {+ label: t('Account'),+ items: [+ {+ to: '/platform/general',+ label: t('General'),+ icon: SettingsIcon,+ },+ {+ to: '/platform/billing',+ label: t('Billing & subscription'),+ icon: ReceiptIcon,+ locked: edition === ApEdition.COMMUNITY,+ },+ {+ to: '/platform/usage',+ label: t('Usage'),+ icon: ChartLineIcon,+ locked: edition === ApEdition.COMMUNITY,+ },+ ...(edition === ApEdition.CLOUD+ ? []+ : [+ {+ to: '/platform/configurations',+ label: t('Configurations'),+ icon: Settings2Icon,+ },+ ]),+ ],+ },+ ];return (<Sidebar className="border-r-0!">- <SidebarHeader className="pb-0">+ <SidebarHeader className="px-3 pb-0"><Linkto={defaultRoute}className={cn(@@ -61,52 +301,54 @@ export function PlatformSidebar() {<span className="truncate text-sm">{t('Back to app')}</span></Link></SidebarHeader>- <div className="flex-1 overflow-y-auto">- <SidebarContent className="gap-0">- <SidebarGroup className="cursor-default shrink-0">- <SidebarGroupContent>- <SidebarMenu>- {pages.map((page) => {- const tabs = adminPagesUtils.navTabs({ page, context });- const isActivePage = page.id === activeId;- const activeTabId = adminPagesUtils.activeTabId({- page,- context,- requested: requestedTabId,- });- return (- <Fragment key={page.id}>- <PlatformNavItem- to={page.path}- label={t(page.nav.label)}- icon={page.nav.icon}- active={- isActivePage &&- !tabs.some((tab) => tab.id === activeTabId)- }- crowned={adminPagesUtils.isCrowned({ page, context })}- />- {tabs.map((tab) => (- <PlatformNavSubItem- key={tab.id}- to={`${page.path}?tab=${tab.id}`}- label={t(tab.label)}- active={isActivePage && activeTabId === tab.id}- crowned={tab.isLocked?.(context) === true}- />- ))}- </Fragment>- );- })}- </SidebarMenu>- </SidebarGroupContent>- </SidebarGroup>- </SidebarContent>- </div>+ <SidebarContent className="gap-0 overflow-hidden">+ <ScrollArea+ type="hover"+ className="min-h-0 flex-1"+ scrollBarClassName="py-1 pr-0.5"+ showGradient+ gradientClassName="h-12"+ >+ {groups.map((group, idx) => (+ <SidebarGroup+ key={group.label}+ className={cn(+ 'cursor-default shrink-0 px-3 py-0',+ idx > 0 && 'mt-4',+ )}+ >+ <SidebarGroupLabel className="h-8 text-sm">+ {group.label}+ </SidebarGroupLabel>+ <SidebarGroupContent>+ <SidebarMenu>+ {group.items.map((item) => (+ <ApSidebarItem+ type="link"+ key={item.to}+ to={item.to}+ label={item.label}+ icon={item.icon}+ locked={item.locked}+ tier={item.tier}+ subItems={item.subItems}+ />+ ))}+ </SidebarMenu>+ </SidebarGroupContent>+ </SidebarGroup>+ ))}+ </ScrollArea>+ </SidebarContent>- <SidebarFooter className="pb-3">+ <SidebarFooter className="px-3 pb-3"><SidebarUser /></SidebarFooter></Sidebar>);}++type PlatformNavItem = Pick<+ SidebarItemType,+ 'to' | 'label' | 'icon' | 'locked' | 'tier' | 'subItems'+>;diff --git a/packages/web/src/app/components/sidebar/platform/platform-nav-item.tsx b/packages/web/src/app/components/sidebar/platform/platform-nav-item.tsxdeleted file mode 100644index 3956605081f..00000000000--- a/packages/web/src/app/components/sidebar/platform/platform-nav-item.tsx+++ /dev/null@@ -1,113 +0,0 @@-import { Crown } from 'lucide-react';-import React, { ComponentType, useEffect, useRef, useState } from 'react';-import { useNavigate } from 'react-router-dom';--import {- SidebarMenuButton,- SidebarMenuItem,-} from '@/components/ui/sidebar-shadcn';-import { cn } from '@/lib/utils';--export function PlatformNavItem({- to,- label,- icon,- active,- crowned,-}: PlatformNavItemProps) {- const navigate = useNavigate();- const iconRef = useRef<AnimatedIconHandle | null>(null);- const [isHovered, setIsHovered] = useState(false);-- useEffect(() => {- if (isHovered) {- iconRef.current?.startAnimation();- } else {- iconRef.current?.stopAnimation();- }- }, [isHovered]);-- return (- <SidebarMenuItem>- <SidebarMenuButton- className={cn('pr-1', {- 'bg-sidebar-accent hover:bg-sidebar-accent!': active,- })}- onClick={() => navigate(to)}- onMouseEnter={() => setIsHovered(true)}- onMouseLeave={() => setIsHovered(false)}- >- {icon !== undefined &&- React.createElement(icon, {- className: 'size-4 pointer-events-none',- ref: iconRef,- })}- <span- className={cn('flex-1 truncate text-sm', {- 'font-semibold': active,- })}- >- {label}- </span>- {crowned && <Crown className="size-3.5! shrink-0 text-primary" />}- </SidebarMenuButton>- </SidebarMenuItem>- );-}--export function PlatformNavSubItem({- to,- label,- active,- crowned,-}: PlatformNavSubItemProps) {- const navigate = useNavigate();-- return (- <SidebarMenuItem>- <div className="flex items-stretch">- <div className="ml-4 mr-1 w-px shrink-0 bg-sidebar-border" />- <SidebarMenuButton- className={cn('h-7 flex-1', {- 'bg-sidebar-accent hover:bg-sidebar-accent!': active,- })}- onClick={() => navigate(to)}- >- <span- className={cn('text-sm text-muted-foreground', {- 'font-medium text-foreground': active,- })}- >- {label}- </span>- {crowned && <Crown className="size-3! ml-auto text-primary" />}- </SidebarMenuButton>- </div>- </SidebarMenuItem>- );-}--export type AnimatedIconHandle = {- startAnimation: () => void;- stopAnimation: () => void;-};--export type AnimatedIconComponent = ComponentType<{- className?: string;- ref?: React.Ref<AnimatedIconHandle>;-}>;--export type PlatformNavItemProps = {- to: string;- label: string;- icon?: AnimatedIconComponent;- active: boolean;- crowned: boolean;-};--export type PlatformNavSubItemProps = {- to: string;- label: string;- active: boolean;- crowned: boolean;-};diff --git a/packages/web/src/app/routes/chat-with-ai/components/chat-empty-state.tsx b/packages/web/src/app/routes/chat-with-ai/components/chat-empty-state.tsxindex 306926545b6..25634d681b3 100644--- a/packages/web/src/app/routes/chat-with-ai/components/chat-empty-state.tsx+++ b/packages/web/src/app/routes/chat-with-ai/components/chat-empty-state.tsx@@ -109,7 +109,7 @@ export function SetupRequiredState() {)}</p></div>- <Button onClick={() => navigate('/platform/setup/ai')} className="gap-2">+ <Button onClick={() => navigate('/platform/ai')} className="gap-2"><Settings className="h-4 w-4" />{t('Go to AI Settings')}</Button>diff --git a/packages/web/src/app/routes/mcp-server/pieces/pieces-tab.tsx b/packages/web/src/app/routes/mcp-server/pieces/pieces-tab.tsxindex 85d41bbb5e0..5f39df65e2b 100644--- a/packages/web/src/app/routes/mcp-server/pieces/pieces-tab.tsx+++ b/packages/web/src/app/routes/mcp-server/pieces/pieces-tab.tsx@@ -32,7 +32,7 @@ import { ProjectPicker } from './project-picker';const RUN_ACTION_TOOL_NAME = 'ap_run_action';const COLLAPSED_ROW_LIMIT = 6;const COLLAPSED_ROW_HEIGHT = 50;-const PIECE_SETS_LIST_ROUTE = '/platform/setup/pieces?tab=piece-sets';+const PIECE_SETS_LIST_ROUTE = '/platform/pieces/piece-sets';const SEARCH_DEBOUNCE_MS = 300;export function PiecesTab({ projectId, onSelectProject }: PiecesTabProps) {@@ -260,7 +260,7 @@ function PieceSetBanner({ projectId }: { projectId: string | null }) {<Linkto={pieceSetId- ? `/platform/setup/pieces/piece-sets/${pieceSetId}`+ ? `/platform/pieces/piece-sets/${pieceSetId}`: PIECE_SETS_LIST_ROUTE}>diff --git a/packages/web/src/app/routes/platform-routes.tsx b/packages/web/src/app/routes/platform-routes.tsxindex 1f1b611364f..4e5a64ca219 100644--- a/packages/web/src/app/routes/platform-routes.tsx+++ b/packages/web/src/app/routes/platform-routes.tsx@@ -1,123 +1,557 @@-import { ApEdition, ApFlagId } from '@activepieces/shared';import React, { Suspense } from 'react';-import { Navigate, useSearchParams } from 'react-router-dom';+import { Navigate } from 'react-router-dom';-import { FeatureSample } from '@/app/components/feature-sample';import { PageTitle } from '@/app/components/page-title';import { RouteLoadingBar } from '@/components/custom/route-loading-bar';-import { flagsHooks } from '@/hooks/flags-hooks';-import { platformHooks } from '@/hooks/platform-hooks';+import { Error, Success } from '@/features/billing';import { PlatformLayout } from '../components/platform-layout';-import {- ADMIN_PAGES,- ADMIN_REDIRECTS,- AdminPage as AdminPageSpec,- adminPagesUtils,-} from './platform/admin-pages';+import { LegacyPathRedirect } from './platform/legacy-path-redirect';+import { LegacyTabRedirect } from './platform/legacy-tab-redirect';+import { PlanFeatureSample } from './platform/plan-feature-sample';++const SettingsBilling = React.lazy(() =>+ import('./platform/billing').then((m) => ({ default: m.BillingPlanTab })),+);+const SettingsUsage = React.lazy(() =>+ import('./platform/billing').then((m) => ({ default: m.BillingUsageTab })),+);+const EventDestinationsPage = React.lazy(+ () => import('./platform/infra/event-destinations'),+);+const SettingsHealthPage = React.lazy(() => import('./platform/infra/health'));+const PlatformConfigurationsPage = React.lazy(() =>+ import('./platform/infra/configurations').then((m) => ({+ default: m.ConfigurationsPage,+ })),+);+const TriggerHealthPage = React.lazy(() => import('./platform/infra/triggers'));+const SettingsWorkersPage = React.lazy(+ () => import('./platform/infra/workers'),+);+const ProjectsPage = React.lazy(() => import('./platform/projects'));+const ApiKeysPage = React.lazy(() =>+ import('./platform/security/api-keys').then((m) => ({+ default: m.ApiKeysPage,+ })),+);+const AuditLogsPage = React.lazy(+ () => import('./platform/security/audit-logs'),+);+const ProjectRolePage = React.lazy(() =>+ import('./platform/security/project-role').then((m) => ({+ default: m.ProjectRolePage,+ })),+);+const SecretManagersPage = React.lazy(+ () => import('./platform/security/secret-managers'),+);+const EmbedPage = React.lazy(() =>+ import('./platform/security/embed').then((m) => ({+ default: m.EmbedPage,+ })),+);+const SSOPage = React.lazy(() =>+ import('./platform/security/sso').then((m) => ({ default: m.SSOPage })),+);+const AIProvidersPage = React.lazy(() => import('./platform/setup/ai'));+const PlatformMcpPage = React.lazy(() => import('./platform/setup/mcp'));+const GeneralPage = React.lazy(() =>+ import('./platform/setup/general').then((m) => ({+ default: m.GeneralPage,+ })),+);+const GlobalConnectionsTable = React.lazy(() =>+ import('./platform/setup/connections').then((m) => ({+ default: m.GlobalConnectionsTable,+ })),+);+const PiecesListPage = React.lazy(() =>+ import('./platform/setup/pieces').then((m) => ({+ default: m.PiecesListTab,+ })),+);+const PieceSetsPage = React.lazy(() =>+ import('./platform/setup/pieces/piece-sets/piece-sets-tab').then((m) => ({+ default: m.PieceSetsTab,+ })),+);+const PieceSetDetailsPage = React.lazy(() =>+ import('./platform/setup/pieces/piece-sets/piece-set-details-page').then(+ (m) => ({ default: m.PieceSetDetailsPage }),+ ),+);+const PlatformTemplatesPage = React.lazy(() =>+ import('./platform/setup/templates').then((m) => ({+ default: m.PlatformTemplatesPage,+ })),+);+const UsersPage = React.lazy(() => import('./platform/users'));+const PlatformConnectionsPage = React.lazy(+ () => import('./platform/connections'),+);function SuspenseWrapper({ children }: { children: React.ReactNode }) {return <Suspense fallback={<RouteLoadingBar />}>{children}</Suspense>;}-function AdminRoute({ page }: { page: AdminPageSpec }) {- const { platform } = platformHooks.useCurrentPlatform();- const { data: edition } = flagsHooks.useFlag<ApEdition>(ApFlagId.EDITION);- const [searchParams] = useSearchParams();- const context = { plan: platform.plan, edition };-- const Page = page.component;- if (Page !== undefined) {- return (- <FeatureSample- locked={page.sample === true && page.nav?.isLocked?.(context) === true}- title={page.teaser?.title ?? page.nav?.label ?? page.title}- description={page.teaser?.description}- tier={page.teaser?.tier}- documentationUrl={page.teaser?.documentationUrl}- featureKey={page.teaser?.featureKey}- showContactSales={page.teaser?.showContactSales}- >- <SuspenseWrapper>- <Page />- </SuspenseWrapper>- </FeatureSample>- );- }-- const tabs = adminPagesUtils.visibleTabs({ page, context });- const requested = searchParams.get('tab');- const Overview = page.overview;- if (Overview !== undefined && requested === null) {- return (- <FeatureSample- locked={page.sample === true && page.nav?.isLocked?.(context) === true}- title={page.teaser?.title ?? page.nav?.label ?? page.title}- description={page.teaser?.description}- tier={page.teaser?.tier}- documentationUrl={page.teaser?.documentationUrl}- featureKey={page.teaser?.featureKey}- showContactSales={page.teaser?.showContactSales}- >- <SuspenseWrapper>- <Overview />- </SuspenseWrapper>- </FeatureSample>- );- }-- const requestedTab = tabs.find((tab) => tab.id === requested);- if (requested !== null && requestedTab === undefined) {- return <Navigate to={page.path} replace />;- }- const activeTab = requestedTab ?? tabs[0];- if (activeTab === undefined) {- return null;- }-- const TabContent = activeTab.component;- return (- <FeatureSample- locked={- activeTab.sample === true && activeTab.isLocked?.(context) === true- }- title={activeTab.teaser?.title ?? activeTab.label}- description={activeTab.teaser?.description}- tier={activeTab.teaser?.tier}- documentationUrl={activeTab.teaser?.documentationUrl}- featureKey={activeTab.teaser?.featureKey}- showContactSales={activeTab.teaser?.showContactSales}- >- <SuspenseWrapper>- <TabContent />- </SuspenseWrapper>- </FeatureSample>- );-}+const HEALTH_TAB_PATHS = { system: '', runs: 'runs', queue: 'queue' };+const WORKERS_TAB_PATHS = { health: '', 'worker-groups': 'groups' };+const AI_TAB_PATHS = { providers: '', capabilities: 'capabilities' };+const PIECES_TAB_PATHS = { pieces: '', 'piece-sets': 'piece-sets' };export const platformRoutes = [- ...ADMIN_PAGES.map((page) => ({- path: page.path,+ {+ path: '/platform',element: (<PlatformLayout>- <PageTitle title={page.title}>- <AdminRoute page={page} />+ <PageTitle title="Platform">+ <Navigate to="/platform/projects" /></PageTitle></PlatformLayout>),- })),- ...ADMIN_REDIRECTS.map(({ from, to, title, replace = true }) => ({- path: from,- element:- title === undefined ? (- <Navigate to={to} replace={replace} />- ) : (- <PlatformLayout>- <PageTitle title={title}>- <Navigate to={to} replace={replace} />- </PageTitle>- </PlatformLayout>- ),- })),+ },+ {+ path: '/platform/projects',+ element: (+ <PlatformLayout>+ <PageTitle title="Projects">+ <SuspenseWrapper>+ <ProjectsPage />+ </SuspenseWrapper>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/users',+ element: (+ <PlatformLayout>+ <PageTitle title="Users">+ <SuspenseWrapper>+ <UsersPage />+ </SuspenseWrapper>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/connections',+ element: (+ <PlatformLayout>+ <PageTitle title="Connections">+ <SuspenseWrapper>+ <PlatformConnectionsPage />+ </SuspenseWrapper>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/ai',+ element: (+ <PlatformLayout>+ <PageTitle title="AI Center">+ <LegacyTabRedirect basePath="/platform/ai" tabPaths={AI_TAB_PATHS}>+ <SuspenseWrapper>+ <AIProvidersPage section="providers" />+ </SuspenseWrapper>+ </LegacyTabRedirect>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/ai/capabilities',+ element: (+ <PlatformLayout>+ <PageTitle title="AI Capabilities">+ <LegacyTabRedirect basePath="/platform/ai" tabPaths={AI_TAB_PATHS}>+ <SuspenseWrapper>+ <AIProvidersPage section="capabilities" />+ </SuspenseWrapper>+ </LegacyTabRedirect>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/mcp',+ element: (+ <PlatformLayout>+ <PageTitle title="MCP Server">+ <SuspenseWrapper>+ <PlatformMcpPage section="connection" />+ </SuspenseWrapper>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/mcp/tools',+ element: (+ <PlatformLayout>+ <PageTitle title="MCP Tools">+ <SuspenseWrapper>+ <PlatformMcpPage section="tools" />+ </SuspenseWrapper>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/mcp/activity',+ element: (+ <PlatformLayout>+ <PageTitle title="MCP Activity">+ <SuspenseWrapper>+ <PlatformMcpPage section="activity" />+ </SuspenseWrapper>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/pieces',+ element: (+ <PlatformLayout>+ <PageTitle title="Pieces">+ <LegacyTabRedirect+ basePath="/platform/pieces"+ tabPaths={PIECES_TAB_PATHS}+ >+ <SuspenseWrapper>+ <PiecesListPage />+ </SuspenseWrapper>+ </LegacyTabRedirect>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/pieces/piece-sets',+ element: (+ <PlatformLayout>+ <PageTitle title="Piece Sets">+ <LegacyTabRedirect+ basePath="/platform/pieces"+ tabPaths={PIECES_TAB_PATHS}+ >+ <SuspenseWrapper>+ <PieceSetsPage />+ </SuspenseWrapper>+ </LegacyTabRedirect>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/pieces/piece-sets/:id',+ element: (+ <PlatformLayout>+ <PageTitle title="Piece Set">+ <SuspenseWrapper>+ <PieceSetDetailsPage />+ </SuspenseWrapper>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/connections/global',+ element: (+ <PlatformLayout>+ <PageTitle title="Global Connections">+ <PlanFeatureSample feature="globalConnections">+ <SuspenseWrapper>+ <GlobalConnectionsTable />+ </SuspenseWrapper>+ </PlanFeatureSample>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/templates',+ element: (+ <PlatformLayout>+ <PageTitle title="Templates">+ <PlanFeatureSample feature="templates">+ <SuspenseWrapper>+ <PlatformTemplatesPage />+ </SuspenseWrapper>+ </PlanFeatureSample>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/general',+ element: (+ <PlatformLayout>+ <PageTitle title="General">+ <SuspenseWrapper>+ <GeneralPage />+ </SuspenseWrapper>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/billing',+ element: (+ <PlatformLayout>+ <PageTitle title="Billing">+ <SuspenseWrapper>+ <SettingsBilling />+ </SuspenseWrapper>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/usage',+ element: (+ <PlatformLayout>+ <PageTitle title="Usage">+ <SuspenseWrapper>+ <SettingsUsage />+ </SuspenseWrapper>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/billing/success',+ element: (+ <PlatformLayout>+ <PageTitle title="Billing">+ <Success />+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/billing/error',+ element: (+ <PlatformLayout>+ <PageTitle title="Billing">+ <Error />+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/api-keys',+ element: (+ <PlatformLayout>+ <PageTitle title="API Keys">+ <PlanFeatureSample feature="apiKeys">+ <SuspenseWrapper>+ <ApiKeysPage />+ </SuspenseWrapper>+ </PlanFeatureSample>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/secret-managers',+ element: (+ <PlatformLayout>+ <PageTitle title="Secret managers">+ <PlanFeatureSample feature="secretManagers">+ <SuspenseWrapper>+ <SecretManagersPage />+ </SuspenseWrapper>+ </PlanFeatureSample>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/audit-log',+ element: (+ <PlatformLayout>+ <PageTitle title="Audit Logs">+ <PlanFeatureSample feature="auditLogs">+ <SuspenseWrapper>+ <AuditLogsPage />+ </SuspenseWrapper>+ </PlanFeatureSample>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/embedding',+ element: (+ <PlatformLayout>+ <PageTitle title="Embedding">+ <PlanFeatureSample feature="embedding">+ <SuspenseWrapper>+ <EmbedPage />+ </SuspenseWrapper>+ </PlanFeatureSample>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/sso',+ element: (+ <PlatformLayout>+ <PageTitle title="SSO">+ <PlanFeatureSample feature="sso">+ <SuspenseWrapper>+ <SSOPage />+ </SuspenseWrapper>+ </PlanFeatureSample>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/users/roles',+ element: (+ <PlatformLayout>+ <PageTitle title="Project Roles">+ <PlanFeatureSample feature="projectRoles">+ <SuspenseWrapper>+ <ProjectRolePage />+ </SuspenseWrapper>+ </PlanFeatureSample>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/workers',+ element: (+ <PlatformLayout>+ <PageTitle title="Workers">+ <LegacyTabRedirect+ basePath="/platform/workers"+ tabPaths={WORKERS_TAB_PATHS}+ >+ <SuspenseWrapper>+ <SettingsWorkersPage section="health" />+ </SuspenseWrapper>+ </LegacyTabRedirect>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/workers/groups',+ element: (+ <PlatformLayout>+ <PageTitle title="Worker Groups">+ <LegacyTabRedirect+ basePath="/platform/workers"+ tabPaths={WORKERS_TAB_PATHS}+ >+ <SuspenseWrapper>+ <SettingsWorkersPage section="worker-groups" />+ </SuspenseWrapper>+ </LegacyTabRedirect>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/health',+ element: (+ <PlatformLayout>+ <PageTitle title="Health">+ <LegacyTabRedirect+ basePath="/platform/health"+ tabPaths={HEALTH_TAB_PATHS}+ >+ <SuspenseWrapper>+ <SettingsHealthPage section="system" />+ </SuspenseWrapper>+ </LegacyTabRedirect>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/health/runs',+ element: (+ <PlatformLayout>+ <PageTitle title="Runs Health">+ <LegacyTabRedirect+ basePath="/platform/health"+ tabPaths={HEALTH_TAB_PATHS}+ >+ <SuspenseWrapper>+ <SettingsHealthPage section="runs" />+ </SuspenseWrapper>+ </LegacyTabRedirect>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/health/queue',+ element: (+ <PlatformLayout>+ <PageTitle title="Queue Health">+ <LegacyTabRedirect+ basePath="/platform/health"+ tabPaths={HEALTH_TAB_PATHS}+ >+ <SuspenseWrapper>+ <SettingsHealthPage section="queue" />+ </SuspenseWrapper>+ </LegacyTabRedirect>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/configurations',+ element: (+ <PlatformLayout>+ <PageTitle title="Configurations">+ <SuspenseWrapper>+ <PlatformConfigurationsPage />+ </SuspenseWrapper>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/triggers',+ element: (+ <PlatformLayout>+ <PageTitle title="Trigger Health">+ <SuspenseWrapper>+ <TriggerHealthPage />+ </SuspenseWrapper>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ {+ path: '/platform/audit-log/streaming',+ element: (+ <PlatformLayout>+ <PageTitle title="Event Streaming">+ <PlanFeatureSample feature="eventStreaming">+ <SuspenseWrapper>+ <EventDestinationsPage />+ </SuspenseWrapper>+ </PlanFeatureSample>+ </PageTitle>+ </PlatformLayout>+ ),+ },+ ...[+ '/platform/setup/*',+ '/platform/security/*',+ '/platform/infrastructure/*',+ ].map((path) => ({ path, element: <LegacyPathRedirect /> })),];diff --git a/packages/web/src/app/routes/platform/admin-pages.ts b/packages/web/src/app/routes/platform/admin-pages.tsdeleted file mode 100644index bfe653a070f..00000000000--- a/packages/web/src/app/routes/platform/admin-pages.ts+++ /dev/null@@ -1,632 +0,0 @@-import { ApEdition, PlatformWithoutSensitiveData } from '@activepieces/shared';-import React, { ComponentType } from 'react';--import { FeatureTeaserProps } from '@/app/components/feature-teaser';-import { FrameIcon } from '@/components/icons/frame';-import { LayoutGridIcon } from '@/components/icons/layout-grid';-import { PuzzleIcon } from '@/components/icons/puzzle';-import { ReceiptIcon } from '@/components/icons/receipt';-import { ServerIcon } from '@/components/icons/server';-import { SettingsIcon } from '@/components/icons/settings';-import { ShieldIcon } from '@/components/icons/shield';-import { SparklesIcon } from '@/components/icons/sparkles';-import { UnplugIcon } from '@/components/icons/unplug';-import { UsersIcon } from '@/components/icons/users';-import { Error as BillingError, Success } from '@/features/billing';--const UsersOverview = React.lazy(() =>- import('./overview/users-overview').then((m) => ({- default: m.UsersOverview,- })),-);-const ConnectionsOverview = React.lazy(() =>- import('./overview/connections-overview').then((m) => ({- default: m.ConnectionsOverview,- })),-);-const AiOverview = React.lazy(() =>- import('./overview/ai-overview').then((m) => ({ default: m.AiOverview })),-);-const SecurityOverview = React.lazy(() =>- import('./overview/security-overview').then((m) => ({- default: m.SecurityOverview,- })),-);-const BillingOverview = React.lazy(() =>- import('./overview/billing-overview').then((m) => ({- default: m.BillingOverview,- })),-);-const InfrastructureOverview = React.lazy(() =>- import('./overview/infrastructure-overview').then((m) => ({- default: m.InfrastructureOverview,- })),-);-const ProjectsPage = React.lazy(() => import('./projects'));-const UsersPage = React.lazy(() => import('./users'));-const PlatformConnectionsPage = React.lazy(() => import('./connections'));-const GeneralPage = React.lazy(() =>- import('./setup/general').then((m) => ({ default: m.GeneralPage })),-);-const ProvidersTab = React.lazy(() =>- import('./setup/ai/providers-tab').then((m) => ({ default: m.ProvidersTab })),-);-const CapabilitiesTab = React.lazy(() =>- import('./setup/ai/capabilities-tab').then((m) => ({- default: m.CapabilitiesTab,- })),-);-const PlatformMcpPage = React.lazy(() => import('./setup/mcp'));-const GlobalConnectionsTable = React.lazy(() =>- import('./setup/connections').then((m) => ({- default: m.GlobalConnectionsTable,- })),-);-const PiecesListTab = React.lazy(() =>- import('./setup/pieces').then((m) => ({ default: m.PiecesListTab })),-);-const PieceSetsTab = React.lazy(() =>- import('./setup/pieces/piece-sets/piece-sets-tab').then((m) => ({- default: m.PieceSetsTab,- })),-);-const PieceSetDetailsPage = React.lazy(() =>- import('./setup/pieces/piece-sets/piece-set-details-page').then((m) => ({- default: m.PieceSetDetailsPage,- })),-);-const PlatformTemplatesPage = React.lazy(() =>- import('./setup/templates').then((m) => ({- default: m.PlatformTemplatesPage,- })),-);-const BillingPlanTab = React.lazy(() =>- import('./billing').then((m) => ({ default: m.BillingPlanTab })),-);-const BillingUsageTab = React.lazy(() =>- import('./billing').then((m) => ({ default: m.BillingUsageTab })),-);-const SSOPage = React.lazy(() =>- import('./security/sso').then((m) => ({ default: m.SSOPage })),-);-const ProjectRolePage = React.lazy(() =>- import('./security/project-role').then((m) => ({- default: m.ProjectRolePage,- })),-);-const ApiKeysPage = React.lazy(() =>- import('./security/api-keys').then((m) => ({ default: m.ApiKeysPage })),-);-const SecretManagersPage = React.lazy(- () => import('./security/secret-managers'),-);-const AuditLogsPage = React.lazy(() => import('./security/audit-logs'));-const EmbedPage = React.lazy(() =>- import('./security/embed').then((m) => ({ default: m.EmbedPage })),-);-const SettingsWorkersPage = React.lazy(() => import('./infra/workers'));-const SettingsHealthPage = React.lazy(() => import('./infra/health'));-const ConfigurationsPage = React.lazy(() =>- import('./infra/configurations').then((m) => ({- default: m.ConfigurationsPage,- })),-);-const TriggerHealthPage = React.lazy(() => import('./infra/triggers'));-const EventDestinationsPage = React.lazy(- () => import('./infra/event-destinations'),-);--function isCommunity({ edition }: AdminPageContext) {- return edition === ApEdition.COMMUNITY;-}--function hasNav(page: AdminPage): page is AdminNavPage {- return page.nav !== undefined;-}--function visibleNavPages(context: AdminPageContext) {- return ADMIN_PAGES.filter(hasNav).filter(- (page) => page.nav.isHidden?.(context) !== true,- );-}--function visibleTabs({ page, context }: PageInContext) {- return (page.tabs ?? []).filter((tab) => tab.isHidden?.(context) !== true);-}--function navTabs({ page, context }: PageInContext) {- return visibleTabs({ page, context }).filter((tab) => tab.hideInNav !== true);-}--function activeTabId({- page,- context,- requested,-}: PageInContext & { requested: string | null }) {- if (requested !== null) {- return requested;- }- if (page.overview !== undefined) {- return null;- }- return visibleTabs({ page, context })[0]?.id ?? null;-}--function isCrowned({- page,- context,-}: {- page: AdminNavPage;- context: AdminPageContext;-}) {- if (page.nav.isLocked?.(context) === true) {- return true;- }- const tabs = visibleTabs({ page, context });- return (- tabs.length > 0 && tabs.every((tab) => tab.isLocked?.(context) === true)- );-}--function activePageId(pathname: string) {- const matches = ADMIN_PAGES.filter(- (page) => pathname === page.path || pathname.startsWith(page.path + '/'),- );- const best = matches.reduce<AdminPage | undefined>(- (longest, page) =>- longest === undefined || page.path.length > longest.path.length- ? page- : longest,- undefined,- );- return best?.id;-}--export const adminPagesUtils = {- visibleNavPages,- visibleTabs,- navTabs,- activeTabId,- isCrowned,- activePageId,-};--export const ADMIN_PAGES: AdminPage[] = [- {- id: 'general',- path: '/platform/setup/general',- title: 'General',- component: GeneralPage,- nav: { label: 'General', icon: SettingsIcon },- },- {- id: 'projects',- path: '/platform/projects',- title: 'Projects',- component: ProjectsPage,- nav: {- label: 'Projects',- icon: LayoutGridIcon,- },- },- {- id: 'users',- path: '/platform/users',- title: 'Users & access',- overview: UsersOverview,- nav: { label: 'Users & access', icon: UsersIcon },- tabs: [- { id: 'members', label: 'Members', component: UsersPage },- {- id: 'sso',- label: 'Single sign on',- component: SSOPage,- isLocked: ({ plan }) => !plan.ssoEnabled,- sample: true,- teaser: {- featureKey: 'SSO',- title: 'Enable Single Sign On',- description:- 'Let your users sign in with your current SSO provider or give them self serve sign up access',- tier: 'team',- bullets: [- 'Works with SAML and OIDC providers',- 'Enforce SSO for everyone on the platform',- 'Control who can self-serve sign up',- ],- },- },- {- id: 'roles',- label: 'Project roles',- component: ProjectRolePage,- isLocked: ({ plan }) => !plan.projectRolesEnabled,- sample: true,- teaser: {- featureKey: 'CUSTOM_ROLES',- title: 'Project Role Management',- description:- 'Define custom roles and permissions to control what your team members can access and modify',- tier: 'team',- bullets: [- 'Scope access per project, not per platform',- 'Keep production flows safe from accidental edits',- 'Assign roles when you invite someone',- ],- },- },- ],- },- {- id: 'connections',- path: '/platform/connections',- title: 'Connections',- overview: ConnectionsOverview,- nav: { label: 'Connections', icon: UnplugIcon },- tabs: [- {- id: 'project',- label: 'Project connections',- component: PlatformConnectionsPage,- },- {- id: 'global',- label: 'Global connections',- component: GlobalConnectionsTable,- isLocked: ({ plan }) => !plan.globalConnectionsEnabled,- sample: true,- teaser: {- featureKey: 'GLOBAL_CONNECTIONS',- title: 'Enable Global Connections',- description: 'Manage platform-wide connections to external systems.',- tier: 'team',- bullets: [- 'Create once, use in any project',- 'Rotate credentials in a single place',- 'Choose which projects can use each connection',- ],- },- },- ],- },- {- id: 'ai',- path: '/platform/setup/ai',- title: 'AI Center & MCP',- overview: AiOverview,- nav: { label: 'AI Center & MCP', icon: SparklesIcon },- tabs: [- { id: 'providers', label: 'Providers', component: ProvidersTab },- {- id: 'capabilities',- label: 'Capabilities',- component: CapabilitiesTab,- isHidden: ({ edition }) => edition === ApEdition.COMMUNITY,- },- {- id: 'mcp',- label: 'MCP Server',- component: PlatformMcpPage,- },- ],- },- {- id: 'pieces',- path: '/platform/setup/pieces',- title: 'Pieces',- nav: {- label: 'Pieces',- icon: PuzzleIcon,- },- tabs: [- {- id: 'pieces',- label: 'Pieces',- component: PiecesListTab,- hideInNav: true,- },- {- id: 'piece-sets',- label: 'Piece Sets',- component: PieceSetsTab,- isLocked: ({ plan }) => !plan.managePiecesEnabled,- },- ],- },- {- id: 'templates',- sample: true,- teaser: {- featureKey: 'TEMPLATES',- title: 'Unlock Templates',- description:- 'Convert the most common automations into reusable templates 1 click away from your users',- tier: 'enterprise',- },- path: '/platform/setup/templates',- title: 'Templates',- component: PlatformTemplatesPage,- nav: {- label: 'Templates',- icon: LayoutGridIcon,- isLocked: ({ plan }) => !plan.manageTemplatesEnabled,- },- },- {- id: 'embed',- sample: true,- teaser: {- featureKey: 'SIGNING_KEYS',- title: 'Unlock Embedding Through JS SDK',- description: 'Enable signing keys to access embedding functionalities.',- tier: 'enterprise',- },- path: '/platform/security/embed',- title: 'Embedding',- component: EmbedPage,- nav: {- label: 'Embedding',- icon: FrameIcon,- isLocked: ({ plan }) => !plan.embeddingEnabled,- },- },- {- id: 'security',- path: '/platform/security',- title: 'Security',- overview: SecurityOverview,- nav: {- label: 'Security',- icon: ShieldIcon,- },- tabs: [- {- id: 'api-keys',- label: 'API keys',- component: ApiKeysPage,- isLocked: ({ plan }) => !plan.apiKeysEnabled,- sample: true,- teaser: {- featureKey: 'API',- title: 'Enable API Keys',- description:- 'Create and manage API keys to access Activepieces APIs.',- tier: 'team',- bullets: [- 'Drive projects, flows and connections from your own tooling',- 'Scope a key to the platform, not to a person',- 'Revoke a key without touching anyone\u2019s login',- ],- },- },- {- id: 'secrets',- label: 'Secret managers',- component: SecretManagersPage,- isLocked: ({ plan }) => !plan.secretManagersEnabled,- sample: true,- teaser: {- featureKey: 'SECRET_MANAGERS',- title: 'Enable Secret Managers',- description: 'Manage your secrets from a single and secure place',- tier: 'enterprise',- bullets: [- 'AWS, Azure, GCP and HashiCorp Vault',- 'Secrets never leave your infrastructure',- 'One secure place to rotate everything',- ],- },- },- {- id: 'audit',- label: 'Audit logs',- component: AuditLogsPage,- isLocked: ({ plan }) => !plan.auditLogEnabled,- sample: true,- teaser: {- featureKey: 'AUDIT_LOGS',- title: 'Unlock Audit Logs',- description:- 'Comply with internal and external security policies by tracking activities done within your account',- tier: 'enterprise',- bullets: [- 'Every user and system action, recorded',- 'Filter by user, project and event type',- 'Export for compliance reviews',- ],- },- },- {- id: 'events',- label: 'Event streaming',- component: EventDestinationsPage,- isLocked: ({ plan }) => !plan.eventStreamingEnabled,- sample: true,- teaser: {- featureKey: 'EVENT_DESTINATIONS',- title: 'Unlock Event Streaming',- description:- 'Forward every audit event we emit to a webhook, then handle it in a flow.',- tier: 'enterprise',- bullets: [- 'Stream events to any endpoint',- 'Wire alerts into Slack, PagerDuty or email',- 'Build your own monitoring on top',- ],- },- },- ],- },- {- id: 'billing',- sample: true,- teaser: {- featureKey: 'BILLING',- showContactSales: false,- title: 'Billing & usage',- description:- 'Plans, credits and usage tracking are part of the Enterprise and Cloud editions.',- },- path: '/platform/setup/billing',- title: 'Billing & usage',- overview: BillingOverview,- nav: {- label: 'Billing & usage',- icon: ReceiptIcon,- isLocked: isCommunity,- },- tabs: [- { id: 'plan', label: 'Plan', component: BillingPlanTab },- { id: 'usage', label: 'Usage', component: BillingUsageTab },- ],- },- {- id: 'infrastructure',- path: '/platform/infrastructure',- title: 'Infrastructure',- overview: InfrastructureOverview,- nav: { label: 'Infrastructure', icon: ServerIcon },- tabs: [- { id: 'health', label: 'Health', component: SettingsHealthPage },- { id: 'workers', label: 'Workers', component: SettingsWorkersPage },- { id: 'triggers', label: 'Triggers', component: TriggerHealthPage },- {- id: 'configurations',- label: 'Configurations',- component: ConfigurationsPage,- isHidden: ({ edition }) => edition === ApEdition.CLOUD,- },- ],- },- {- id: 'piece-set-details',- path: '/platform/setup/pieces/piece-sets/:id',- title: 'Piece Set',- component: PieceSetDetailsPage,- },- {- id: 'billing-success',- path: '/platform/setup/billing/success',- title: 'Billing',- component: Success,- },- {- id: 'billing-error',- path: '/platform/setup/billing/error',- title: 'Billing',- component: BillingError,- },-];--export const ADMIN_REDIRECTS: AdminRedirect[] = [- {- from: '/platform',- to: '/platform/projects',- title: 'Platform',- replace: false,- },- {- from: '/platform/setup',- to: '/platform/setup/ai',- title: 'Platform Setup',- },- {- from: '/platform/setup/ai-capabilities',- to: '/platform/setup/ai?tab=capabilities',- },- {- from: '/platform/setup/usage',- to: '/platform/setup/billing?tab=usage',- },- {- from: '/platform/setup/branding',- to: '/platform/setup/general',- },- { from: '/platform/setup/mcp', to: '/platform/setup/ai?tab=mcp' },- {- from: '/platform/security/api-keys',- to: '/platform/security?tab=api-keys',- },- { from: '/platform/security/sso', to: '/platform/users?tab=sso' },- { from: '/platform/security/project-roles', to: '/platform/users?tab=roles' },- {- from: '/platform/setup/connections',- to: '/platform/connections?tab=global',- },- {- from: '/platform/security/secret-managers',- to: '/platform/security?tab=secrets',- },- { from: '/platform/security/audit-logs', to: '/platform/security?tab=audit' },- {- from: '/platform/infrastructure/event-destinations',- to: '/platform/security?tab=events',- },- {- from: '/platform/infrastructure/workers',- to: '/platform/infrastructure?tab=workers',- },- {- from: '/platform/infrastructure/health',- to: '/platform/infrastructure?tab=health',- },- {- from: '/platform/infrastructure/triggers',- to: '/platform/infrastructure?tab=triggers',- },- {- from: '/platform/infrastructure/configurations',- to: '/platform/infrastructure?tab=configurations',- },-];--type PageInContext = {- page: AdminPage;- context: AdminPageContext;-};--export type AdminPageContext = {- plan: PlatformWithoutSensitiveData['plan'];- edition: ApEdition | null;-};--export type AdminPageNav = {- label: string;- icon?: ComponentType<{ className?: string }>;- isLocked?: (context: AdminPageContext) => boolean;- isHidden?: (context: AdminPageContext) => boolean;-};--export type AdminPageTabSpec = {- id: string;- label: string;- component: ComponentType;- isLocked?: (context: AdminPageContext) => boolean;- isHidden?: (context: AdminPageContext) => boolean;- hideInNav?: boolean;- teaser?: FeatureTeaserProps;- sample?: boolean;-};--export type AdminPage = {- id: string;- path: string;- title: string;- component?: ComponentType;- overview?: ComponentType;- tabs?: AdminPageTabSpec[];- nav?: AdminPageNav;- sample?: boolean;- teaser?: FeatureTeaserProps;-};--export const VIEW_QUERY_PARAM = 'view';--export type AdminNavPage = AdminPage & { nav: AdminPageNav };--export type AdminRedirect = {- from: string;- to: string;- title?: string;- replace?: boolean;-};diff --git a/packages/web/src/app/routes/platform/infra/configurations/index.tsx b/packages/web/src/app/routes/platform/infra/configurations/index.tsxindex 1679d059559..b4f5af35066 100644--- a/packages/web/src/app/routes/platform/infra/configurations/index.tsx+++ b/packages/web/src/app/routes/platform/infra/configurations/index.tsx@@ -31,7 +31,7 @@ export const ConfigurationsPage = () => {});if (edition === ApEdition.CLOUD) {- return <Navigate to="/platform/infrastructure/workers" replace />;+ return <Navigate to="/platform/workers" replace />;}if (isLoading || isNil(configuration)) {diff --git a/packages/web/src/app/routes/platform/infra/configurations/tracked-events-catalog.ts b/packages/web/src/app/routes/platform/infra/configurations/tracked-events-catalog.tsindex 92fce54d31d..6de0d395504 100644--- a/packages/web/src/app/routes/platform/infra/configurations/tracked-events-catalog.ts+++ b/packages/web/src/app/routes/platform/infra/configurations/tracked-events-catalog.ts@@ -129,6 +129,10 @@ const buildEventLabels = (): Record<TelemetryEventName, TrackedEvent> => ({group: 'billing',label: t('Contacted sales'),},+ [TelemetryEventName.ADMIN_NAV_LOCKED_CLICKED]: {+ group: 'billing',+ label: t('Opened a paid admin page'),+ },});const buildGroups = (): TrackedEventGroup[] => {diff --git a/packages/web/src/app/routes/platform/infra/health/index.tsx b/packages/web/src/app/routes/platform/infra/health/index.tsxindex a43965bbfd9..fdbda533f10 100644--- a/packages/web/src/app/routes/platform/infra/health/index.tsx+++ b/packages/web/src/app/routes/platform/infra/health/index.tsx@@ -1,11 +1,10 @@import dayjs from 'dayjs';import { t } from 'i18next';-import { Activity, Calendar, HeartPulse, LineChart } from 'lucide-react';+import { Calendar } from 'lucide-react';import React from 'react';-import { useSearchParams } from 'react-router-dom';+import { useNavigate, useSearchParams } from 'react-router-dom';import { DashboardPageHeader } from '@/app/components/dashboard-page-header';-import { VIEW_QUERY_PARAM } from '@/app/routes/platform/admin-pages';import {Select,SelectContent,@@ -13,15 +12,12 @@ import {SelectTrigger,SelectValue,} from '@/components/ui/select';-import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';import { QueueTab } from './components/queue-tab';import { RunsTab } from './components/runs-tab';import { SystemHealthTab } from './components/system-health-tab';import { healthMetricsQueries } from './lib/health-metrics-hooks';-type MonthOption = { value: string; label: string };-function buildMonthOptions(): MonthOption[] {const now = dayjs();return Array.from({ length: 6 }, (_unused, index) => {@@ -33,10 +29,12 @@ function buildMonthOptions(): MonthOption[] {});}-export default function SettingsHealthPage() {+export default function SettingsHealthPage({+ section,+}: SettingsHealthPageProps) {const monthOptions = React.useMemo(buildMonthOptions, []);const [searchParams, setSearchParams] = useSearchParams();- const activeTab = parseTabValue(searchParams.get(VIEW_QUERY_PARAM));+ const navigate = useNavigate();const selectedMonth = searchParams.get('month') || monthOptions[0].value;const range = React.useMemo(() => {@@ -52,19 +50,9 @@ export default function SettingsHealthPage() {isLoading: isReportLoading,isError: isReportError,refetch: refetchReport,- } = healthMetricsQueries.useRunMetrics(range, activeTab === 'runs');+ } = healthMetricsQueries.useRunMetrics(range, section === 'runs');const { data: live, isLoading: isLiveLoading } =- healthMetricsQueries.useQueueMetrics(range, activeTab === 'queue');-- const setTab = (tab: TabValue) => {- const newParams = new URLSearchParams(searchParams);- if (tab === 'system') {- newParams.delete(VIEW_QUERY_PARAM);- } else {- newParams.set(VIEW_QUERY_PARAM, tab);- }- setSearchParams(newParams, { replace: true });- };+ healthMetricsQueries.useQueueMetrics(range, section === 'queue');const handleMonthChange = (month: string) => {const newParams = new URLSearchParams(searchParams);@@ -78,7 +66,7 @@ export default function SettingsHealthPage() {title={t('Health')}description={t('Check the status of your platform and its components')}>- {(activeTab === 'runs' || activeTab === 'queue') && (+ {(section === 'runs' || section === 'queue') && (<Select value={selectedMonth} onValueChange={handleMonthChange}><SelectTrigger className="w-auto gap-2 h-8"><Calendar className="h-4 w-4" />@@ -95,49 +83,37 @@ export default function SettingsHealthPage() {)}</DashboardPageHeader>- <Tabs- value={activeTab}- onValueChange={(value) => setTab(value as TabValue)}- className="w-full"- >- <TabsList variant="outline" className="border-b w-full">- <TabsTrigger variant="outline" value="system">- <HeartPulse className="w-4 h-4 mr-2" />- {t('System Health')}- </TabsTrigger>- <TabsTrigger variant="outline" value="runs">- <LineChart className="w-4 h-4 mr-2" />- {t('Runs Health')}- </TabsTrigger>- <TabsTrigger variant="outline" value="queue">- <Activity className="w-4 h-4 mr-2" />- {t('Queue Health')}- </TabsTrigger>- </TabsList>-- <TabsContent value="system">- <SystemHealthTab onSeeRuns={() => setTab('runs')} />- </TabsContent>-- <TabsContent value="runs">- <RunsTab- report={report}- isLoading={isReportLoading}- isError={isReportError}- onRetry={refetchReport}- />- </TabsContent>-- <TabsContent value="queue">- <QueueTab live={live} isLoading={isLiveLoading} />- </TabsContent>- </Tabs>+ {section === 'system' && (+ <SystemHealthTab+ onSeeRuns={() =>+ navigate({+ pathname: '/platform/health/runs',+ search: searchParams.toString(),+ })+ }+ />+ )}++ {section === 'runs' && (+ <RunsTab+ report={report}+ isLoading={isReportLoading}+ isError={isReportError}+ onRetry={refetchReport}+ />+ )}++ {section === 'queue' && (+ <QueueTab live={live} isLoading={isLiveLoading} />+ )}</div>);}-function parseTabValue(value: string | null): TabValue {- return value === 'runs' || value === 'queue' ? value : 'system';-}+type HealthSection = 'system' | 'runs' | 'queue';++type MonthOption = { value: string; label: string };-type TabValue = 'system' | 'runs' | 'queue';+type SettingsHealthPageProps = {+ section: HealthSection;+};diff --git a/packages/web/src/app/routes/platform/infra/workers/index.tsx b/packages/web/src/app/routes/platform/infra/workers/index.tsxindex 5a02a786f5a..a84bc45d81d 100644--- a/packages/web/src/app/routes/platform/infra/workers/index.tsx+++ b/packages/web/src/app/routes/platform/infra/workers/index.tsx@@ -15,15 +15,12 @@ import {HardDrive,Zap,Layers,- Activity,} from 'lucide-react';import prettyBytes from 'pretty-bytes';import React from 'react';-import { useSearchParams } from 'react-router-dom';import { DashboardPageHeader } from '@/app/components/dashboard-page-header';import LockedFeatureGuard from '@/app/components/locked-feature-guard';-import { VIEW_QUERY_PARAM } from '@/app/routes/platform/admin-pages';import {Alert,AlertAction,@@ -37,7 +34,6 @@ import {CardFooter,CardHeader,} from '@/components/ui/card';-import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';import {Tooltip,TooltipContent,@@ -54,24 +50,11 @@ import { SandboxesPopover } from './sandboxes-popover';import { WorkerAssignmentsTab } from './worker-assignments-tab';import { WorkerConfigsPopover } from './worker-configs-popover';-export default function WorkersPage() {+export default function WorkersPage({ section }: WorkersPageProps) {const { data: edition } = flagsHooks.useFlag<ApEdition>(ApFlagId.EDITION);const { platform } = platformHooks.useCurrentPlatform();const isCloud = edition === ApEdition.CLOUD;const { data: workersData, isLoading } = workersQueries.useWorkerMachines();- const [searchParams, setSearchParams] = useSearchParams();-- const activeTab = parseTabValue(searchParams.get(VIEW_QUERY_PARAM));-- const setTab = (tab: TabValue) => {- const newParams = new URLSearchParams(searchParams);- if (tab === 'health') {- newParams.delete(VIEW_QUERY_PARAM);- } else {- newParams.set(VIEW_QUERY_PARAM, tab);- }- setSearchParams(newParams, { replace: true });- };const fleetType = workersData?.[0]?.type;@@ -82,115 +65,98 @@ export default function WorkersPage() {title={t('Workers')}></DashboardPageHeader>- <Tabs- value={activeTab}- onValueChange={(value) => setTab(value as TabValue)}- className="w-full"- >- <TabsList variant="outline" className="border-b w-full">- <TabsTrigger variant="outline" value="health">- <Activity className="w-4 h-4 mr-2" />- {t('Health')}- </TabsTrigger>- <TabsTrigger variant="outline" value="worker-groups">- <Layers className="w-4 h-4 mr-2" />- {t('Worker groups')}- </TabsTrigger>- </TabsList>-- <TabsContent value="health">- <div className="flex flex-col gap-4 pt-4">- {isCloud && fleetType === WorkerMachineType.SHARED && (- <Alert variant="primary">- <Zap size={16} />- <AlertTitle>{t('Upgrade to Dedicated Workers')}</AlertTitle>- <AlertDescription className="text-xs">- {t(- 'Your automations run on shared workers where strict sandboxing adds overhead to every execution. Dedicated workers give you your own execution pool that stays warm and ready, so your automations start much faster.',- )}- </AlertDescription>- <AlertAction>- <RequestTrial- featureKey="DEDICATED_WORKERS"- buttonVariant="default"- buttonSize="xs"- />- </AlertAction>- </Alert>- )}- {isCloud && fleetType === WorkerMachineType.DEDICATED && (- <Alert variant="success">- <Zap size={16} />- <AlertTitle>{t('Dedicated Workers Active')}</AlertTitle>- <AlertDescription className="text-xs">- {t(- 'Your workers run exclusively for your platform. The execution pool stays warm with no sandboxing overhead, so your automations start instantly.',- )}- </AlertDescription>- </Alert>- )}+ {section === 'health' && (+ <div className="flex flex-col gap-4 pt-4">+ {isCloud && fleetType === WorkerMachineType.SHARED && (+ <Alert variant="primary">+ <Zap size={16} />+ <AlertTitle>{t('Upgrade to Dedicated Workers')}</AlertTitle>+ <AlertDescription className="text-xs">+ {t(+ 'Your automations run on shared workers where strict sandboxing adds overhead to every execution. Dedicated workers give you your own execution pool that stays warm and ready, so your automations start much faster.',+ )}+ </AlertDescription>+ <AlertAction>+ <RequestTrial+ featureKey="DEDICATED_WORKERS"+ buttonVariant="default"+ buttonSize="xs"+ />+ </AlertAction>+ </Alert>+ )}+ {isCloud && fleetType === WorkerMachineType.DEDICATED && (+ <Alert variant="success">+ <Zap size={16} />+ <AlertTitle>{t('Dedicated Workers Active')}</AlertTitle>+ <AlertDescription className="text-xs">+ {t(+ 'Your workers run exclusively for your platform. The execution pool stays warm with no sandboxing overhead, so your automations start instantly.',+ )}+ </AlertDescription>+ </Alert>+ )}- {isLoading && (- <div className="grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-4">- {[0, 1, 2].map((i) => (- <Card key={i} className="animate-pulse">- <CardHeader className="pb-3">- <div className="flex items-center justify-between">- <div className="h-4 w-28 bg-muted rounded" />- <div className="h-5 w-16 bg-muted rounded-full" />- </div>- </CardHeader>- <CardContent className="space-y-3">- <div className="h-3 w-full bg-muted rounded" />- <div className="h-3 w-full bg-muted rounded" />- <div className="h-3 w-full bg-muted rounded" />- </CardContent>- <CardFooter>- <div className="h-4 w-full bg-muted rounded" />- </CardFooter>- </Card>- ))}- </div>- )}+ {isLoading && (+ <div className="grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-4">+ {[0, 1, 2].map((i) => (+ <Card key={i} className="animate-pulse">+ <CardHeader className="pb-3">+ <div className="flex items-center justify-between">+ <div className="h-4 w-28 bg-muted rounded" />+ <div className="h-5 w-16 bg-muted rounded-full" />+ </div>+ </CardHeader>+ <CardContent className="space-y-3">+ <div className="h-3 w-full bg-muted rounded" />+ <div className="h-3 w-full bg-muted rounded" />+ <div className="h-3 w-full bg-muted rounded" />+ </CardContent>+ <CardFooter>+ <div className="h-4 w-full bg-muted rounded" />+ </CardFooter>+ </Card>+ ))}+ </div>+ )}- {!isLoading && (workersData ?? []).length === 0 && (- <div className="flex flex-col items-center justify-center py-16 gap-3 text-muted-foreground">- <Server className="size-14" />- <p className="font-medium text-foreground">- {t('No workers found')}- </p>- <p className="text-sm text-center max-w-sm">- {t(- "You don't have any workers yet. Spin up new workers to execute your automations",- )}- </p>- </div>- )}+ {!isLoading && (workersData ?? []).length === 0 && (+ <div className="flex flex-col items-center justify-center py-16 gap-3 text-muted-foreground">+ <Server className="size-14" />+ <p className="font-medium text-foreground">+ {t('No workers found')}+ </p>+ <p className="text-sm text-center max-w-sm">+ {t(+ "You don't have any workers yet. Spin up new workers to execute your automations",+ )}+ </p>+ </div>+ )}- {!isLoading && (workersData ?? []).length > 0 && (- <div className="grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-4">- {(workersData ?? []).map((worker, index) => (- <WorkerCard key={worker.id} worker={worker} index={index} />- ))}- </div>- )}- </div>- </TabsContent>+ {!isLoading && (workersData ?? []).length > 0 && (+ <div className="grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-4">+ {(workersData ?? []).map((worker, index) => (+ <WorkerCard key={worker.id} worker={worker} index={index} />+ ))}+ </div>+ )}+ </div>+ )}- <TabsContent value="worker-groups">- <LockedFeatureGuard- featureKey="DEDICATED_WORKERS"- locked={!platform.plan.workerGroupsEnabled}- lockTitle={t('Unlock Worker Groups')}- lockDescription={t(- 'Reserve dedicated worker capacity for specific projects so a busy project never slows down the rest',- )}- lockDocumentationUrl="https://www.activepieces.com/docs/install/configure-operate/worker-groups"- >- <WorkerAssignmentsTab />- </LockedFeatureGuard>- </TabsContent>- </Tabs>+ {section === 'worker-groups' && (+ <LockedFeatureGuard+ featureKey="DEDICATED_WORKERS"+ locked={!platform.plan.workerGroupsEnabled}+ lockTitle={t('Unlock Worker Groups')}+ lockDescription={t(+ 'Reserve dedicated worker capacity for specific projects so a busy project never slows down the rest',+ )}+ lockDocumentationUrl="https://www.activepieces.com/docs/install/configure-operate/worker-groups"+ >+ <WorkerAssignmentsTab />+ </LockedFeatureGuard>+ )}</div>);}@@ -378,8 +344,8 @@ type WorkerCardProps = {index: number;};-function parseTabValue(value: string | null): TabValue {- return value === 'worker-groups' ? value : 'health';-}+type WorkersSection = 'health' | 'worker-groups';-type TabValue = 'health' | 'worker-groups';+type WorkersPageProps = {+ section: WorkersSection;+};diff --git a/packages/web/src/app/routes/platform/legacy-path-redirect.tsx b/packages/web/src/app/routes/platform/legacy-path-redirect.tsxnew file mode 100644index 00000000000..123befb1624--- /dev/null+++ b/packages/web/src/app/routes/platform/legacy-path-redirect.tsx@@ -0,0 +1,66 @@+import { Navigate, useLocation } from 'react-router-dom';++export function LegacyPathRedirect() {+ const { pathname, search, hash } = useLocation();++ return (+ <Navigate to={{ pathname: resolve(pathname), search, hash }} replace />+ );+}++function resolve(pathname: string): string {+ const match = LEGACY_PATHS.find(+ ({ from }) => pathname === from || pathname.startsWith(`${from}/`),+ );+ if (match === undefined) {+ return '/platform';+ }+ if (match.catchAll === true) {+ return match.to;+ }+ return `${match.to}${pathname.slice(match.from.length)}`;+}++const LEGACY_PATHS: LegacyPath[] = [+ { from: '/platform/setup/ai-capabilities', to: '/platform/ai/capabilities' },+ { from: '/platform/setup/general', to: '/platform/general' },+ { from: '/platform/setup/branding', to: '/platform/general' },+ { from: '/platform/setup/ai', to: '/platform/ai' },+ { from: '/platform/setup/mcp', to: '/platform/mcp' },+ { from: '/platform/setup/connections', to: '/platform/connections/global' },+ { from: '/platform/setup/pieces', to: '/platform/pieces' },+ { from: '/platform/setup/templates', to: '/platform/templates' },+ { from: '/platform/setup/billing', to: '/platform/billing' },+ { from: '/platform/setup/usage', to: '/platform/usage' },+ { from: '/platform/security/api-keys', to: '/platform/api-keys' },+ {+ from: '/platform/security/secret-managers',+ to: '/platform/secret-managers',+ },+ { from: '/platform/security/audit-logs', to: '/platform/audit-log' },+ { from: '/platform/security/embed', to: '/platform/embedding' },+ { from: '/platform/security/sso', to: '/platform/sso' },+ { from: '/platform/security/project-roles', to: '/platform/users/roles' },+ {+ from: '/platform/infrastructure/event-destinations',+ to: '/platform/audit-log/streaming',+ },+ { from: '/platform/infrastructure/workers', to: '/platform/workers' },+ { from: '/platform/infrastructure/health', to: '/platform/health' },+ { from: '/platform/infrastructure/triggers', to: '/platform/triggers' },+ {+ from: '/platform/infrastructure/configurations',+ to: '/platform/configurations',+ },+ { from: '/platform/setup', to: '/platform/ai', catchAll: true },+ { from: '/platform/security', to: '/platform/audit-log', catchAll: true },+ { from: '/platform/infrastructure', to: '/platform/workers', catchAll: true },+];++export const legacyPathUtils = { resolve };++type LegacyPath = {+ from: string;+ to: string;+ catchAll?: boolean;+};diff --git a/packages/web/src/app/routes/platform/legacy-tab-redirect.tsx b/packages/web/src/app/routes/platform/legacy-tab-redirect.tsxnew file mode 100644index 00000000000..338e3951942--- /dev/null+++ b/packages/web/src/app/routes/platform/legacy-tab-redirect.tsx@@ -0,0 +1,37 @@+import React from 'react';+import { Navigate, useLocation, useSearchParams } from 'react-router-dom';++export function LegacyTabRedirect({+ basePath,+ tabPaths,+ children,+}: LegacyTabRedirectProps) {+ const [searchParams] = useSearchParams();+ const { hash } = useLocation();+ const legacyTab = searchParams.get('tab');++ if (legacyTab === null || !Object.hasOwn(tabPaths, legacyTab)) {+ return <>{children}</>;+ }++ const segment = tabPaths[legacyTab];+ const remaining = new URLSearchParams(searchParams);+ remaining.delete('tab');++ return (+ <Navigate+ to={{+ pathname: segment === '' ? basePath : `${basePath}/${segment}`,+ search: remaining.toString(),+ hash,+ }}+ replace+ />+ );+}++type LegacyTabRedirectProps = {+ basePath: string;+ tabPaths: Record<string, string>;+ children: React.ReactNode;+};diff --git a/packages/web/src/app/routes/platform/overview/ai-overview.tsx b/packages/web/src/app/routes/platform/overview/ai-overview.tsxdeleted file mode 100644index f5ec310172a..00000000000--- a/packages/web/src/app/routes/platform/overview/ai-overview.tsx+++ /dev/null@@ -1,177 +0,0 @@-import { AIProviderName } from '@activepieces/core-utils';-import { ApEdition, ApFlagId } from '@activepieces/shared';-import { t } from 'i18next';-import { Link } from 'react-router-dom';--import { Button } from '@/components/ui/button';-import { SUPPORTED_AI_PROVIDERS } from '@/features/agents';-import { billingQueries } from '@/features/billing';-import {- aiProviderQueries,- aiToolConfigQueries,-} from '@/features/platform-admin';-import { flagsHooks } from '@/hooks/flags-hooks';-import { platformHooks } from '@/hooks/platform-hooks';--import { AI_TOOL_CATALOG } from '../setup/ai-capabilities/catalog';--import {- AdminOverview,- OverviewCard,- OverviewCards,- OverviewRow,- OverviewRows,- OverviewSection,-} from './overview-shell';--export function AiOverview() {- const { platform } = platformHooks.useCurrentPlatform();- const { data: edition } = flagsHooks.useFlag<ApEdition>(ApFlagId.EDITION);- const isCommunity = edition === ApEdition.COMMUNITY;- const {- data: providers,- isLoading: isLoadingProviders,- isError: isProvidersError,- refetch: refetchProviders,- } = aiProviderQueries.useAiProviderConfigs();- const {- data: toolConfigs,- isLoading: isLoadingTools,- isError: isToolsError,- } = aiToolConfigQueries.useAiToolConfigs();- const {- data: subscription,- isError: isSubscriptionError,- refetch: refetchSubscription,- } = billingQueries.usePlatformSubscription(platform.id, !isCommunity);-- const configured = (providers ?? []).filter(- (provider) => provider.provider !== AIProviderName.ACTIVEPIECES,- );- const chatProvider = (providers ?? []).find(- (provider) => provider.enabledForChat,- );- const connectedTools = (toolConfigs ?? []).filter((config) => config.enabled);- const chatProviderName =- SUPPORTED_AI_PROVIDERS.find(- (info) => info.provider === chatProvider?.provider,- )?.name ?? chatProvider?.provider;-- const credits = subscription?.usage.creditsUsed ?? 0;- const creditsIncluded = subscription?.plan.includedCredits ?? 0;- const creditsPercent =- creditsIncluded === 0- ? 0- : Math.min(100, Math.round((credits / creditsIncluded) * 100));-- return (- <AdminOverview- title={t('AI Center & MCP')}- description={t(- 'Models, assistant capabilities and the MCP server your flows and chat rely on.',- )}- >- <OverviewCards>- <OverviewCard- to="/platform/setup/ai?tab=providers"- title={t('Providers')}- value={configured.length}- isLoading={isLoadingProviders}- isError={isProvidersError}- errorEntity={t('AI providers')}- description={- chatProvider === undefined- ? t('No provider powers chat yet')- : t('{provider} powers chat', { provider: chatProviderName })- }- />- {!isCommunity && (- <OverviewCard- to="/platform/setup/ai?tab=capabilities"- title={t('Capabilities')}- value={t('{connected} of {total}', {- connected: connectedTools.length,- total: AI_TOOL_CATALOG.length,- })}- isLoading={isLoadingTools}- isError={isToolsError}- errorEntity={t('capabilities')}- description={t(- 'Web search, scraping and image generation for the assistant',- )}- />- )}- <OverviewCard- to="/platform/setup/ai?tab=mcp"- title={t('MCP Server')}- value={t('Ready')}- description={t('Expose platform tools to external MCP clients')}- />- </OverviewCards>-- {!isCommunity && (- <OverviewSection- title={t('AI credits this month')}- description={t(- 'Credits spent on AI steps and chat, out of your plan total.',- )}- error={- isSubscriptionError- ? { entity: t('credits'), onRetry: refetchSubscription }- : undefined- }- >- <div className="flex flex-col gap-2 rounded-lg border p-4">- <div className="flex items-baseline justify-between gap-3">- <span className="text-sm">- <span className="text-lg font-semibold">- {credits.toLocaleString()}- </span>{' '}- {t('used')}- </span>- <span className="text-sm text-muted-foreground">- {t('{included} included', {- included: creditsIncluded.toLocaleString(),- })}- </span>- </div>- <div className="h-1.5 overflow-hidden rounded-full bg-muted">- <div- className="h-full rounded-full bg-primary"- style={{ width: `${creditsPercent}%` }}- />- </div>- </div>- </OverviewSection>- )}-- <OverviewSection- title={t('Default model')}- description={t(- 'Used by AI steps and the assistant when a flow does not pick a model explicitly.',- )}- isLoading={isLoadingProviders}- error={- isProvidersError- ? { entity: t('AI providers'), onRetry: refetchProviders }- : undefined- }- >- <OverviewRows>- <OverviewRow- tone={chatProvider === undefined ? 'off' : 'ok'}- label={- chatProvider === undefined- ? t('No provider enabled for chat')- : chatProviderName- }- >- <Button variant="outline" size="sm" asChild>- <Link to="/platform/setup/ai?tab=providers">{t('Change')}</Link>- </Button>- </OverviewRow>- </OverviewRows>- </OverviewSection>- </AdminOverview>- );-}diff --git a/packages/web/src/app/routes/platform/overview/billing-overview.tsx b/packages/web/src/app/routes/platform/overview/billing-overview.tsxdeleted file mode 100644index 5dbf02b69bb..00000000000--- a/packages/web/src/app/routes/platform/overview/billing-overview.tsx+++ /dev/null@@ -1,59 +0,0 @@-import { ApEdition, ApFlagId } from '@activepieces/shared';-import { t } from 'i18next';--import { billingQueries } from '@/features/billing';-import { flagsHooks } from '@/hooks/flags-hooks';-import { platformHooks } from '@/hooks/platform-hooks';--import { AdminOverview, OverviewCard, OverviewCards } from './overview-shell';--export function BillingOverview() {- const { platform } = platformHooks.useCurrentPlatform();- const { data: edition } = flagsHooks.useFlag<ApEdition>(ApFlagId.EDITION);- const isCommunity = edition === ApEdition.COMMUNITY;- const {- data: subscription,- isLoading,- isError,- } = billingQueries.usePlatformSubscription(platform.id, !isCommunity);-- const creditsUsed = subscription?.usage.creditsUsed ?? 0;- const creditsLimit = subscription?.plan.includedCredits ?? 0;- const usedPercent =- creditsLimit === 0- ? 0- : Math.min(100, Math.round((creditsUsed / creditsLimit) * 100));-- return (- <AdminOverview- title={t('Billing & usage')}- description={t('Your plan, credits and how projects consume them.')}- >- <OverviewCards>- <OverviewCard- to="/platform/setup/billing?tab=plan"- title={t('Plan')}- value={subscription?.autumnPlanName ?? subscription?.plan.plan ?? '—'}- isLoading={isLoading}- isError={isError}- errorEntity={t('billing')}- description={t('{credits} credits included', {- credits: creditsLimit.toLocaleString(),- })}- />- <OverviewCard- to="/platform/setup/billing?tab=usage"- title={t('Usage')}- value={`${usedPercent}%`}- isLoading={isLoading}- isError={isError}- errorEntity={t('billing')}- description={t('{used} of {total} credits used this period', {- used: creditsUsed.toLocaleString(),- total: creditsLimit.toLocaleString(),- })}- />- </OverviewCards>- </AdminOverview>- );-}diff --git a/packages/web/src/app/routes/platform/overview/connections-overview.tsx b/packages/web/src/app/routes/platform/overview/connections-overview.tsxdeleted file mode 100644index 38be7e5f05e..00000000000--- a/packages/web/src/app/routes/platform/overview/connections-overview.tsx+++ /dev/null@@ -1,165 +0,0 @@-import { AppConnectionScope, AppConnectionStatus } from '@activepieces/shared';-import { useQuery } from '@tanstack/react-query';-import { t } from 'i18next';--import { globalConnectionsQueries } from '@/features/connections';-import { platformAppConnectionsApi } from '@/features/platform-admin/api/platform-app-connections-api';-import { projectCollectionUtils } from '@/features/projects';-import { platformHooks } from '@/hooks/platform-hooks';--import {- AdminOverview,- OverviewCard,- OverviewCards,- OverviewEmpty,- OverviewRow,- OverviewRows,- OverviewSection,-} from './overview-shell';--export function ConnectionsOverview() {- const { platform } = platformHooks.useCurrentPlatform();- const {- data: connections,- isLoading,- isError,- refetch,- } = useQuery({- queryKey: ['platform-app-connections', 'overview'],- queryFn: () =>- platformAppConnectionsApi.list({- limit: 1000,- scope: AppConnectionScope.PROJECT,- }),- });- const {- data: globalConnections,- isLoading: isLoadingGlobal,- isError: isGlobalError,- refetch: refetchGlobal,- } = globalConnectionsQueries.useGlobalConnections({- request: { limit: 1000 },- extraKeys: ['overview'],- });- const { data: projects } = projectCollectionUtils.useAllPlatformProjects();-- const rows = connections?.data ?? [];- const globalRows = platform.plan.globalConnectionsEnabled- ? globalConnections?.data ?? []- : [];- const unhealthy = [...rows, ...globalRows].filter(- (connection) => connection.status === AppConnectionStatus.ERROR,- );- const hasGlobalError =- platform.plan.globalConnectionsEnabled && isGlobalError;- const isLoadingHealth =- isLoading || (platform.plan.globalConnectionsEnabled && isLoadingGlobal);- const healthError =- isError || hasGlobalError- ? {- entity: t('connections'),- onRetry: () =>- Promise.all([- ...(isError ? [refetch()] : []),- ...(hasGlobalError ? [refetchGlobal()] : []),- ]),- }- : undefined;- const usageError = isError- ? { entity: t('connections'), onRetry: refetch }- : undefined;- const byPiece = rows.reduce<Record<string, number>>(- (counts, connection) => ({- ...counts,- [connection.pieceName]: (counts[connection.pieceName] ?? 0) + 1,- }),- {},- );- const topPieces: [string, number][] = Object.entries(byPiece)- .sort((left, right) => right[1] - left[1])- .slice(0, 5);-- return (- <AdminOverview- title={t('Connections')}- description={t(- 'Every app credential in use across the platform, whether owned by a project or shared globally.',- )}- >- <OverviewCards>- <OverviewCard- to="/platform/connections?tab=project"- title={t('Project connections')}- value={rows.length}- isLoading={isLoading}- isError={isError}- errorEntity={t('connections')}- description={t(- 'Across {count, plural, =1 {# project} other {# projects}}',- { count: projects?.length ?? 0 },- )}- />- <OverviewCard- to="/platform/connections?tab=global"- title={t('Global connections')}- tier="team"- value={- platform.plan.globalConnectionsEnabled- ? globalConnections?.data.length ?? 0- : t('Locked')- }- isLoading={isLoadingGlobal}- isError={hasGlobalError}- errorEntity={t('connections')}- description={t('Shared credentials available to multiple projects')}- />- </OverviewCards>-- <OverviewSection- title={t('Needs attention')}- description={t(- 'Connections across every project that are expired, revoked or failing.',- )}- isLoading={isLoadingHealth}- error={healthError}- >- {unhealthy.length === 0 ? (- <OverviewEmpty>{t('All connections are healthy')}</OverviewEmpty>- ) : (- <OverviewRows>- {unhealthy.map((connection) => (- <OverviewRow- key={connection.id}- tone="error"- label={connection.displayName}- >- {connection.pieceName}- </OverviewRow>- ))}- </OverviewRows>- )}- </OverviewSection>-- <OverviewSection- title={t('Most used pieces')}- description={t('Which apps your projects connect to most.')}- isLoading={isLoading}- error={usageError}- >- {topPieces.length === 0 ? (- <OverviewEmpty>{t('No connections yet')}</OverviewEmpty>- ) : (- <OverviewRows>- {topPieces.map(([pieceName, count]) => (- <OverviewRow key={pieceName} tone="ok" label={pieceName}>- {t('{count, plural, =1 {# connection} other {# connections}}', {- count,- })}- </OverviewRow>- ))}- </OverviewRows>- )}- </OverviewSection>- </AdminOverview>- );-}diff --git a/packages/web/src/app/routes/platform/overview/infrastructure-overview.tsx b/packages/web/src/app/routes/platform/overview/infrastructure-overview.tsxdeleted file mode 100644index 6a8354ac3c9..00000000000--- a/packages/web/src/app/routes/platform/overview/infrastructure-overview.tsx+++ /dev/null@@ -1,198 +0,0 @@-import { isNil } from '@activepieces/core-utils';-import { ApEdition, ApFlagId } from '@activepieces/shared';-import { t } from 'i18next';-import semver from 'semver';--import { healthQueries, workersQueries } from '@/features/platform-admin';-import { flagsHooks } from '@/hooks/flags-hooks';-import { platformHooks } from '@/hooks/platform-hooks';--import { ADMIN_PAGES, adminPagesUtils } from '../admin-pages';--import {- AdminOverview,- OverviewCard,- OverviewCards,- OverviewRow,- OverviewRows,- OverviewSection,-} from './overview-shell';--export function InfrastructureOverview() {- const { platform } = platformHooks.useCurrentPlatform();- const { data: edition } = flagsHooks.useFlag<ApEdition>(ApFlagId.EDITION);- const {- data: health,- isLoading: isLoadingHealth,- isError: isHealthError,- refetch: refetchHealth,- } = healthQueries.useSystemHealth();- const {- data: workers,- isLoading: isLoadingWorkers,- isError: isWorkersError,- refetch: refetchWorkers,- } = workersQueries.useWorkerMachines();- const infrastructurePage = ADMIN_PAGES.find(- (page) => page.id === 'infrastructure',- );- const showConfigurations =- infrastructurePage !== undefined &&- adminPagesUtils- .visibleTabs({- page: infrastructurePage,- context: { plan: platform.plan, edition },- })- .some((tab) => tab.id === 'configurations');- const statusError =- isHealthError || isWorkersError- ? {- entity: t('infrastructure status'),- onRetry: () => Promise.all([refetchHealth(), refetchWorkers()]),- }- : undefined;-- const currentVersion = health?.release?.current;- const latestVersion = health?.latestVersion;- const isUpToDate =- currentVersion !== undefined &&- latestVersion !== undefined &&- semver.gte(currentVersion, latestVersion);- const appChecksPassed =- health?.disk === true && health?.appRam === true && health?.appCpu === true;- const workerCount = workers?.length ?? 0;- const mismatched = health?.release?.workers.versionMismatched ?? 0;-- const workerChecksReported =- !isNil(health?.workerRam) && !isNil(health?.workerCpu);- const workerChecksPassed =- health?.workerRam === true && health?.workerCpu === true;- const needsAttention =- !isUpToDate ||- !appChecksPassed ||- mismatched > 0 ||- (workerChecksReported && !workerChecksPassed);-- return (- <AdminOverview- title={t('Infrastructure')}- description={t(- 'Health of the app, workers, queues and triggers running your automations.',- )}- >- <OverviewCards>- <OverviewCard- to="/platform/infrastructure?tab=health"- title={t('Health')}- value={needsAttention ? t('Attention') : t('Healthy')}- isLoading={isLoadingHealth}- isError={isHealthError}- errorEntity={t('health checks')}- description={- health === undefined- ? ''- : !needsAttention- ? t('All checks passed')- : !isUpToDate- ? t('Version behind latest; see release notes')- : t('Some checks are failing')- }- />- <OverviewCard- to="/platform/infrastructure?tab=workers"- title={t('Workers')}- value={workerCount}- isLoading={isLoadingWorkers}- isError={isWorkersError}- errorEntity={t('workers')}- description={- workerCount === 0- ? t('No workers connected')- : t(- '{count, plural, =1 {# machine} other {# machines}} connected',- {- count: workerCount,- },- )- }- />- <OverviewCard- to="/platform/infrastructure?tab=triggers"- title={t('Triggers')}- value="—"- description={t('Trigger health across the last 14 days')}- />- {showConfigurations && (- <OverviewCard- to="/platform/infrastructure?tab=configurations"- title={t('Configurations')}- value={t('Runtime')}- description={t('Runtime settings for this instance')}- />- )}- </OverviewCards>-- <OverviewSection- title={t('Status')}- isLoading={isLoadingHealth || isLoadingWorkers}- error={statusError}- >- <OverviewRows>- <OverviewRow- tone={isUpToDate ? 'ok' : 'error'}- label={- currentVersion === undefined- ? t('Version unknown')- : t('Version {current} · latest is {latest}', {- current: currentVersion,- latest: latestVersion ?? t('unknown'),- })- }- >- <a- href="https://github.com/activepieces/activepieces/releases"- target="_blank"- rel="noopener noreferrer"- className="text-sm font-medium text-primary hover:underline"- >- {t('Release notes')}- </a>- </OverviewRow>- <OverviewRow- tone={appChecksPassed ? 'ok' : 'warn'}- label={- appChecksPassed- ? t('App: disk, RAM and CPU checks passed')- : t('App: one or more hardware checks failed')- }- />- <OverviewRow- tone={workerCount === 0 ? 'off' : mismatched > 0 ? 'warn' : 'ok'}- label={- workerCount === 0- ? t('No workers connected')- : mismatched > 0- ? t(- '{count, plural, =1 {# worker is} other {# workers are}} on an incompatible version',- { count: mismatched },- )- : t('All connected workers match the app release')- }- />- <OverviewRow- tone={- !workerChecksReported ? 'off' : workerChecksPassed ? 'ok' : 'warn'- }- label={- !workerChecksReported- ? t('Worker hardware checks unavailable')- : workerChecksPassed- ? t('Workers: RAM and CPU checks passed')- : t('Workers: one or more hardware checks failed')- }- />- </OverviewRows>- </OverviewSection>- </AdminOverview>- );-}diff --git a/packages/web/src/app/routes/platform/overview/overview-shell.tsx b/packages/web/src/app/routes/platform/overview/overview-shell.tsxdeleted file mode 100644index 83c7bce13f6..00000000000--- a/packages/web/src/app/routes/platform/overview/overview-shell.tsx+++ /dev/null@@ -1,207 +0,0 @@-import { t } from 'i18next';-import { ChevronRight } from 'lucide-react';-import { ReactNode } from 'react';-import { Link } from 'react-router-dom';--import { DataFetchErrorState } from '@/components/custom/data-fetch-error-state';-import { Badge } from '@/components/ui/badge';-import { Skeleton } from '@/components/ui/skeleton';-import { FeatureTier, TIER_LABELS } from '@/features/billing';-import { cn } from '@/lib/utils';--export function AdminOverview({- title,- description,- action,- children,-}: AdminOverviewProps) {- return (- <div className="mx-auto flex w-full max-w-5xl flex-col gap-8 px-6 py-8">- <div className="flex items-start justify-between gap-6 border-b pb-5">- <div className="flex flex-col gap-1">- <h1 className="text-xl font-medium">{title}</h1>- {description !== undefined && (- <p className="text-sm text-muted-foreground">{description}</p>- )}- </div>- {action}- </div>- {children}- </div>- );-}--export function OverviewCards({ children }: { children: ReactNode }) {- return (- <div className="grid grid-cols-[repeat(auto-fit,minmax(15rem,1fr))] gap-3 [&>*:only-child]:max-w-60">- {children}- </div>- );-}--export function OverviewCard({- to,- title,- tier,- value,- description,- isLoading = false,- isError = false,- errorEntity,-}: OverviewCardProps) {- return (- <Link- to={to}- className="group flex flex-col gap-2.5 rounded-lg border bg-background p-4 transition-colors hover:border-ring/40 hover:bg-muted/40"- >- <div className="flex items-center gap-2">- <span className="flex-1 truncate font-medium">{title}</span>- {tier !== undefined && (- <Badge variant="outline">{TIER_LABELS[tier]}</Badge>- )}- <ChevronRight className="size-3.5 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5" />- </div>- {isLoading ? (- <Skeleton className="h-7 w-16" />- ) : (- <div className="text-2xl font-semibold leading-none tracking-tight">- {isError ? '—' : value}- </div>- )}- <div className="text-sm text-muted-foreground">- {isLoading ? (- <Skeleton className="h-4 w-32" />- ) : isError ? (- t('Trouble loading {entity}', { entity: errorEntity ?? title })- ) : (- description- )}- </div>- </Link>- );-}--export function OverviewSection({- title,- description,- isLoading = false,- error,- children,-}: OverviewSectionProps) {- return (- <section className="flex flex-col gap-3">- <div className="flex flex-col gap-1">- <h2 className="text-base font-semibold">{title}</h2>- {description !== undefined && (- <p className="text-sm text-muted-foreground">{description}</p>- )}- </div>- {error !== undefined ? (- <div className="rounded-lg border">- <DataFetchErrorState- entity={error.entity}- onRetry={error.onRetry}- className="py-8"- />- </div>- ) : isLoading ? (- <Skeleton className="h-24 w-full rounded-lg" />- ) : (- children- )}- </section>- );-}--export function OverviewEmpty({ children }: { children: ReactNode }) {- return (- <div className="rounded-lg border border-dashed p-7 text-center text-sm text-muted-foreground">- {children}- </div>- );-}--export function OverviewRows({ children }: { children: ReactNode }) {- return (- <div className="divide-y overflow-hidden rounded-lg border">{children}</div>- );-}--export function OverviewRow({ tone, label, children }: OverviewRowProps) {- return (- <div className="flex items-center gap-3 px-4 py-3">- <span- className={cn('size-2 shrink-0 rounded-full', TONE_CLASS[tone])}- aria-hidden- />- <span className="flex-1 text-sm">{label}</span>- {children !== undefined && (- <span className="shrink-0 text-sm text-muted-foreground">- {children}- </span>- )}- </div>- );-}--export function OverviewRowLink({ to, children }: OverviewRowLinkProps) {- return (- <Link- to={to}- className="shrink-0 text-sm font-medium text-primary hover:underline"- >- {children ?? t('Review')}- </Link>- );-}--const TONE_CLASS: Record<OverviewRowTone, string> = {- ok: 'bg-emerald-500',- warn: 'bg-amber-500',- error: 'bg-destructive',- off: 'bg-muted-foreground/35',-};--export type OverviewRowTone = 'ok' | 'warn' | 'error' | 'off';--export type AdminOverviewProps = {- title: string;- description?: string;- action?: ReactNode;- children: ReactNode;-};--export type OverviewCardProps = {- to: string;- title: string;- tier?: FeatureTier;- value: ReactNode;- description: ReactNode;- isLoading?: boolean;- isError?: boolean;- errorEntity?: string;-};--export type OverviewSectionError = {- entity: string;- onRetry?: () => unknown;-};--export type OverviewSectionProps = {- title: string;- description?: string;- isLoading?: boolean;- error?: OverviewSectionError;- children: ReactNode;-};--export type OverviewRowProps = {- tone: OverviewRowTone;- label: ReactNode;- children?: ReactNode;-};--export type OverviewRowLinkProps = {- to: string;- children?: ReactNode;-};diff --git a/packages/web/src/app/routes/platform/overview/security-overview.tsx b/packages/web/src/app/routes/platform/overview/security-overview.tsxdeleted file mode 100644index 8213ebfb2a8..00000000000--- a/packages/web/src/app/routes/platform/overview/security-overview.tsx+++ /dev/null@@ -1,158 +0,0 @@-import { t } from 'i18next';--import { apiKeyQueries } from '@/features/platform-admin';-import { secretManagersHooks } from '@/features/secret-managers';-import { platformHooks } from '@/hooks/platform-hooks';--import {- AdminOverview,- OverviewCard,- OverviewCards,- OverviewRow,- OverviewRowLink,- OverviewRows,- OverviewSection,-} from './overview-shell';--export function SecurityOverview() {- const { platform } = platformHooks.useCurrentPlatform();- const {- data: apiKeys,- isLoading: isLoadingKeys,- isError: isKeysError,- } = apiKeyQueries.useApiKeys();- const {- data: secretManagers,- isLoading: isLoadingSecrets,- isError: isSecretsError,- } = secretManagersHooks.useListSecretManagerConnections({- listForPlatform: true,- });-- const keysKnown =- platform.plan.apiKeysEnabled && !isLoadingKeys && !isKeysError;- const keyCount = apiKeys?.data.length ?? 0;- const secretCount = secretManagers?.length ?? 0;- const domains = platform.allowedAuthDomains ?? [];- const bothLoginsOn = platform.googleAuthEnabled && platform.emailAuthEnabled;-- return (- <AdminOverview- title={t('Security')}- description={t(- 'Credentials, secrets, and the record of what happens on the platform.',- )}- >- <OverviewCards>- <OverviewCard- to="/platform/security?tab=api-keys"- title={t('API keys')}- tier="team"- value={platform.plan.apiKeysEnabled ? keyCount : t('Locked')}- isLoading={isLoadingKeys}- isError={isKeysError}- errorEntity={t('API keys')}- description={- keyCount === 0 ? t('No keys issued') : t('Active platform keys')- }- />- <OverviewCard- to="/platform/security?tab=secrets"- title={t('Secret managers')}- tier="enterprise"- value={- platform.plan.secretManagersEnabled ? secretCount : t('Locked')- }- isLoading={isLoadingSecrets}- isError={isSecretsError}- errorEntity={t('secret managers')}- description={- secretCount === 0- ? t('No external vault connected')- : t('External vaults connected')- }- />- <OverviewCard- to="/platform/security?tab=audit"- title={t('Audit logs')}- tier="enterprise"- value={platform.plan.auditLogEnabled ? t('On') : t('Locked')}- description={t('Every user and system action, recorded')}- />- <OverviewCard- to="/platform/security?tab=events"- title={t('Event streaming')}- tier="enterprise"- value={platform.plan.eventStreamingEnabled ? t('On') : t('Locked')}- description={t('Forward audit events to your own webhook')}- />- </OverviewCards>-- <OverviewSection- title={t('Security checklist')}- description={t('Recommendations based on your current configuration.')}- >- <OverviewRows>- <OverviewRow- tone={bothLoginsOn ? 'warn' : 'ok'}- label={- bothLoginsOn- ? t('Email and password login is enabled alongside Google')- : t('One sign-in method is enabled')- }- >- <OverviewRowLink to="/platform/users?tab=sso">- {t('Review sign-in')}- </OverviewRowLink>- </OverviewRow>- <OverviewRow- tone={domains.length > 0 ? 'ok' : 'warn'}- label={- domains.length > 0- ? t(- 'Sign-up restricted to {count, plural, =1 {# domain} other {# domains}}',- {- count: domains.length,- },- )- : t('No allowed email domains set')- }- >- <OverviewRowLink to="/platform/users?tab=sso">- {t('Restrict domains')}- </OverviewRowLink>- </OverviewRow>- <OverviewRow- tone={!keysKnown ? 'off' : keyCount === 0 ? 'ok' : 'warn'}- label={- !keysKnown- ? t('API keys')- : keyCount === 0- ? t('No API keys issued')- : t(- '{count, plural, =1 {# API key is} other {# API keys are}} active',- { count: keyCount },- )- }- >- {keysKnown && keyCount === 0 ? t('Nothing to rotate') : undefined}- </OverviewRow>- <OverviewRow- tone={platform.plan.auditLogEnabled ? 'ok' : 'off'}- label={- platform.plan.auditLogEnabled- ? t('Audit logging is recording')- : t('Audit logging is not available on your plan')- }- >- {platform.plan.auditLogEnabled ? undefined : (- <OverviewRowLink to="/platform/security?tab=audit">- {t('Upgrade')}- </OverviewRowLink>- )}- </OverviewRow>- </OverviewRows>- </OverviewSection>- </AdminOverview>- );-}diff --git a/packages/web/src/app/routes/platform/overview/users-overview.tsx b/packages/web/src/app/routes/platform/overview/users-overview.tsxdeleted file mode 100644index 174fd9fa99f..00000000000--- a/packages/web/src/app/routes/platform/overview/users-overview.tsx+++ /dev/null@@ -1,170 +0,0 @@-import { isNil, RoleType } from '@activepieces/core-utils';-import { PlatformRole, UserStatus } from '@activepieces/shared';-import { t } from 'i18next';--import {- platformUserHooks,- projectRoleQueries,-} from '@/features/platform-admin';-import { platformHooks } from '@/hooks/platform-hooks';--import {- AdminOverview,- OverviewCard,- OverviewCards,- OverviewEmpty,- OverviewRow,- OverviewRows,- OverviewSection,-} from './overview-shell';--export function UsersOverview() {- const { platform } = platformHooks.useCurrentPlatform();- const {- data: users,- isLoading: isLoadingUsers,- isError: isUsersError,- } = platformUserHooks.useUsers();- const {- data: invitations,- isLoading: isLoadingInvitations,- isError: isInvitationsError,- refetch: refetchInvitations,- } = platformUserHooks.usePlatformInvitations();- const {- data: roles,- isLoading: isLoadingRoles,- isError: isRolesError,- } = projectRoleQueries.useProjectRoles(platform.plan.projectRolesEnabled);- const invitationsError = isInvitationsError- ? { entity: t('invitations'), onRetry: refetchInvitations }- : undefined;-- const allUsers = users?.data ?? [];- const admins = allUsers.filter(- (user) => user.platformRole === PlatformRole.ADMIN,- ).length;- const deactivated = allUsers.filter(- (user) => user.status === UserStatus.INACTIVE,- ).length;- const members = allUsers.length - admins;-- const googleEnabled = platform.googleAuthEnabled;- const samlEnabled = !isNil(platform.federatedAuthProviders?.saml);- const domains = platform.allowedAuthDomains ?? [];- const signInMethods = [- googleEnabled,- platform.emailAuthEnabled,- samlEnabled,- ].filter(Boolean).length;-- const customRoles = (roles?.data ?? []).filter(- (role) => role.type === RoleType.CUSTOM,- ).length;- const pending = invitations ?? [];-- return (- <AdminOverview- title={t('Users & access')}- description={t(- 'Who can sign in, how they sign in, and what they can do inside projects.',- )}- >- <OverviewCards>- <OverviewCard- to="/platform/users?tab=members"- title={t('Members')}- value={allUsers.length}- isLoading={isLoadingUsers}- isError={isUsersError}- errorEntity={t('members')}- description={t(- '{admins, plural, =1 {# admin} other {# admins}} · {members, plural, =1 {# member} other {# members}} · {deactivated} deactivated',- { admins, members, deactivated },- )}- />- <OverviewCard- to="/platform/users?tab=sso"- title={t('Single sign on')}- tier="team"- value={t('{count} of 3', { count: signInMethods })}- description={- samlEnabled ? t('SAML connected.') : t('SAML not connected yet.')- }- />- <OverviewCard- to="/platform/users?tab=roles"- title={t('Project roles')}- tier="team"- value={platform.plan.projectRolesEnabled ? customRoles : t('Locked')}- isLoading={isLoadingRoles}- isError={platform.plan.projectRolesEnabled && isRolesError}- errorEntity={t('project roles')}- description={- customRoles === 0- ? t('No custom roles. Built-in roles in use.')- : t('Custom roles on top of the built-in ones.')- }- />- </OverviewCards>-- <OverviewSection- title={t('Sign-in policy')}- description={t(- 'How people get into this platform. Individual providers are configured under Single sign on.',- )}- >- <OverviewRows>- <OverviewRow- tone={googleEnabled ? 'ok' : 'off'}- label={t('Google sign-in')}- >- {googleEnabled ? t('Enabled') : t('Off')}- </OverviewRow>- <OverviewRow- tone={platform.emailAuthEnabled ? 'ok' : 'off'}- label={t('Email and password')}- >- {platform.emailAuthEnabled ? t('Enabled') : t('Off')}- </OverviewRow>- <OverviewRow tone={samlEnabled ? 'ok' : 'off'} label={t('SAML 2.0')}>- {samlEnabled ? t('Enabled') : t('Off')}- </OverviewRow>- <OverviewRow- tone={domains.length > 0 ? 'ok' : 'off'}- label={t('Allowed email domains')}- >- {domains.length > 0- ? t('{count, plural, =1 {# domain} other {# domains}}', {- count: domains.length,- })- : t('Any domain')}- </OverviewRow>- </OverviewRows>- </OverviewSection>-- <OverviewSection- title={t('Pending invitations')}- description={t(- 'Invites sent from any project that have not been accepted yet.',- )}- isLoading={isLoadingInvitations}- error={invitationsError}- >- {pending.length === 0 ? (- <OverviewEmpty>{t('No pending invitations')}</OverviewEmpty>- ) : (- <OverviewRows>- {pending.map((invitation) => (- <OverviewRow- key={invitation.id}- tone="warn"- label={invitation.email}- />- ))}- </OverviewRows>- )}- </OverviewSection>- </AdminOverview>- );-}diff --git a/packages/web/src/app/routes/platform/plan-feature-sample.tsx b/packages/web/src/app/routes/platform/plan-feature-sample.tsxnew file mode 100644index 00000000000..ee99ba12cee--- /dev/null+++ b/packages/web/src/app/routes/platform/plan-feature-sample.tsx@@ -0,0 +1,138 @@+import { PlatformWithoutSensitiveData } from '@activepieces/shared';+import React from 'react';++import { FeatureSample } from '@/app/components/feature-sample';+import { FeatureTeaserProps } from '@/app/components/feature-teaser';+import { platformHooks } from '@/hooks/platform-hooks';++export function PlanFeatureSample({+ feature,+ children,+}: PlanFeatureSampleProps) {+ const { platform } = platformHooks.useCurrentPlatform();+ const { isLocked, teaser } = PLAN_FEATURE_SAMPLES[feature];++ return (+ <FeatureSample+ locked={isLocked(platform.plan)}+ title={teaser.title}+ description={teaser.description}+ tier={teaser.tier}+ documentationUrl={teaser.documentationUrl}+ featureKey={teaser.featureKey}+ showContactSales={teaser.showContactSales}+ >+ {children}+ </FeatureSample>+ );+}++const PLAN_FEATURE_SAMPLES: Record<PlanFeature, PlanFeatureSampleSpec> = {+ sso: {+ isLocked: (plan) => !plan.ssoEnabled,+ teaser: {+ featureKey: 'SSO',+ title: 'Enable Single Sign On',+ description:+ 'Let your users sign in with your current SSO provider or give them self serve sign up access',+ tier: 'team',+ },+ },+ projectRoles: {+ isLocked: (plan) => !plan.projectRolesEnabled,+ teaser: {+ featureKey: 'CUSTOM_ROLES',+ title: 'Project Role Management',+ description:+ 'Define custom roles and permissions to control what your team members can access and modify',+ tier: 'team',+ },+ },+ globalConnections: {+ isLocked: (plan) => !plan.globalConnectionsEnabled,+ teaser: {+ featureKey: 'GLOBAL_CONNECTIONS',+ title: 'Enable Global Connections',+ description: 'Manage platform-wide connections to external systems.',+ tier: 'team',+ },+ },+ templates: {+ isLocked: (plan) => !plan.manageTemplatesEnabled,+ teaser: {+ featureKey: 'TEMPLATES',+ title: 'Unlock Templates',+ description:+ 'Convert the most common automations into reusable templates 1 click away from your users',+ tier: 'enterprise',+ },+ },+ embedding: {+ isLocked: (plan) => !plan.embeddingEnabled,+ teaser: {+ featureKey: 'SIGNING_KEYS',+ title: 'Unlock Embedding Through JS SDK',+ description: 'Enable signing keys to access embedding functionalities.',+ tier: 'enterprise',+ },+ },+ apiKeys: {+ isLocked: (plan) => !plan.apiKeysEnabled,+ teaser: {+ featureKey: 'API',+ title: 'Enable API Keys',+ description: 'Create and manage API keys to access Activepieces APIs.',+ tier: 'team',+ },+ },+ secretManagers: {+ isLocked: (plan) => !plan.secretManagersEnabled,+ teaser: {+ featureKey: 'SECRET_MANAGERS',+ title: 'Enable Secret Managers',+ description: 'Manage your secrets from a single and secure place',+ tier: 'enterprise',+ },+ },+ auditLogs: {+ isLocked: (plan) => !plan.auditLogEnabled,+ teaser: {+ featureKey: 'AUDIT_LOGS',+ title: 'Unlock Audit Logs',+ description:+ 'Comply with internal and external security policies by tracking activities done within your account',+ tier: 'enterprise',+ },+ },+ eventStreaming: {+ isLocked: (plan) => !plan.eventStreamingEnabled,+ teaser: {+ featureKey: 'EVENT_DESTINATIONS',+ title: 'Unlock Event Streaming',+ description:+ 'Forward every audit event we emit to a webhook, then handle it in a flow.',+ tier: 'enterprise',+ },+ },+};++type PlanFeature =+ | 'sso'+ | 'projectRoles'+ | 'globalConnections'+ | 'templates'+ | 'embedding'+ | 'apiKeys'+ | 'secretManagers'+ | 'auditLogs'+ | 'eventStreaming';++type PlanFeatureSampleSpec = {+ isLocked: (plan: PlatformWithoutSensitiveData['plan']) => boolean;+ teaser: FeatureTeaserProps;+};++type PlanFeatureSampleProps = {+ feature: PlanFeature;+ children: React.ReactNode;+};diff --git a/packages/web/src/app/routes/platform/setup/ai/capabilities-tab/index.tsx b/packages/web/src/app/routes/platform/setup/ai/capabilities-tab/index.tsxindex 4dd2d380817..d4e0a882319 100644--- a/packages/web/src/app/routes/platform/setup/ai/capabilities-tab/index.tsx+++ b/packages/web/src/app/routes/platform/setup/ai/capabilities-tab/index.tsx@@ -48,9 +48,10 @@ export function CapabilitiesTab() {});return (- <div className="flex w-full mx-auto max-w-6xl flex-col gap-4 px-6 py-6">+ <div className="flex flex-col gap-4"><SectionHeadertitle={t('Assistant capabilities')}+ isPageTitlecount={AI_TOOL_CATALOG.length}description={t('Connect external services so the AI assistant can search the web, scrape pages, and generate images.',diff --git a/packages/web/src/app/routes/platform/setup/ai/components/section-header.tsx b/packages/web/src/app/routes/platform/setup/ai/components/section-header.tsxindex 92a313cfe3f..91ba8f81bb5 100644--- a/packages/web/src/app/routes/platform/setup/ai/components/section-header.tsx+++ b/packages/web/src/app/routes/platform/setup/ai/components/section-header.tsx@@ -1,23 +1,42 @@+import { cn } from '@/lib/utils';+export function SectionHeader({title,count,description,+ isPageTitle = false,}: {title: string;count?: number;description: string;+ isPageTitle?: boolean;}) {+ const Heading = isPageTitle ? 'h1' : 'h2';return (<div className="flex flex-col gap-1"><div className="flex items-baseline gap-2">- <h2 className="text-base font-semibold tracking-tight">{title}</h2>+ <Heading+ className={cn('font-semibold tracking-tight', {+ 'text-lg': isPageTitle,+ 'text-base': !isPageTitle,+ })}+ >+ {title}+ </Heading>{count !== undefined && (<span className="text-sm text-muted-foreground tabular-nums">{count}</span>)}</div>- <p className="text-sm text-muted-foreground">{description}</p>+ <p+ className={cn('text-muted-foreground', {+ 'text-xs': isPageTitle,+ 'text-sm': !isPageTitle,+ })}+ >+ {description}+ </p></div>);}diff --git a/packages/web/src/app/routes/platform/setup/ai/index.tsx b/packages/web/src/app/routes/platform/setup/ai/index.tsxnew file mode 100644index 00000000000..6ab5d379bae--- /dev/null+++ b/packages/web/src/app/routes/platform/setup/ai/index.tsx@@ -0,0 +1,39 @@+import { ApEdition, ApFlagId } from '@activepieces/shared';+import { Navigate } from 'react-router-dom';++import { flagsHooks } from '@/hooks/flags-hooks';++import { CapabilitiesTab } from './capabilities-tab';+import { ProvidersTab } from './providers-tab';++export default function AIProvidersPage({ section }: AIProvidersPageProps) {+ return <AICenter section={section} />;+}++function AICenter({ section }: { section: AISection }) {+ const { data: edition } = flagsHooks.useFlag<ApEdition>(ApFlagId.EDITION);++ if (section === 'capabilities' && edition === ApEdition.COMMUNITY) {+ return <Navigate to="/platform/ai" replace />;+ }++ return (+ <div className="flex w-full flex-1 min-h-0 flex-col overflow-auto">+ <div className="mx-auto flex min-h-full w-full max-w-6xl flex-col px-8 py-6">+ {section === 'providers' ? (+ <div className="flex flex-1 flex-col">+ <ProvidersTab />+ </div>+ ) : (+ <CapabilitiesTab />+ )}+ </div>+ </div>+ );+}++type AISection = 'providers' | 'capabilities';++type AIProvidersPageProps = {+ section: AISection;+};diff --git a/packages/web/src/app/routes/platform/setup/ai/providers-tab/index.tsx b/packages/web/src/app/routes/platform/setup/ai/providers-tab/index.tsxindex 89c7e8f0adf..9e076aa6153 100644--- a/packages/web/src/app/routes/platform/setup/ai/providers-tab/index.tsx+++ b/packages/web/src/app/routes/platform/setup/ai/providers-tab/index.tsx@@ -167,25 +167,23 @@ export function ProvidersTab() {if (activeConfig && activeInfo && allowWrite) {return (<>- <div className="flex min-h-full w-full max-w-6xl flex-col px-8 py-6">- <ConfigDetail- key={`${activeConfig.id}:${credentialsVersion}`}- config={activeConfig}- info={activeInfo}- projects={projects}- isSaving={isSaving}- onSave={(request) =>- tryCatch(() =>- updateProvider({ providerId: activeConfig.id, request }),- )- }- onDelete={() => deleteProvider(activeConfig.id)}- onReplaceCredentials={() => openReplaceCredentials(activeConfig)}- isRechecking={isRechecking}- onRecheck={() => recheckProvider(activeConfig.id)}- onBack={closeConfig}- />- </div>+ <ConfigDetail+ key={`${activeConfig.id}:${credentialsVersion}`}+ config={activeConfig}+ info={activeInfo}+ projects={projects}+ isSaving={isSaving}+ onSave={(request) =>+ tryCatch(() =>+ updateProvider({ providerId: activeConfig.id, request }),+ )+ }+ onDelete={() => deleteProvider(activeConfig.id)}+ onReplaceCredentials={() => openReplaceCredentials(activeConfig)}+ isRechecking={isRechecking}+ onRecheck={() => recheckProvider(activeConfig.id)}+ onBack={closeConfig}+ /><ConnectProviderDialogopen={dialogOpen}onOpenChange={setDialogOpen}@@ -199,10 +197,11 @@ export function ProvidersTab() {return (<>- <div className="flex w-full mx-auto max-w-6xl flex-col gap-6 px-6 py-6">+ <div className="flex flex-col gap-6"><div className="flex items-start justify-between gap-3"><SectionHeadertitle={t('Providers')}+ isPageTitlecount={configs.length}description={configs.length === 0diff --git a/packages/web/src/app/routes/platform/setup/mcp/index.tsx b/packages/web/src/app/routes/platform/setup/mcp/index.tsxindex 7fafecca35c..3de1c5e27b8 100644--- a/packages/web/src/app/routes/platform/setup/mcp/index.tsx+++ b/packages/web/src/app/routes/platform/setup/mcp/index.tsx@@ -1,20 +1,18 @@import { ApFlagId } from '@activepieces/shared';import { t } from 'i18next';-import React from 'react';+import { CenteredPage } from '@/app/components/centered-page';import { McpTools } from '@/app/components/project-settings/mcp-server/mcp-tools';import { ActivityFeed } from '@/app/routes/mcp-server/activity/activity-feed';import { CopyToClipboardInput } from '@/components/custom/clipboard/copy-to-clipboard';import { CollapsibleJson } from '@/components/custom/collapsible-json';import { DataFetchErrorState } from '@/components/custom/data-fetch-error-state';import { LoadingSpinner } from '@/components/custom/spinner';-import { Separator } from '@/components/ui/separator';-import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';import { flagsHooks } from '@/hooks/flags-hooks';import { platformMcpHooks } from './platform-mcp-hooks';-export default function PlatformMcpPage() {+export default function PlatformMcpPage({ section }: PlatformMcpPageProps) {const {data: mcpServer,isLoading,@@ -27,7 +25,8 @@ export default function PlatformMcpPage() {if (isLoading) {return (- <McpSection+ <CenteredPage+ title={t('Platform MCP Server')}description={t('Configure the platform-wide MCP server used by the AI Chat assistant and external MCP clients.',)}@@ -35,19 +34,20 @@ export default function PlatformMcpPage() {<div className="flex items-center justify-center py-20"><LoadingSpinner /></div>- </McpSection>+ </CenteredPage>);}if (isError) {return (- <McpSection+ <CenteredPage+ title={t('Platform MCP Server')}description={t('Configure the platform-wide MCP server used by the AI Chat assistant and external MCP clients.',)}><DataFetchErrorState entity={t('the MCP server')} onRetry={refetch} />- </McpSection>+ </CenteredPage>);}@@ -62,101 +62,82 @@ export default function PlatformMcpPage() {};return (- <McpSection+ <CenteredPage+ widthClassName="max-w-[1198px]"+ title={t('Platform MCP Server')}description={t('Configure the platform-wide MCP server used by the AI Chat assistant and external MCP clients.',)}><div className="space-y-6">- {mcpServer && (- <Tabs defaultValue="connection">- <TabsList>- <TabsTrigger value="connection">{t('Connection')}</TabsTrigger>- <TabsTrigger value="tools">{t('Tools')}</TabsTrigger>- <TabsTrigger value="activity">{t('Activity')}</TabsTrigger>- </TabsList>+ {!mcpServer ? null : (+ <>+ {section === 'connection' && (+ <div className="pb-6">+ <div className="space-y-4">+ <div className="flex flex-col gap-1.5">+ <label className="text-sm font-medium">+ {t('Server URL')}+ </label>+ <p className="text-xs text-muted-foreground">+ {t(+ 'Use this URL to connect from Cursor, Windsurf, Claude Desktop, or any MCP-compatible client. Authentication is handled via OAuth.',+ )}+ </p>+ <CopyToClipboardInput+ textToCopy={serverUrl}+ useInput={true}+ />+ </div>- <TabsContent value="connection" className="mt-4 pb-6" tabIndex={-1}>- <div className="space-y-4">- <div className="flex flex-col gap-1.5">- <label className="text-sm font-medium">- {t('Server URL')}- </label>- <p className="text-xs text-muted-foreground">+ <CollapsibleJson+ json={jsonConfiguration}+ label={t('JSON Configuration')}+ description={t(+ 'Copy this into your MCP client config (Cursor, Windsurf, Claude Desktop, etc.).',+ )}+ defaultOpen={false}+ />+ </div>+ </div>+ )}++ {section === 'tools' && (+ <div className="space-y-6 pb-6">+ <div>+ <h3 className="font-semibold text-base mb-1">+ {t('Internal Tools')}+ </h3>+ <p className="text-sm text-muted-foreground mb-3">{t(- 'Use this URL to connect from Cursor, Windsurf, Claude Desktop, or any MCP-compatible client. Authentication is handled via OAuth.',+ 'Control which built-in tools are available to the AI Chat and external agents via the platform MCP server.',)}</p>- <CopyToClipboardInput- textToCopy={serverUrl}- useInput={true}+ <McpTools+ disabledTools={mcpServer.disabledTools}+ isPending={isToolsUpdating}+ onUpdateDisabledTools={(tools) =>+ updateTools({ disabledTools: tools })+ }/></div>-- <CollapsibleJson- json={jsonConfiguration}- label={t('JSON Configuration')}- description={t(- 'Copy this into your MCP client config (Cursor, Windsurf, Claude Desktop, etc.).',- )}- defaultOpen={false}- /></div>- </TabsContent>+ )}- <TabsContent- value="tools"- className="mt-4 space-y-6 pb-6"- tabIndex={-1}- >- <div>- <h3 className="font-semibold text-base mb-1">- {t('Internal Tools')}- </h3>- <p className="text-sm text-muted-foreground mb-3">- {t(- 'Control which built-in tools are available to the AI Chat and external agents via the platform MCP server.',- )}- </p>- <McpTools- disabledTools={mcpServer.disabledTools}- isPending={isToolsUpdating}- onUpdateDisabledTools={(tools) =>- updateTools({ disabledTools: tools })- }- />+ {section === 'activity' && (+ <div className="flex flex-col gap-2 pb-6">+ <ActivityFeed /></div>- </TabsContent>-- <TabsContent- value="activity"- className="mt-4 flex flex-col gap-2 pb-6"- tabIndex={-1}- >- <ActivityFeed />- </TabsContent>- </Tabs>+ )}+ </>)}</div>- </McpSection>+ </CenteredPage>);}-function McpSection({- description,- children,-}: {- description: React.ReactNode;- children: React.ReactNode;-}) {- return (- <div className="w-full mx-auto max-w-page-band py-6">- <div className="flex flex-col gap-1">- <h1 className="text-xl font-medium">{t('Platform MCP Server')}</h1>- <div className="text-sm text-muted-foreground">{description}</div>- </div>- <Separator className="my-4" />- {children}- </div>- );-}+type PlatformMcpSection = 'connection' | 'tools' | 'activity';++type PlatformMcpPageProps = {+ section: PlatformMcpSection;+};diff --git a/packages/web/src/app/routes/platform/setup/pieces/piece-sets/piece-set-details-page.tsx b/packages/web/src/app/routes/platform/setup/pieces/piece-sets/piece-set-details-page.tsxindex 7412faedd83..52984a0be38 100644--- a/packages/web/src/app/routes/platform/setup/pieces/piece-sets/piece-set-details-page.tsx+++ b/packages/web/src/app/routes/platform/setup/pieces/piece-sets/piece-set-details-page.tsx@@ -61,7 +61,7 @@ const PieceSetDetailsPage = () => {};if (!platform.plan.managePiecesEnabled) {- return <Navigate to="/platform/setup/pieces?tab=piece-sets" replace />;+ return <Navigate to="/platform/pieces/piece-sets" replace />;}if (isLoading || !pieceSet) {@@ -80,7 +80,7 @@ const PieceSetDetailsPage = () => {<Buttonvariant="ghost"size="sm"- onClick={() => navigate('/platform/setup/pieces?tab=piece-sets')}+ onClick={() => navigate('/platform/pieces/piece-sets')}className="p-1 h-auto"><ArrowLeft className="size-4" />diff --git a/packages/web/src/app/routes/platform/setup/pieces/piece-sets/piece-sets-tab.tsx b/packages/web/src/app/routes/platform/setup/pieces/piece-sets/piece-sets-tab.tsxindex 09c0237daa6..45fe0f8ea96 100644--- a/packages/web/src/app/routes/platform/setup/pieces/piece-sets/piece-sets-tab.tsx+++ b/packages/web/src/app/routes/platform/setup/pieces/piece-sets/piece-sets-tab.tsx@@ -71,7 +71,7 @@ export const PieceSetsTab = () => {<divclassName="flex items-center gap-2 cursor-pointer"onClick={() =>- navigate(`/platform/setup/pieces/piece-sets/${row.original.id}`)+ navigate(`/platform/pieces/piece-sets/${row.original.id}`)}><span className="font-medium">{row.original.name}</span>diff --git a/packages/web/src/components/ui/scroll-area.tsx b/packages/web/src/components/ui/scroll-area.tsxindex 0de6763f96b..434663c5d2c 100644--- a/packages/web/src/components/ui/scroll-area.tsx+++ b/packages/web/src/components/ui/scroll-area.tsx@@ -11,6 +11,7 @@ function ScrollArea({orientation = 'vertical',showGradient = false,gradientClassName,+ scrollBarClassName,...props}: React.ComponentProps<typeof ScrollAreaPrimitive.Root> &ScrollAreaCustomProps) {@@ -60,7 +61,7 @@ function ScrollArea({>{children}</ScrollAreaPrimitive.Viewport>- <ScrollBar orientation={orientation} />+ <ScrollBar orientation={orientation} className={scrollBarClassName} /><ScrollAreaPrimitive.Corner />{showGradient && showBottomGradient && (@@ -108,4 +109,5 @@ type ScrollAreaCustomProps = {viewPortRef?: React.RefObject<HTMLDivElement | null>;showGradient?: boolean;gradientClassName?: string;+ scrollBarClassName?: string;};diff --git a/packages/web/src/components/ui/sidebar-shadcn.tsx b/packages/web/src/components/ui/sidebar-shadcn.tsxindex 04606fa76dc..398398f988e 100644--- a/packages/web/src/components/ui/sidebar-shadcn.tsx+++ b/packages/web/src/components/ui/sidebar-shadcn.tsx@@ -472,7 +472,7 @@ function SidebarContent({ className, ...props }: React.ComponentProps<'div'>) {data-slot="sidebar-content"data-sidebar="content"className={cn(- 'no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden',+ 'flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden',className,)}{...props}@@ -571,7 +571,7 @@ function SidebarMenuItem({ className, ...props }: React.ComponentProps<'li'>) {}const sidebarMenuButtonVariants = cva(- 'peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 group-data-[collapsible=icon]:p-0 group-data-[collapsible=icon]:justify-center text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-active:font-normal data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground group-has-data-[sidebar=menu-action]/menu-item:pr-8 [&>span:last-child]:truncate [&_svg]:size-4 [&_svg]:shrink-0',+ 'peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 group-data-[collapsible=icon]:p-0 group-data-[collapsible=icon]:justify-center text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:font-normal data-[active=true]:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground group-has-data-[sidebar=menu-action]/menu-item:pr-8 [&>span:last-child]:truncate [&_svg]:size-4 [&_svg]:shrink-0',{variants: {variant: {@@ -666,7 +666,7 @@ function SidebarMenuAction({'peer-data-[size=lg]/menu-button:top-2.5','group-data-[collapsible=icon]:hidden',showOnHover &&- 'peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-open:opacity-100 md:opacity-0',+ 'peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-open:opacity-100 md:opacity-0',className,)}{...props}@@ -684,7 +684,7 @@ function SidebarMenuBadge({data-sidebar="menu-badge"className={cn('pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none',- 'peer-hover/menu-button:text-sidebar-accent-foreground peer-data-active/menu-button:text-sidebar-accent-foreground',+ 'peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground','peer-data-[size=sm]/menu-button:top-1','peer-data-[size=default]/menu-button:top-1.5','peer-data-[size=lg]/menu-button:top-2.5',@@ -739,7 +739,7 @@ function SidebarMenuSub({ className, ...props }: React.ComponentProps<'ul'>) {data-slot="sidebar-menu-sub"data-sidebar="menu-sub"className={cn(- 'mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5',+ 'mx-3.5 flex min-w-0 flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5','group-data-[collapsible=icon]:hidden',className,)}@@ -782,8 +782,8 @@ function SidebarMenuSubButton({data-size={size}data-active={isActive}className={cn(- 'flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground',- 'data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground',+ 'flex h-7 min-w-0 items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground',+ 'data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground',size === 'sm' && 'text-xs',size === 'md' && 'text-sm','group-data-[collapsible=icon]:hidden',diff --git a/packages/web/src/features/billing/components/error.tsx b/packages/web/src/features/billing/components/error.tsxindex 2e1b0a1ed37..ae1d341bba3 100644--- a/packages/web/src/features/billing/components/error.tsx+++ b/packages/web/src/features/billing/components/error.tsx@@ -14,7 +14,7 @@ export const Error = () => {const timer = setInterval(() => {setCountdown((prev) => {if (prev <= 1) {- navigate('/platform/setup/billing');+ navigate('/platform/billing');return 0;}return prev - 1;@@ -54,7 +54,7 @@ export const Error = () => {<div className="flex flex-col gap-3 pt-2"><Button- onClick={() => navigate('/platform/setup/billing')}+ onClick={() => navigate('/platform/billing')}className="w-full"><RefreshCw className="w-4 h-4 mr-2" />diff --git a/packages/web/src/features/billing/components/plan-selector-utils.ts b/packages/web/src/features/billing/components/plan-selector-utils.tsindex 500147584a4..2feeb69a30a 100644--- a/packages/web/src/features/billing/components/plan-selector-utils.ts+++ b/packages/web/src/features/billing/components/plan-selector-utils.ts@@ -142,7 +142,7 @@ function actionFor({}function buildSuccessUrl(action: CheckoutAction): string {- return `${window.location.origin}/platform/setup/billing/success?action=${action}`;+ return `${window.location.origin}/platform/billing/success?action=${action}`;}function dropToFreeWarning(additionalSeats: number | null | undefined): string {diff --git a/packages/web/src/features/billing/components/sidebar-usage-limits.tsx b/packages/web/src/features/billing/components/sidebar-usage-limits.tsxindex a3c8d91cb56..73a79435776 100644--- a/packages/web/src/features/billing/components/sidebar-usage-limits.tsx+++ b/packages/web/src/features/billing/components/sidebar-usage-limits.tsx@@ -103,7 +103,7 @@ export const SidebarUsageLimits = React.memo(() => {)}<span className="grow"></span>{isPlatformAdmin && (- <Link to="/platform/setup/billing" className="shrink-0">+ <Link to="/platform/billing" className="shrink-0"><Button variant="link" size="xs">{t('Billing')} <SquareArrowOutUpRight className="h-4 w-4" /></Button>diff --git a/packages/web/src/features/billing/components/success.tsx b/packages/web/src/features/billing/components/success.tsxindex 24d121aab2d..1e4a128dbc3 100644--- a/packages/web/src/features/billing/components/success.tsx+++ b/packages/web/src/features/billing/components/success.tsx@@ -41,7 +41,7 @@ export const Success = () => {return;}const timer = setTimeout(- () => leave('/platform/setup/billing'),+ () => leave('/platform/billing'),REDIRECT_DELAY_MS,);return () => clearTimeout(timer);@@ -133,7 +133,7 @@ export const Success = () => {</Button><Button- onClick={() => leave('/platform/setup/billing')}+ onClick={() => leave('/platform/billing')}variant="outline"className="w-full">diff --git a/packages/web/src/features/billing/hooks/billing-hooks.ts b/packages/web/src/features/billing/hooks/billing-hooks.tsindex f2813aaa2ad..fe2afc132de 100644--- a/packages/web/src/features/billing/hooks/billing-hooks.ts+++ b/packages/web/src/features/billing/hooks/billing-hooks.ts@@ -218,7 +218,7 @@ export const billingMutations = {return useMutation({mutationFn: async () => {const { url } = await platformBillingApi.setupPayment({- redirectUrl: `${window.location.origin}/platform/setup/billing/success?action=setup`,+ redirectUrl: `${window.location.origin}/platform/billing/success?action=setup`,});if (url) {window.open(url, '_blank');diff --git a/packages/web/test/app/components/sidebar/ap-sidebar-item-utils.test.ts b/packages/web/test/app/components/sidebar/ap-sidebar-item-utils.test.tsnew file mode 100644index 00000000000..8d19101f3f1--- /dev/null+++ b/packages/web/test/app/components/sidebar/ap-sidebar-item-utils.test.ts@@ -0,0 +1,24 @@+import { describe, expect, it } from 'vitest';++import { sidebarItemUtils } from '@/app/components/sidebar/ap-sidebar-item-utils';++describe('sidebarItemUtils.sectionSearch', () => {+ it('keeps the month shared by a section', () => {+ expect(sidebarItemUtils.sectionSearch('?month=2026-08')).toBe(+ 'month=2026-08',+ );+ });++ it("drops a table's own filters and cursor", () => {+ expect(+ sidebarItemUtils.sectionSearch(+ '?status=ERROR&displayName=gmail&cursor=abc&limit=10&month=2026-08',+ ),+ ).toBe('month=2026-08');+ });++ it('returns nothing when no shared key is present', () => {+ expect(sidebarItemUtils.sectionSearch('?status=ACTIVE&limit=10')).toBe('');+ expect(sidebarItemUtils.sectionSearch('')).toBe('');+ });+});diff --git a/packages/web/test/app/routes/platform/legacy-path-redirect.test.ts b/packages/web/test/app/routes/platform/legacy-path-redirect.test.tsnew file mode 100644index 00000000000..ab784ee6291--- /dev/null+++ b/packages/web/test/app/routes/platform/legacy-path-redirect.test.ts@@ -0,0 +1,46 @@+import { describe, expect, it } from 'vitest';++import { legacyPathUtils } from '@/app/routes/platform/legacy-path-redirect';++describe('legacyPathUtils.resolve', () => {+ it.each([+ ['/platform/security/sso', '/platform/sso'],+ ['/platform/security/embed', '/platform/embedding'],+ ['/platform/security/project-roles', '/platform/users/roles'],+ ['/platform/setup/connections', '/platform/connections/global'],+ ['/platform/setup/branding', '/platform/general'],+ ['/platform/setup/ai-capabilities', '/platform/ai/capabilities'],+ ['/platform/setup/ai/capabilities', '/platform/ai/capabilities'],+ [+ '/platform/setup/pieces/piece-sets/abc123',+ '/platform/pieces/piece-sets/abc123',+ ],+ ['/platform/setup/billing/success', '/platform/billing/success'],+ [+ '/platform/infrastructure/event-destinations',+ '/platform/audit-log/streaming',+ ],+ ['/platform/infrastructure/workers/groups', '/platform/workers/groups'],+ ['/platform/infrastructure/health/queue', '/platform/health/queue'],+ ['/platform/setup', '/platform/ai'],+ ['/platform/security', '/platform/audit-log'],+ ['/platform/infrastructure', '/platform/workers'],+ ])('%s -> %s', (from, to) => {+ expect(legacyPathUtils.resolve(from)).toBe(to);+ });++ it('drops an unknown sub-path under a retired group folder', () => {+ expect(legacyPathUtils.resolve('/platform/setup/unknown')).toBe(+ '/platform/ai',+ );+ expect(legacyPathUtils.resolve('/platform/security/unknown/x')).toBe(+ '/platform/audit-log',+ );+ });++ it('does not treat a longer sibling segment as a match', () => {+ expect(legacyPathUtils.resolve('/platform/setup/ai-capabilities')).not.toBe(+ '/platform/ai-capabilities',+ );+ });+});