fix(map): prevent style leak to new objects#251
Open
vuntz wants to merge 2 commits into
Open
Conversation
The styleChanged event is fired by many style-editing call sites (color pickers, format panel, action toggles). Each of those was mutating graph.currentVertexStyle / graph.currentEdgeStyle, so a color or other property applied to one cell leaked into the defaults used for subsequently inserted cells. Gate the current-style update on a new settingDefaultStyle flag that is only true around the styleChanged event fired from setDefaultStyle(). Other style edits no longer pollute the defaults; only the explicit "Set as Default Style" action does. Refs: MON-197924
Drokha
approved these changes
Jun 19, 2026
flcentreon
approved these changes
Jun 19, 2026
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
Fixes: MON-197924
In the MAP editor, customizing a property on a cell (border color, text
color, etc.) was leaking into the defaults applied to subsequently
created cells. The
styleChangedevent handler inEditorUi.jsmutates
graph.currentVertexStyle/graph.currentEdgeStyle, but theevent is fired by every style-editing call site (color pickers,
format panel, action toggles), not just the explicit "Set as Default
Style" action.
Gate the current-style update on a new
settingDefaultStyleflag thatis only true around the
styleChangedevent fired fromsetDefaultStyle(). Other style edits no longer pollute the defaults;only the explicit "Set as Default Style" action (Ctrl+Shift+D) updates
them.
Type of change
Target serie
How this pull request can be tested ?
Checklist