fix: App mode - renaming widgets on subgraphs (#10245)

## Summary

Fixes renaming of widgets from subgraph nodes in app builder/app mode.

## Changes

- **What**: If the widget is from a subgraph node and no parents passed,
use the node as the subgraph parent.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-10245-fix-App-mode-renaming-widgets-on-subgraphs-3276d73d3650815bb131c840df43cdf2)
by [Unito](https://www.unito.io)
This commit is contained in:
pythongosssss
2026-03-19 11:00:31 +00:00
committed by GitHub
parent 3591579141
commit 77ddda9d3c
8 changed files with 403 additions and 5 deletions

View File

@@ -48,7 +48,10 @@ export function renameWidget(
newLabel: string,
parents?: SubgraphNode[]
): boolean {
if (isPromotedWidgetView(widget) && parents?.length) {
if (
isPromotedWidgetView(widget) &&
(parents?.length || node.isSubgraphNode())
) {
const sourceWidget = resolvePromotedWidgetSource(node, widget)
if (!sourceWidget) {
console.error('Could not resolve source widget for promoted widget')