Sync base Node/Edge params (label/style/type/...) to the frontend - #71
Merged
Conversation
Assigning label, style, type, className, markerEnd, sourceHandle, or targetHandle on a live Node/Edge instance was a silent no-op: only subclass-defined data params were watched and pushed to the frontend, so base params only reached the DOM after a full flow.nodes/flow.edges reassignment (fixes hoxbro/panel-multi#60). - Node/Edge now declare _TOP_LEVEL_SYNC_PARAMS, the base params that map to top-level React Flow fields rather than arbitrary data keys. - Param watcher setup/teardown for nodes and edges is unified into one generic _update_param_watchers/_on_synced_param_change pair instead of four near-duplicate methods. - patch_node_data/patch_edge_data split a patch into top-level vs data keys via a shared _apply_data_patch helper, and send that same split ("patch" + "top_patch") to the frontend so reactflow.jsx doesn't need its own copy of which keys are top-level to stay in sync. - Also fixes a side effect where patch_edge_data(..., {"label": ...}) left a phantom "label" key in edge.data instead of updating edge.label. Adds a UI regression test asserting direct attribute assignment updates the DOM immediately, including that style=None clears back to default. Assisted-by: Kilo:anthropic/claude-sonnet-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Assigning label, style, type, className, markerEnd, sourceHandle, or targetHandle on a live Node/Edge instance was a silent no-op: only subclass-defined data params were watched and pushed to the frontend, so base params only reached the DOM after a full flow.nodes/flow.edges reassignment.
Adds a UI regression test asserting direct attribute assignment updates the DOM immediately, including that style=None clears back to default.
AI Disclosure
Tool & Model: Kilo:anthropic/claude-sonnet-5
Usage:
Checklist