feat: read category from blueprint subgraph definition#9053
feat: read category from blueprint subgraph definition#9053christian-byrne merged 5 commits intomainfrom
Conversation
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 02/21/2026, 07:19:41 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughMake subgraph blueprint categories optional (omit when absent), add tests for category resolution and overrides, add optional Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Playwright: ✅ 522 passed, 0 failed · 6 flaky 📊 Browser Reports
|
📦 Bundle: 4.36 MB gzip 🔴 +415 BDetailsSummary
Category Glance App Entry Points — 21.5 kB (baseline 21.5 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 926 kB (baseline 926 kB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 68.8 kB (baseline 68.8 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 9 added / 9 removed Panels & Settings — 432 kB (baseline 432 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 10 added / 10 removed User & Accounts — 16 kB (baseline 16 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 5 added / 5 removed Editors & Dialogs — 738 B (baseline 738 B) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 1 added / 1 removed UI Components — 43.2 kB (baseline 43.2 kB) • ⚪ 0 BReusable component library chunks
Status: 5 added / 5 removed Data & Services — 2.5 MB (baseline 2.5 MB) • 🔴 +1.42 kBStores, services, APIs, and repositories
Status: 13 added / 13 removed Utilities & Hooks — 57.7 kB (baseline 57.7 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 12 added / 12 removed Vendor & Third-Party — 8.86 MB (baseline 8.86 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 7.6 MB (baseline 7.6 MB) • ⚪ 0 BBundles that do not match a named category
Status: 47 added / 47 removed |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/stores/subgraphStore.ts`:
- Around line 283-287: The ExportedSubgraph type is missing the optional
category property but code in subgraphStore.ts reads
workflow.initialState.definitions?.subgraphs?.[0]?.category; update the
serialisation type by adding category?: string to the ExportedSubgraph interface
in serialisation.ts (src/lib/litegraph/src/types/serialisation.ts) so the
property is correctly typed, and run a typecheck to ensure no other callers need
adjustments; alternatively, if you prefer not to change the type, modify the
access site (in subgraphStore.ts) to use a safe metadata accessor instead of
assuming category exists.
de1c577 to
d711b7a
Compare
There was a problem hiding this comment.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@src/stores/subgraphStore.ts`:
- Around line 283-287: The ExportedSubgraph type is missing the category
property referenced by subgraphStore.ts (reading
workflow.initialState.definitions?.subgraphs?.[0]?.category); update the
ExportedSubgraph interface in src/lib/litegraph/src/types/serialisation.ts to
include category as an optional string (e.g., category?: string) so TypeScript
strict mode compiles, and run type checks to ensure no other fields need
optionalization.
| const orderA = ai === -1 ? orderLen : ai | ||
| const orderB = bi === -1 ? orderLen : bi | ||
| return orderA - orderB | ||
| }) |
There was a problem hiding this comment.
Read category from definitions.subgraphs[0].category in blueprint JSON files as a fallback default. Overrides from info.category or explicit category params still take precedence. Amp-Thread-ID: https://ampcode.com/threads/T-019c6f43-6212-7308-bea6-bfc35a486cbf
- Add category property to ExportedSubgraph type definition - Move nodeOrderByFolder to module-level constant Amp-Thread-ID: https://ampcode.com/threads/T-019c7e5b-aae0-740b-9706-570502566aa9
91afcf1 to
0696c5b
Compare
|
Updating Playwright Expectations |
Read
categoryfromdefinitions.subgraphs[0].categoryin blueprint JSON files as a fallback default for node categorization.This allows blueprint authors to set the category directly in the blueprint file without needing backend
index.jsonsupport. The precedence order is:info.categoryfrom API, or'Subgraph Blueprints/User'for user blueprints)definitions.subgraphs[0].categoryfrom the blueprint JSON content'Subgraph Blueprints'fallbackCompanion PR: Comfy-Org/ComfyUI#12552 (adds essential blueprints with categories matching the Figma design)
┆Issue is synchronized with this Notion page by Unito