Skip to content

Replace the control bar's stroke weight with a full stroke properties popover#4145

Merged
Keavon merged 2 commits into
masterfrom
stroke-properties-popover
May 13, 2026
Merged

Replace the control bar's stroke weight with a full stroke properties popover#4145
Keavon merged 2 commits into
masterfrom
stroke-properties-popover

Conversation

@Keavon
Copy link
Copy Markdown
Member

@Keavon Keavon commented May 13, 2026

Closes #2356.

image

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread editor/src/messages/tool/common_functionality/color_selector.rs Outdated
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.rs and editor/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.rs note is low severity and maintenance-oriented (tool_data.weight dead 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.

Comment thread editor/src/messages/tool/common_functionality/color_selector.rs
Comment thread editor/src/messages/tool/common_functionality/stroke_options.rs Outdated
Comment thread editor/src/messages/tool/common_functionality/graph_modification_utils.rs Outdated
Comment thread editor/src/messages/tool/tool_messages/freehand_tool.rs
@Keavon Keavon merged commit 4d5dce9 into master May 13, 2026
11 checks passed
@Keavon Keavon deleted the stroke-properties-popover branch May 13, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redesigned vector tool fill/stroke selection in relation to the working colors and selected layers

1 participant