Make the drawing tools' Weight control sync with the selected layer#4120
Make the drawing tools' Weight control sync with the selected layer#4120
Conversation
There was a problem hiding this comment.
1 issue found across 7 files
Confidence score: 3/5
- There is a concrete sync risk in
editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs: stroke-deletion detection only inspects explicitnode_ids, so stroke nodes removed indirectly throughdelete_childrencan be missed. - Because this is a medium-severity, high-confidence logic gap (6/10, 8/10), it could cause user-visible inconsistency where deleted strokes are not fully synchronized.
- This PR likely needs a targeted fix or follow-up before relying on deletion behavior in nested node removal paths.
- Pay close attention to
editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs- indirect child deletions may bypass stroke-node deletion syncing.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs">
<violation number="1" location="editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs:360">
P2: Stroke-deletion sync misses stroke nodes removed indirectly via `delete_children`, because detection only checks the explicit `node_ids` list.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
Code Review
This pull request implements stroke weight synchronization between tool options and selected layers for the Pen, Freehand, Spline, and Shape tools. It introduces helper functions in graph_modification_utils.rs and updates message handlers to trigger UI updates upon selection or value changes. Review feedback points out a critical syntax error in pen_tool.rs regarding the use of let bindings in a boolean chain and suggests refactoring duplicated logic for tool notifications and option updates across several files to improve maintainability.
No description provided.