Comfy-Org / Comfy-Org/ComfyUI_frontend
Refactor SetNodeState to use layoutStore instead of direct LitGraph mutations
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Context
In PR #7812, the new `SetNodeState.vue` component currently modifies the `mode` property directly on `LGraphNode` objects:
```typescript
set(value: LGraphNode['mode']) {
nodes.forEach((node) => {
node.mode = value
})
emit('changed')
}
```
## Suggestion
Use the `layoutStore` for state management instead of directly mutating LitGraph objects. This would provide better separation of concerns and maintain a more predictable state management pattern.
## References
- PR: https://github.com/Comfy-Org/ComfyUI_frontend/pull/7812
- Comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/7812#discussion_r2685108687
- File: `src/components/rightSidePanel/settings/SetNodeState.vue`
- Requested by: @christian-byrne
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-8023-Refactor-SetNodeState-to-use-layoutStore-instead-of-direct-LitGraph-mutations-2e76d73d365081dcaf13fda3de250c17) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.