Skip to content

[backport core/1.41] fix: prevent non-widget inputs on nested subgraphs from appearing as button widgets (#9542)#9563

Merged
christian-byrne merged 1 commit intocore/1.41from
backport-9542-to-core-1.41
Mar 8, 2026
Merged

[backport core/1.41] fix: prevent non-widget inputs on nested subgraphs from appearing as button widgets (#9542)#9563
christian-byrne merged 1 commit intocore/1.41from
backport-9542-to-core-1.41

Conversation

@christian-byrne
Copy link
Contributor

@christian-byrne christian-byrne commented Mar 8, 2026

Backport of #9542 to core/1.41.

Cherry-pick of merge commit 8a5bcde applied cleanly.

Original PR: #9542
Pipeline ticket: 15e1f241-efaa-4fe5-88ca-4ccc7bfb3345

┆Issue is synchronized with this Notion page by Unito

…button widgets (#9542)

## Summary

Fix non-widget inputs on nested subgraphs appearing twice — once as
slots and once as unresolved button widgets.

## Changes

- **What**: Add `getTargetWidget()` guard in the `isSubgraphNode()`
branch of `resolveSubgraphInputTarget`, matching the existing check for
non-subgraph nodes. Non-widget inputs (e.g. AUDIO, IMAGE) now return
`undefined` instead of a bogus promotion entry.

## Review Focus

`resolveSubgraphInputTarget` had an asymmetry: the non-subgraph branch
checked `getTargetWidget()` before returning, but the `isSubgraphNode()`
branch returned unconditionally for every input. For nested subgraphs
where non-widget slots are linked through to inner SubgraphNode inputs,
this created `PromotedWidgetView` entries that failed `resolveDeepest()`
(falling back to `type: 'button'`), while the inputs also rendered as
normal slot circles since `input.widget` was never set by
`_resolveInputWidget` (which correctly skipped them).

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-9542-fix-prevent-non-widget-inputs-on-nested-subgraphs-from-appearing-as-button-widgets-31c6d73d3650816387c3f97f0385e762)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Amp <amp@ampcode.com>
@christian-byrne christian-byrne requested a review from a team as a code owner March 8, 2026 02:12
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Mar 8, 2026
@github-actions
Copy link

github-actions bot commented Mar 8, 2026

🎭 Playwright: ✅ 554 passed, 0 failed · 3 flaky

📊 Browser Reports
  • chromium: View Report (✅ 541 / ❌ 0 / ⚠️ 3 / ⏭️ 10)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 10 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

@github-actions
Copy link

github-actions bot commented Mar 8, 2026

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 03/08/2026, 02:13:23 AM UTC

Links

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 8, 2026

Important

Review skipped

Ignore keyword(s) in the title.

⛔ Ignored keywords (2)
  • [release]
  • [backport

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9a6a4177-9b3a-4542-98e3-8bc22eea7fe7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch backport-9542-to-core-1.41

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Mar 8, 2026

⚡ Performance Report

No baseline found — showing absolute values.

Metric Value
canvas-idle: style recalcs 125
canvas-idle: layouts 0
canvas-idle: task duration 611ms
canvas-idle: heap delta -3.2 MB
canvas-mouse-sweep: style recalcs 194
canvas-mouse-sweep: layouts 12
canvas-mouse-sweep: task duration 1180ms
canvas-mouse-sweep: heap delta -3.0 MB
dom-widget-clipping: style recalcs 51
dom-widget-clipping: layouts 0
dom-widget-clipping: task duration 452ms
dom-widget-clipping: heap delta 7.2 MB
subgraph-dom-widget-clipping: style recalcs 86
subgraph-dom-widget-clipping: layouts 1
subgraph-dom-widget-clipping: task duration 559ms
subgraph-dom-widget-clipping: heap delta -7.6 MB
subgraph-idle: style recalcs 123
subgraph-idle: layouts 0
subgraph-idle: task duration 574ms
subgraph-idle: heap delta -3.1 MB
subgraph-mouse-sweep: style recalcs 174
subgraph-mouse-sweep: layouts 16
subgraph-mouse-sweep: task duration 1200ms
subgraph-mouse-sweep: heap delta -5.1 MB
Raw data
{
  "timestamp": "2026-03-08T02:16:36.565Z",
  "gitSha": "18dec31fe9f61250dbff15cdd1373da7ec5837d5",
  "branch": "backport-9542-to-core-1.41",
  "measurements": [
    {
      "name": "canvas-idle",
      "durationMs": 2055.802000000085,
      "styleRecalcs": 125,
      "styleRecalcDurationMs": 34.212,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 596.234,
      "heapDeltaBytes": -3288024
    },
    {
      "name": "canvas-idle",
      "durationMs": 2051.806000000056,
      "styleRecalcs": 126,
      "styleRecalcDurationMs": 34.403,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 645.881,
      "heapDeltaBytes": -3888296
    },
    {
      "name": "canvas-idle",
      "durationMs": 2069.14299999994,
      "styleRecalcs": 125,
      "styleRecalcDurationMs": 30.162,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 590.0730000000001,
      "heapDeltaBytes": -2957636
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 2179.9559999999474,
      "styleRecalcs": 194,
      "styleRecalcDurationMs": 80.07300000000001,
      "layouts": 12,
      "layoutDurationMs": 4.489,
      "taskDurationMs": 1200.9080000000001,
      "heapDeltaBytes": -2979380
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 2168.419999999969,
      "styleRecalcs": 192,
      "styleRecalcDurationMs": 77.666,
      "layouts": 12,
      "layoutDurationMs": 4.5089999999999995,
      "taskDurationMs": 1165.396,
      "heapDeltaBytes": -3531940
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 2155.509000000052,
      "styleRecalcs": 196,
      "styleRecalcDurationMs": 83.04299999999999,
      "layouts": 13,
      "layoutDurationMs": 4.805999999999999,
      "taskDurationMs": 1174.6750000000002,
      "heapDeltaBytes": -2868660
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 714.8310000000038,
      "styleRecalcs": 51,
      "styleRecalcDurationMs": 17.383,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 461.45599999999996,
      "heapDeltaBytes": 6843260
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 699.1850000000568,
      "styleRecalcs": 50,
      "styleRecalcDurationMs": 17.203,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 441.414,
      "heapDeltaBytes": 7845328
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 735.5079999999816,
      "styleRecalcs": 51,
      "styleRecalcDurationMs": 18.44,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 453.39300000000003,
      "heapDeltaBytes": 7864116
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 763.7159999999312,
      "styleRecalcs": 85,
      "styleRecalcDurationMs": 24.566000000000003,
      "layouts": 1,
      "layoutDurationMs": 0.20299999999999996,
      "taskDurationMs": 540.0350000000001,
      "heapDeltaBytes": -7952036
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 776.1419999999362,
      "styleRecalcs": 86,
      "styleRecalcDurationMs": 27.412,
      "layouts": 1,
      "layoutDurationMs": 0.307,
      "taskDurationMs": 575.533,
      "heapDeltaBytes": -7667028
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 810.2709999999433,
      "styleRecalcs": 86,
      "styleRecalcDurationMs": 23.203999999999997,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 562.3009999999999,
      "heapDeltaBytes": -8427216
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2015.2669999999944,
      "styleRecalcs": 122,
      "styleRecalcDurationMs": 30.252,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 550.581,
      "heapDeltaBytes": -2819624
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2015.0220000000445,
      "styleRecalcs": 122,
      "styleRecalcDurationMs": 31.375,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 570.8519999999999,
      "heapDeltaBytes": -4163844
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2047.6820000000089,
      "styleRecalcs": 126,
      "styleRecalcDurationMs": 37.949,
      "layouts": 1,
      "layoutDurationMs": 0.29699999999999993,
      "taskDurationMs": 599.4159999999999,
      "heapDeltaBytes": -2751068
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1905.889000000002,
      "styleRecalcs": 169,
      "styleRecalcDurationMs": 73.35600000000001,
      "layouts": 17,
      "layoutDurationMs": 5.686,
      "taskDurationMs": 1070.839,
      "heapDeltaBytes": -4744552
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 2077.83100000006,
      "styleRecalcs": 178,
      "styleRecalcDurationMs": 76.099,
      "layouts": 16,
      "layoutDurationMs": 5.28,
      "taskDurationMs": 1273.7359999999999,
      "heapDeltaBytes": -5482688
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 2061.6059999999834,
      "styleRecalcs": 176,
      "styleRecalcDurationMs": 72.02499999999999,
      "layouts": 16,
      "layoutDurationMs": 4.909,
      "taskDurationMs": 1256.6430000000003,
      "heapDeltaBytes": -5819972
    }
  ]
}

@christian-byrne christian-byrne merged commit 648a964 into core/1.41 Mar 8, 2026
32 checks passed
@christian-byrne christian-byrne deleted the backport-9542-to-core-1.41 branch March 8, 2026 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants