Replace the control bar's stroke weight with a full stroke properties popover#4145
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive stroke options popover for drawing tools, allowing users to configure stroke alignment, caps, joins, miter limits, paint order, and dash patterns. It replaces the simple line weight input with a more robust UI, updates the DrawingToolState to track these new properties, and adds logic to synchronize these settings across selected layers. I have included a suggestion to optimize the cloning of dash lengths when syncing across multiple selected layers.
Contributor
There was a problem hiding this comment.
4 issues found across 14 files
Confidence score: 3/5
- There is moderate regression risk in selection-sync behavior: in
editor/src/messages/tool/common_functionality/color_selector.rs, stroke option defaults can be lost when an empty selection returns early without restoring tool-state values, which is user-facing in tool controls. - Two medium-severity sync/visibility issues in stroke handling (
editor/src/messages/tool/common_functionality/stroke_options.rsandeditor/src/messages/tool/common_functionality/graph_modification_utils.rs) can hide dash offset editing or drop selected layers from stroke-option sync when inputs are mixed or partially missing. - The
editor/src/messages/tool/tool_messages/freehand_tool.rsnote is low severity and maintenance-oriented (tool_data.weightdead state), so it is not a primary merge blocker by itself. - Pay close attention to
editor/src/messages/tool/common_functionality/color_selector.rs,editor/src/messages/tool/common_functionality/stroke_options.rs,editor/src/messages/tool/common_functionality/graph_modification_utils.rs- selection/stroke sync edge cases may cause incorrect or missing tool UI state.
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/tool/common_functionality/color_selector.rs">
<violation number="1" location="editor/src/messages/tool/common_functionality/color_selector.rs:313">
P2: Stroke option defaults are lost after selection sync because empty selection returns early without restoring tool-state values.</violation>
</file>
<file name="editor/src/messages/tool/common_functionality/stroke_options.rs">
<violation number="1" location="editor/src/messages/tool/common_functionality/stroke_options.rs:58">
P2: Mixed dash selections hide the dash offset control because `effective_dash_lengths()` converts `None` to empty. This prevents editing offset when dash lengths are mixed across selected layers.</violation>
</file>
<file name="editor/src/messages/tool/common_functionality/graph_modification_utils.rs">
<violation number="1" location="editor/src/messages/tool/common_functionality/graph_modification_utils.rs:514">
P2: `get_stroke_options()` returns `None` when any single stroke input is missing, not just when the Stroke node is absent, causing selected layers to be dropped from stroke-option sync.</violation>
</file>
<file name="editor/src/messages/tool/tool_messages/freehand_tool.rs">
<violation number="1" location="editor/src/messages/tool/tool_messages/freehand_tool.rs:307">
P3: This change leaves `tool_data.weight` as dead state (written but never used), which adds misleading state and maintenance overhead.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
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.
Closes #2356.