Refactor Fill/Stroke to use graphic-list values in attributes#4257
Refactor Fill/Stroke to use graphic-list values in attributes#4257YohYamasaki wants to merge 17 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the Fill and Stroke nodes to use a modern value-model, introducing the type-erased AnyGraphicListDyn to accept various renderable list types without monomorphization. It updates properties UI, document migration logic, and tests to align with these changes. Feedback on the changes highlights an issue where setting a gradient fill on a previously node-connected input fails to utilize the new value-model because get_fill_node_id_with_value returns None. To resolve this, it is suggested to explicitly set the FillInput to a literal Gradient value at the start of the Fill::Gradient match arm to disconnect any upstream node.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
235f417 to
93582a3
Compare
…crete types Store fill/stroke paints as List<Graphic> so Color/Gradient transitions do not hit set_attribute_value_dyn's type-mismatch fallback to default paint.
a6c43a5 to
1eba280
Compare
There was a problem hiding this comment.
6 issues found across 30 files
Confidence score: 2/5
- In
node-graph/interpreted-executor/src/node_registry.rs,AnyGraphicListDynis registered forMonitorNodebut notMemoizeNode, which can cause runtime constructor lookup failures when memoization is needed and break graph execution paths—add the missingMemoizeNoderegistration and a targeted runtime lookup test before merging. - In
editor/src/messages/portfolio/document/graph_operation/utility_types.rs, usingset_inputwhen creating a missing gradient value node can overwrite an existing upstream link instead of splicing into it, potentially disconnecting gradient transform/type/spread nodes and corrupting document graphs—switch to splice-style insertion and cover this with a graph rewiring test. - In
node-graph/libraries/vector-types/src/gradient.rs,initial_gradient_transform_for_bboxignores bbox vertical position/height, so gradients can render with incorrect placement and scale for many shapes—include Y/height in the transform calculation and verify with bbox-based rendering/unit tests. - In
editor/src/messages/portfolio/document_migration.rs, fill migration drops the originalexposedstate, andeditor/src/messages/tool/tool_messages/fill_tool.rstests now only check the first fill entry, which can let invalid multi-entry/stale fill states slip through—preserveexposedduring migration and tighten tests to enforce the expected simple solid fill semantics.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
2 issues found across 19 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 19 files (changes from recent commits).
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/tool_messages/gradient_tool.rs">
<violation number="1" location="editor/src/messages/tool/tool_messages/gradient_tool.rs:373">
P2: Legacy document upgrade regression: missing `TransformInput` on Fill nodes now falls back to `DAffine2::IDENTITY` instead of `initial_gradient_transform_for_bbox`, breaking gradient positioning for pre-refactor documents.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
Part of #2779
This PR refactors fill and stroke for
Vectorto use graphic-list values in attributes instead of the legacyFillenum andStroke.colorthroughout the graph flow.fill-stroke-with-graphic-list.mp4
Notes
List<Graphic>attributes.Strokestruct, but move the paint itself to thestrokeattribute.