Comfy-Org / Comfy-Org/ComfyUI_frontend
Migrate CameraInfo widget state bridge to ECS widget value store
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Summary
Migrate the CameraInfo state adapter from legacy LiteGraph widget access to the ECS widget value store and WidgetId-keyed actions.
## Required changes
- Replace `node.widgets` traversal and direct `.value` reads in `src/extensions/core/cameraInfo/widgetBridge.ts`.
- Replace direct `.value` writes in `writeWidgetValue`.
- Remove widget callback monkey-patching in `src/composables/useCameraInfo.ts`.
- Read widget state through `widgetValueStore.getWidget` and `widgetValueStore.getNodeWidgets`.
- Write widget state through `widgetValueStore.setValue`.
- Subscribe to WidgetId-keyed state changes through the ECS-supported mechanism.
## Rationale
The current bridge uses the legacy widget pattern that the ECS migration plan identifies for replacement. The ECS branch requires WidgetId-keyed state and actions. This migration avoids an architectural conflict when ECS lands.
## Affected areas
- `src/extensions/core/cameraInfo/widgetBridge.ts`
- `src/composables/useCameraInfo.ts`
- CameraInfo widget synchronization tests
## Acceptance criteria
- CameraInfo reads state without traversing `node.widgets`.
- CameraInfo writes state without mutating widget `.value` directly.
- CameraInfo observes widget changes without replacing widget callbacks.
- The implementation uses the supported ECS widget value store APIs and WidgetId-keyed state/actions.
- Tests cover state reads, writes, and reactive updates through the ECS adapter.
## Backlinks
- Pull request: https://github.com/Comfy-Org/ComfyUI_frontend/pull/13741
- Review comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/13741#discussion_r3840304840
Requested by: @christian-byrne
Contributor guide
Assessment
This issue has not been assessed yet.