From 23a5baef43528fd777feffed8974516cbf12f98a Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Wed, 28 Jan 2026 23:30:48 -0800 Subject: [PATCH] feat: add category support for blueprints and protect global blueprints (#8378) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary This PR adds two related features for subgraph blueprints: ### 1. Protect Global Blueprints from Deletion - Added `isGlobalBlueprint()` helper that distinguishes blueprints by `python_module` field - User blueprints have `python_module: 'blueprint'` - Global (installed) blueprints have `python_module` set to the node pack name - Guarded `deleteBlueprint()` to show a warning toast for global blueprints - Hidden delete menu in node library for global blueprints ### 2. Category Support for Blueprints - User blueprints now use category `Subgraph Blueprints/User` - Global blueprints use `Subgraph Blueprints/{category}` if category is provided, otherwise `Subgraph Blueprints` - Extended `GlobalSubgraphData.info` type with optional `category` field - Added `category` to `zSubgraphDefinition` schema ## Files Changed - `src/stores/subgraphStore.ts` - Core logic for both features - `src/stores/subgraphStore.test.ts` - Tests for `isGlobalBlueprint` - `src/components/sidebar/tabs/nodeLibrary/NodeTreeLeaf.vue` - Hide delete menu for global blueprints - `src/scripts/api.ts` - Extended `GlobalSubgraphData` type - `src/platform/workflow/validation/schemas/workflowSchema.ts` - Added category to schema - `src/locales/en/main.json` - Added translation key ## Testing - ✅ `pnpm typecheck` passed - ✅ `pnpm lint` passed ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8378-feat-add-category-support-for-blueprints-and-protect-global-blueprints-2f66d73d36508137aa67c2d88c358b69) by [Unito](https://www.unito.io) --------- Co-authored-by: Subagent 5 Co-authored-by: Amp Co-authored-by: GitHub Action Co-authored-by: AustinMroz --- .../sidebar/tabs/nodeLibrary/NodeTreeLeaf.vue | 22 ++++++---- src/locales/en/main.json | 3 +- .../validation/schemas/workflowSchema.ts | 2 + src/scripts/api.ts | 5 ++- src/stores/subgraphStore.test.ts | 42 ++++++++++++++---- src/stores/subgraphStore.ts | 43 +++++++++++++------ 6 files changed, 86 insertions(+), 31 deletions(-) diff --git a/src/components/sidebar/tabs/nodeLibrary/NodeTreeLeaf.vue b/src/components/sidebar/tabs/nodeLibrary/NodeTreeLeaf.vue index 325cf44f5..4f1cb6d27 100644 --- a/src/components/sidebar/tabs/nodeLibrary/NodeTreeLeaf.vue +++ b/src/components/sidebar/tabs/nodeLibrary/NodeTreeLeaf.vue @@ -13,10 +13,7 @@ severity="danger" /> -