fix: promoted textarea widgets in subgraphs no longer permanently read-only#9124
fix: promoted textarea widgets in subgraphs no longer permanently read-only#9124christian-byrne wants to merge 1 commit intomainfrom
Conversation
…d-only Skip disabled override for promoted widgets whose internal slot is linked to SubgraphInput. Extract isPromotedOnOwningNode variable and reuse it for the existing borderStyle check. Amp-Thread-ID: https://ampcode.com/threads/T-019c88b8-a377-754b-b624-db394d59f5b5
🎨 Storybook: ✅ Built — View Storybook |
🎭 Playwright: ✅ 531 passed, 0 failed · 2 flaky📊 Browser Reports
|
📝 WalkthroughWalkthroughFixed widget disable behavior when linked, ensuring promoted widgets within subgraphs remain interactive. Updated conditional logic in NodeWidgets.vue to skip disable overrides for promoted widgets. Refactored WidgetTextarea test suite by removing readonly parameter from helper function and added comprehensive readonly/disabled behavior verification tests. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
📦 Bundle: 4.37 MB gzip 🔴 +125 BDetailsSummary
Category Glance App Entry Points — 17.9 kB (baseline 17.9 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 916 kB (baseline 916 kB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 68.8 kB (baseline 68.8 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 9 added / 9 removed Panels & Settings — 436 kB (baseline 436 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 10 added / 10 removed User & Accounts — 16 kB (baseline 16 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 5 added / 5 removed Editors & Dialogs — 738 B (baseline 738 B) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 1 added / 1 removed UI Components — 47 kB (baseline 47 kB) • ⚪ 0 BReusable component library chunks
Status: 5 added / 5 removed Data & Services — 2.51 MB (baseline 2.51 MB) • 🔴 +86 BStores, services, APIs, and repositories
Status: 13 added / 13 removed Utilities & Hooks — 58.3 kB (baseline 58.3 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 12 added / 12 removed Vendor & Third-Party — 8.83 MB (baseline 8.83 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 7.62 MB (baseline 7.62 MB) • ⚪ 0 BBundles that do not match a named category
Status: 48 added / 48 removed |
christian-byrne
left a comment
There was a problem hiding this comment.
I believe this is a fundamental misunderstanding of the bug and the desired UX
| ? { ...storeOptions, disabled: true } | ||
| : storeOptions | ||
| const isPromotedOnOwningNode = | ||
| widgetState?.promoted && String(widgetState?.nodeId) === String(nodeId) |
There was a problem hiding this comment.
I might be wrong, but IMHO,
nodeId (from nodeData.id) includes the graph prefix in subgraphs (e.g. "3:5"), while widgetState?.nodeId from the store is typically the bare ID (e.g. "5"). This means the check would always be false inside subgraphs, so promoted widgets could still end up disabled.
Since bareWidgetId on line 189 already strips the prefix, would something like this work?
const isPromotedOnOwningNode =
widgetState?.promoted && String(widgetState?.nodeId) === bareWidgetIdThat way both sides are compared as bare IDs regardless of graph depth.
|
Closing — need to re-evaluate against the proxy-widget-v2 refactor (#8856) that just landed, and re-examine the actual bug (reactivity on disconnect, not permanent read-only). |
Summary
Promoted textarea widgets inside subgraphs were permanently read-only because
disabled: truewas unconditionally injected when the widget's input slot was linked.Changes
NodeWidgets.vue, extractisPromotedOnOwningNodecheck and skip thedisabled: trueoverride for promoted widgets whose slot is internally linked to a SubgraphInput node. Reuse the same variable for the existingborderStylecondition (was duplicated). Add 4 unit tests forWidgetTextarearead-only behavior. Remove deadreadonlyprop parameter from test helper.Review Focus
The
isPromotedOnOwningNodeguard uses anodeIdcomparison (String(widgetState?.nodeId) === String(nodeId)) to distinguish promoted widgets on their owning node (should be interactive) from proxy widgets on the SubgraphNode (should remain disabled). This fix benefits all promoted widget types (combos, numbers, etc.), not just textareas.Fixes #8818
┆Issue is synchronized with this Notion page by Unito