Skip to content

Reduce preview composable invalidations for non-subgraph Vue nodes #15679

Description

@coderabbitai

Summary

Reduce unnecessary reactive evaluations from preview composables in Vue graph nodes.

LGraphNode.vue currently instantiates both usePromotedPreviews and useAmbientSubgraphPreviews for every LGraphNode. For non-subgraph nodes, these composables short-circuit. However, preview output updates can still invalidate their computed state across all Vue nodes.

Rationale

Large workflows can contain 500 or more nodes but few subgraph nodes. A WebSocket preview frame can cause O(total nodes) short-circuit evaluations. The new ambient-preview path has the same subscription pattern as the existing promoted-preview path. Address both paths together in a dedicated performance change.

Affected areas

  • src/renderer/extensions/vueNodes/components/LGraphNode.vue
  • usePromotedPreviews
  • useAmbientSubgraphPreviews
  • Reactive dependencies on node output / preview state

Required changes

  • Determine a design that prevents non-subgraph LGraphNode instances from subscribing to preview-output changes.
  • Apply the design consistently to both promoted previews and ambient previews.
  • Preserve preview behavior, ordering, and exposure precedence for SubgraphNode instances.
  • Keep this work separate from pull request fix: decouple subgraph preview/output display from the promotion system #14569.

Acceptance criteria

  • Non-subgraph Vue nodes do not perform preview-composable recomputation for unrelated preview frames.
  • Subgraph nodes continue to render promoted and ambient previews correctly.
  • An explicit exposure continues to take precedence over an ambient preview for the same source node.
  • Add or update focused tests where the existing test structure supports this behavior.

Backlinks

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions