Commit Graph
5 Commits
Author SHA1 Message Date
Mel Massadian ea6d5d4e59 refactor(api): ✨ add reactive API change notifications
- introduced MTB_API_CHANGED_EVENT custom event for triggering panel updates
- added notifyAPIChanged() function dispatched on API modifications
- setup event listener in APIPanel constructor to debounce updates via requestAnimationFrame
- improved boolean value handling to recognize numeric 1/'1' as true
- ensures UI stays in sync when API properties change across extension, widget manager, and panel
2025-12-07 22:58:57 +01:00
Mel Massadian e90a7048fb refactor: 🔨 API sidebar and node UI
- completely redesigned inspector panel
2025-12-07 20:39:22 +01:00
Mel Massadian 114db05be0 refactor: 🔨 migrate comfy_shared to typescript and modularize
Split monolithic 1400-line comfy_shared.js into focused TypeScript modules in web_source/src/comfy_shared/:
- api.ts: server API utilities (runAction, getServerInfo, setServerInfo)
- colors.ts: color brightness utilities
- documentation.ts: node documentation widget system
- dom.ts: DOM and HTML utilities
- dynamic-connections.ts: dynamic input/output management
- logger.ts: logging utilities with toast notifications
- node-extensions.ts: node type extension helpers
- storage.ts: namespaced localStorage management
- types.ts: comprehensive type definitions
- utils.ts: base utilities (UUID, debounce, deep merge)
- widgets.ts: LiteGraph widget utilities

Benefits:
- ~200 LOC reduction through proper typing and elimination of redundant code
- Better code organization with single-responsibility modules
- Full TypeScript type safety with proper generics
- Improved documentation and maintainability
- Easier to tree-shake unused utilities

Updated vite.config.ts to build comfy_shared as separate entry point and marked external dependencies (/mtb_async modules).

Modified InspectorItem.svelte to use extracted item.value instead of always pulling from widgets[0].

Renamed panel.ts to panel.svelte.ts to enable Svelte 5 runes and made APIPanel reactive using $state instead of $$set.
2025-12-07 19:54:31 +01:00
Mel Massadian d21729659d feat: ✨ mtb api authoring layer with svelte 5 runes
- migrate Inspector components to Svelte 5 runes ($state, $derived, $props)
- replace on:event directives with new onclick/onconsider/onfinalize syntax
- add mtb_api module with widget manager, graph-to-prompt conversion, and extension registration
- implement APIPanel controller for managing exposed workflow inputs
- add mock implementations for ComfyUI scripts (app, api, ui, comfy_shared)
- create constants module for API colors and styling
- update vite config to handle mtb_api entry point and external @mtb/shared imports
- refactor api_nodes.css to use css custom properties instead of template variables
- add postbuild script to copy dist files to web/dist
2025-12-07 17:45:46 +01:00
Mel Massadian 37d6569f68 feat(web_source): ✨ WIP typescript migration
- initialize web_source project with vite, svelte 5, and typescript
 - add mtb_inspector: interactive node inspector panel for comfyui workflow authoring
 - add note-plus: markdown/html editor node with live preview and ace editor integration
 - add python repl: interactive frontend repl with syntax highlighting and linting
 - implement draggable/resizable UI components with custom actions
 - add color picker, dnd support, and tabbed interface
 - configure build system with css injection and external comfyui script imports
 - add web/dist to .gitignore for built artifacts
2025-11-09 16:31:11 +01:00