Repository navigation
Conversation
…host widgets Rename WidgetEntityId to WidgetId throughout, delete widgetValueIO in favor of a WidgetId-native widgetValueStore, and represent subgraph promoted host widgets as store-backed widget state addressed by input.widgetId. Migrate runtime consumers (graph node manager, processed widgets, right-side panel, price/error utilities) toward widget-id state.
…omotedWidgetView The render-key prefix was cosmetic and the host-widget resolver's promoted-chain following was unreachable (subgraph host widgets never populate node.widgets). Reduce both to view-free lookups and drop the obsolete chain-following tests.
The type rename WidgetEntityId->WidgetId left the widget field still named entityId. Drop the entityId aliases on IBaseWidget/BaseWidget/PromotedWidgetView and SafeWidgetData, and read widget.widgetId everywhere. Source widget name from widget state when present so promoted host widgets render their canonical identity instead of stale data.
SubgraphNode.widgets is empty, so the host-wins semantics tests can no longer find the view there. Construct it via createPromotedWidgetView, mirroring how useGraphNodeManager builds the synth view.
Promoted host widgets no longer surface as views on the subgraph node, so onWidgetChanged never receives one. Remove resolvePromotedExecId and clear errors using the node's own execution id. Drop the obsolete test that drove clearing through a host-side promoted view.
getInputSpecForWidget resolved promoted views to read the source widget's options. With host widgets store-backed, build the input spec from the widget's widgetId state options (default, etc.) instead of following a view.
The panel read promoted views off node.widgets, which is now empty. Build the synth views from subgraph inputs carrying a widgetId (mirroring useGraphNodeManager) so promoted rows, reorder, and demote work against store-backed host widgets. Update tests to assert on promoted inputs.
draw.ts and BaseWidget.ts imported the LiteGraph singleton from the barrel, which re-entered the barrel during BaseWidget initialization and evaluated LegacyWidget extends BaseWidget before BaseWidget was defined (crashing any entry that loaded a widget before the barrel, e.g. useGraphNodeManager tests). Add a leaf litegraphInstance holder (type-only import) read at runtime via litegraph(); the barrel constructs and registers the instance.
SubgraphNode.widgets is now always empty (host widgets are store-backed), and widget state nodeId is the string parsed from the widget id. Fix the BaseWidget nodeId assertion, drop the stale subgraphNode.widgets assertion in SubgraphIO (inputs already cover it), and remove the obsolete manual-widget-injection test.
The impl now calls getWidget(widgetId(graphId, nodeId, name)); the test mock still used the old three-arg signature and looked up by the wrong key. Extract the widget name from the widget id.
Remove the obsolete test that drove mapping through a persistent promoted view on node.widgets (now empty; duplicate-named distinct identity is covered elsewhere). Skip the two-layer nested promotion test as a documented known limitation pending multi-level resolution support.
Amp-Thread-ID: https://ampcode.com/threads/T-019e8af0-a3a2-7713-ba7e-a5579938f388 Co-authored-by: Amp <amp@ampcode.com>
Map promoted subgraph inputs to SafeWidgetData directly from input.widgetId, the resolved interior source widget, and widget state, instead of constructing an ephemeral PromotedWidgetView per input.
Replace the per-input PromotedWidgetView with a source descriptor built from node inputs, and demote linked promotions by source via demotePromotedInput.
The nested-subgraph branch of resolveSourceWidget now returns a plain source ref (name/type/options/value/widgetId) instead of a PromotedWidgetView; getSlotFromWidget still locates the backing slot by widgetId.
Make resolveConcretePromotedWidget descend through subgraph inputs instead of following synthetic widget views, so two-layer promotions resolve to the deepest concrete widget. SubgraphNode assigns a widgetId to inputs whose source is itself a promoted subgraph input, and dispatches the concrete interior widget (not a view) on widget-promoted.
Remove the synthetic promoted-widget view class and PromotedWidgetViewManager. Promoted host widgets are fully store-backed by widgetId, so the now-dead isPromotedWidgetView branches over node.widgets/input._widget collapse to the plain path. SubgraphNode loses its view machinery; getSlotFromWidget matches by widgetId. Resolve the legacy selectedInput migration via resolveSubgraphInputTarget. The structural isPromotedWidgetView guard and PromotedWidgetView type remain in promotedWidgetTypes for the right-panel parameter components, pending their store-driven rewrite.
Build store-backed parameter rows for a subgraph node's promoted inputs from node.inputs, unified with ordinary node widgets: display resolves through the host widgetId and value writes go through widgetValueStore. Route the panel's value write through widgetId so promoted inputs persist.
The promoted host widget is no longer a synthetic view; reduce the type to the promoted-source shape and rename the structural guard to isPromotedWidget.
buildPromotedWidget read the store value at build time, so the row-list computed reactively rebuilt on every edit, producing new descriptor objects and churning getStableWidgetRenderKey — re-rendering the whole panel. Read type/value/options through live getters instead so identity stays stable and value updates in place.
Add src/core/graph/subgraph/promotedInputWidget.ts as the single projection from a subgraph input slot to an ordinary store-backed widget descriptor, and route useGraphNodeManager through it (promotedInputWidgets + the shared safeWidgetMapper), deleting the hand-rolled promotedInputToSafeWidget. A projected widget name is now the input slot name (stable, unique, the widgetId derives from it); the interior source widget name is carried separately on SafeWidgetData (sourceWidgetName) only for missing-model lookups, which key by the interior name. Drop the redundant slotName and promotedLabel fields.
Replace the hand-rolled promoted-widget builders in TabSubgraphInputs (buildPromotedWidget/getPromotedWidgets) and SubgraphEditor (buildPromotedDescriptors + PromotedDescriptor) with promotedInputWidgets /promotedInputWidget. SubgraphEditor rows now carry the projected widget plus the host input slot and resolve their interior source on demand for demote/re-promote, so no source identity is denormalized onto the rows.
…Widget Replace the isPromotedWidget duck-type and the source fields read off widget objects with widgetPromotedSource(node, widget) in WidgetActions (isLinked/handleHideInput) and SectionWidgets (isWidgetShownOnParents). getInputSpecForWidget now resolves the real interior node-definition spec for a subgraph node instead of fabricating one from store options, and renameWidget collapses to a widgetId-keyed label-only write that never touches name/widgetId. Delete the now-unused PromotedWidget type and isPromotedWidget guard.
resolveSourceWidget builds the nested-subgraph source widget via promotedInputWidget instead of a hand-rolled `as IBaseWidget` literal carrying source fields. Consolidate the two bespoke promoted-widget test helpers in promotionUtils.test into one thin wrapper over the real projection, dropping the synthetic source-field shapes. PromotedWidgetSource is now confined to the migration/schema layer where promotion sources are persisted tuples rather than link-derivable.
getPromotedWidgets inspected widget.sourceNodeId/sourceWidgetName on node.widgets, a denormalization the store-backed WidgetId refactor removed, so it returned empty for every promoted widget. Resolve promoted widgets from node.inputs by widgetId and walk the subgraph input link for source identity, mirroring promotedInputWidgets and resolveSubgraphInputTarget. Public helper API is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019ea366-1ffc-75da-9467-3da7c4567614 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019ea366-1ffc-75da-9467-3da7c4567614 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019ea366-1ffc-75da-9467-3da7c4567614 Co-authored-by: Amp <amp@ampcode.com>
# Conflicts: # src/composables/graph/useErrorClearingHooks.test.ts # src/composables/graph/useErrorClearingHooks.ts
…tled Creating the DOMWidgetImpl during clone/configure used a transient node id, seeding wrong nested values and leaking duplicate DOM widgets. Guard on graph membership so the real widget is built on the post-settle resolution pass. Rewrite subgraph tests to assert user-visible textboxes instead of internal graph state. Amp-Thread-ID: https://ampcode.com/threads/T-019eb3aa-6bcd-7528-857c-1ff02c329af3 Co-authored-by: Amp <amp@ampcode.com>
Covers the fresh interactive-add path alongside the existing load and clone coverage. The prior conversion test only checked internal promoted-widget state; this asserts the user-visible textbox appears exactly once, catching both a missing widget and the duplicate-DOM-widget leak. Amp-Thread-ID: https://ampcode.com/threads/T-019eb3aa-6bcd-7528-857c-1ff02c329af3 Co-authored-by: Amp <amp@ampcode.com>
Replace per-widget control closures with an ECS-style component in the widget value store. Control state is keyed by WidgetId, registration is deferred like value registration, and values advance via a System scoped to the queued graph. - Add WidgetControlState component + store registration/scoping - Add runWidgetControl System (graph-scoped, before/after phases) - Sync controls + link state via installWidgetControlHooks - Move control modules under core/graph/widgets/control - Remove promotedWidgetControl special-casing Amp-Thread-ID: https://ampcode.com/threads/T-019eb9d7-e812-7259-99c1-5188944fae57 Co-authored-by: Amp <amp@ampcode.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## drjkl/no-promotions #12816 +/- ##
=======================================================
+ Coverage 61.71% 61.74% +0.03%
=======================================================
Files 1453 1454 +1
Lines 74819 74831 +12
Branches 19465 19462 -3
=======================================================
+ Hits 46174 46206 +32
+ Misses 28292 28272 -20
Partials 353 353
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Note Unit test generation is a public access feature. Expect some limitations and changes as we gather feedback and continue to improve it. Generating unit tests... This may take up to 20 minutes. |
|
✅ Created PR with unit tests: #12817 |
Replace the ~180-line widget-control hooks installer with control registration that piggybacks on widget value registration. - Register control in BaseWidget.setNodeId and SubgraphNode._setWidget (thread interior node), deriving control/filter ids from nodeId + name - Resolve link-fed suppression live in runWidgetControl via one graph pass - Delete useWidgetControlHooks + GraphCanvas wiring, setInputLinked, and WidgetState.inputLinked - Move isValueControlWidget into the controlWidgetMarker leaf module Amp-Thread-ID: https://ampcode.com/threads/T-019eb9d7-e812-7259-99c1-5188944fae57 Co-authored-by: Amp <amp@ampcode.com>
Render widget control from the store WidgetControlState keyed by the widget's own widgetId instead of scanning linkedWidgets, so regular and promoted widgets resolve control uniformly without tracing into a subgraph interior. On promotion, mint an independent host-local control (and filter) entity seeded once from the interior widget, then queried/advanced purely by its own ids. Persist the host control mode via a dedicated properties.promotedControls entry, serialized and restored on configure. linkedWidgets remains only as a construction-time discovery detail; its non-control uses (bounding-box subwidgets, widget<->input conversion, group nodes) are untouched. Amp-Thread-ID: https://ampcode.com/threads/T-019eb9d7-e812-7259-99c1-5188944fae57 Co-authored-by: Amp <amp@ampcode.com>
Remove the separate promoted-control registration and persistence paths. A promoted controllable widget now mints host-local control/filter widgets that are plain store-backed host widgets surfaced by SubgraphNode.widgets in order [target, control, filter], registered through the same syncWidgetControl used by every node and persisted through the same widgets_values array (controls have widget.serialize default). configure() restores in one ordered pass with legacy detection for older target-only widgets_values, preserving the quarantine override. Deletes promoteWidgetControl and the properties.promotedControls schema/serialize/ restore special-casing. linkedWidgets remains only a construction-time discovery detail. Amp-Thread-ID: https://ampcode.com/threads/T-019eb9d7-e812-7259-99c1-5188944fae57 Co-authored-by: Amp <amp@ampcode.com>
Widget control state (mode, filter, hasExecuted) is now an ECS component keyed by the target widget's WidgetId in widgetValueStore, replacing the control/filter widget entities and the IS_CONTROL_WIDGET marker. - Defer control registration like value registration: widgets carry a transient controlConfig, registered in BaseWidget.setNodeId. - Preserve the positional [target, mode, filter?] widgets_values layout via serialize/configure interleaving (no control widgets resurrected). - Promotion copies the interior control component once onto the host target, then diverges independently; no promoted/non-promoted distinction. - Remove controlWidgetMarker, syncWidgetControl, the GraphCanvas control-label sweep, and control-widget creation in addValueControlWidget(s). Amp-Thread-ID: https://ampcode.com/threads/T-019eb9d7-e812-7259-99c1-5188944fae57 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019eb9d7-e812-7259-99c1-5188944fae57 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019eb9d7-e812-7259-99c1-5188944fae57 Co-authored-by: Amp <amp@ampcode.com>
… hole Amp-Thread-ID: https://ampcode.com/threads/T-019eb9d7-e812-7259-99c1-5188944fae57 Co-authored-by: Amp <amp@ampcode.com>
Collapse the distributed control lifecycle under src/core/graph/widgets/control/: merge registration and positional (de)serialization into widgetControl.ts, and move widgetControlSystem.ts into the same folder. valueControl.ts stays a pure leaf (widgetState.ts imports its type) and runWidgetControl stays separate so litegraph serialization does not transitively import settingStore. Reuse the canonical applyControlValues bridge in widgetInputs.ts, replacing two hand-rolled positional [mode, filter] decode blocks so the layout is decoded in one place instead of three. Amp-Thread-ID: https://ampcode.com/threads/T-019ec02d-e454-72b9-bf54-3c2912898cc8 Co-authored-by: Amp <amp@ampcode.com>
- Collapse setControlMode/setControlFilter/setControlExecuted into one updateWidgetControl(targetId, patch) store action - Remove dead after-mode hasExecuted write in runWidgetControl - Un-export internal-only WidgetControlPhase and ValueControlTarget - Replace 'as never' cast with 'as ValueControlMode' Amp-Thread-ID: https://ampcode.com/threads/T-019ec073-d520-774a-9529-5b6b932336e8 Co-authored-by: Amp <amp@ampcode.com>
🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measureExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight This candidate changes nothing the matrix measures, so every expensive stage was skipped. Reproduce locally# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
npx vitest run --config vitest.matrix.config.mts
Full docs: scripts/registry-census/README.md 🌾 Fallow: ✅ PassedFallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened. No new findings in the changed files. Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since 0859c16eb97db188f25f4fbc500d34302cc5129e
Full docs: ADR-DEVEX-LINT-0015 |
|
This draft now has zero changed files against |
|
Closing as a proven no-op: this PR's head tree ( |
Summary
Replace the per-widget control-value closures with a store-backed, ECS-style control system: control status is a component keyed by
WidgetIdin the widget value store, and values advance via a System scoped to the queued graph.Changes
WidgetControlStatecomponent + registration/scoping inwidgetValueStore(deferred like value registration;hasExecutedpreserved across re-registration).runWidgetControlSystem (graph-scoped viarootGraph.id,before/afterphases).installWidgetControlHooks(node add/remove/connection change), restoring node callbacks on uninstall.core/graph/widgets/control/(valueControl,controlWidgetMarker,useWidgetControlHooks).promotedWidgetControlspecial-casing inapp.ts/widgets.ts.widget.callback.Review Focus
runWidgetControl(all widgets, including subgraph interiors, key byrootGraph.id).hasExecutedpreservation on re-sync so before-mode "skip first run" isn't reset by connection changes.currentGraphreinstall.Stacked on
drjkl/no-promotions.