Skip to content

[refactor] Remove parentSubgraphNode property from widgets #1145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

christian-byrne
Copy link
Contributor

@christian-byrne christian-byrne commented Jul 21, 2025

Summary

  • Removed redundant parentSubgraphNode property from widget interfaces and implementations
  • Simplified widget promotion by using existing widget.node reference instead

Details

The parentSubgraphNode property was causing TypeScript compilation issues in downstream ComfyUI_frontend due to private fields in LGraphNode. After investigation, we found the property was redundant since widgets can determine their parent context through the existing widget.node reference (after first fixing the DomWidgetImpl to properly implement createCopyForNode).

Changes:

  • Removed parentSubgraphNode property from IBaseWidget interface
  • Removed parentSubgraphNode property from BaseWidget class
  • Updated SubgraphNode to not set the property during widget promotion
  • Removed cleanup of the property in SubgraphNode.onRemoved
  • Updated tests to remove parentSubgraphNode assertions
  • Aligned with recent terminology changes ("widget-demoted" events)

All tests passing, no functional changes.

Removed the parentSubgraphNode property as it's no longer needed - widget positioning can be determined through the widget.node reference instead. This simplifies the codebase and removes redundant state tracking.

Changes:
- Removed parentSubgraphNode property from IBaseWidget interface
- Removed assignment in SubgraphNode when promoting widgets
- Updated tests to remove parentSubgraphNode checks
- Removed unused NodeLike imports
@christian-byrne christian-byrne merged commit def6010 into master Jul 21, 2025
4 checks passed
@christian-byrne christian-byrne deleted the refactor/widget-parent-subgraph-execution-id branch July 21, 2025 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant