Skip to content

Add curvature dials to gradients, extending SVG 2's focal radial gradients - #5069

Open
Keavon wants to merge 1 commit into
masterfrom
cone-dial-gradients
Open

Keavon wants to merge 1 commit into
masterfrom
cone-dial-gradients

Conversation

@Keavon

@Keavon Keavon commented Dec 4, 2026

Copy link
Copy Markdown
Member

No description provided.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

8 issues found across 22 files

Confidence score: 2/5

  • utility_types.rs can insert a curvature node without writing its dials when a non-linear form is selected on a chain without one, leaving the new inputs without concrete values. Ensure the inserted dials are initialized.
  • gradient_curvature_from_gradient_form.rs cannot deserialize the legacy GradientType tag, so old radial inputs fall back to linear presets. Add the matching serde alias.
  • gradient_tool.rs assigns custom curvature chains GradientForm::Linear, so the tool renders and edits their stops and midpoints on a straight line instead of the contours. Preserve the custom form when handling these chains.
  • renderer.rs passes Repeat and Reflect directly to dialed gradient layers, which can produce SVG output that does not follow SVG 2 dial-specific limits. Resolve the dial geometry with pad semantics before repeating or reflecting.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="editor/src/messages/portfolio/document/graph_operation/utility_types.rs">

<violation number="1" location="editor/src/messages/portfolio/document/graph_operation/utility_types.rs:778">
P1: Selecting a non-linear form on a chain without a curvature node can insert the node but never write its dials: the newly created inputs are not guaranteed to be concrete numbers, so `gradient_curvature_values` returns `None` and this early return leaves the gradient linear. Track whether the node was newly created and initialize its two dials, while retaining the early return for wired or exposed inputs on existing nodes.</violation>
</file>

<file name="document/migrations/nodes/src/math_nodes/gradient_curvature_from_gradient_form.rs">

<violation number="1" location="document/migrations/nodes/src/math_nodes/gradient_curvature_from_gradient_form.rs:10">
P1: `Tagged` cannot deserialize the legacy `GradientType` tag. Add the same serde alias as `TaggedValue::GradientForm`; otherwise old radial inputs fall through to linear presets.</violation>
</file>

<file name="editor/src/messages/tool/tool_messages/gradient_tool.rs">

<violation number="1" location="editor/src/messages/tool/tool_messages/gradient_tool.rs:469">
P2: Custom curvature chains are assigned `GradientForm::Linear` here, so the tool renders and edits their stops and midpoints on a straight unit line. `DialGradient::t` maps points to parameters along the contours, so inserting or dragging a stop can target the wrong parameter; compute controls from the dialed contours or disable those edits until they are supported.

(Based on your team's feedback about fulfilling TODO-documented behavior instead of leaving the underlying issue unresolved.) [55994a11-23d5-432b-87c6-b3e2ed7d5e60]</violation>
</file>

<file name="node-graph/libraries/vector-types/src/dial_gradient.rs">

<violation number="1" location="node-graph/libraries/vector-types/src/dial_gradient.rs:40">
P2: Negative dials that flatten into a line lose their sign here: `dial_radius` returns `+∞` for a large negative radius, so `DialGradient::new` selects the inward line limit. Preserve the sign and use it to select the away/inward limit; otherwise near-zero negative curvature renders the wrong half-plane when gaps are unfilled.</violation>

<violation number="2" location="node-graph/libraries/vector-types/src/dial_gradient.rs:78">
P2: This degenerate tangent case drops a valid cone root: when `a`, `b`, and `c` are all zero, every interpolated circle passes through the point up to the radius-zero endpoint, but the `b != 0` guard returns `None`. Return the last valid radius-zero `t` (for example, `-start_radius / delta_radius`) when `c == 0` and `delta_radius != 0` to avoid a transparent seam at the tangent point.</violation>
</file>

<file name="node-graph/libraries/rendering/src/renderer.rs">

<violation number="1" location="node-graph/libraries/rendering/src/renderer.rs:3255">
P2: Reversed dial ramps discard every stop's `graphite:midpoint` metadata. Preserve the midpoint on the corresponding reversed interval, transforming its position for the reversed direction, so SVG export does not lose user-defined stop interpolation settings.</violation>

<violation number="2" location="node-graph/libraries/rendering/src/renderer.rs:3327">
P2: Dialed gradients pass `Repeat` and `Reflect` directly into their cone and ramp layers, but SVG 2 requires their dial-specific limits to be resolved before repeating or reflecting. Apply the dial geometry with pad semantics first, then spread the resulting field so repeated boundaries keep the correct coverage and colors.</violation>
</file>

<file name="editor/src/messages/portfolio/document_migration.rs">

<violation number="1" location="editor/src/messages/portfolio/document_migration.rs:1725">
P2: This migration drops the legacy form input's exposed state by always creating both curvature inputs with `exposed: false`. Preserve `exposed: true` when the old form was an exposed `NodeInput::Value`; otherwise migrated documents lose their externally controlled gradient form and the new tool misclassifies it as fixed.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 6 files (changes from recent commits).

Confidence score: 3/5

  • The migration in document/migrations/nodes/src/graphene_core/passthrough_from_read_attribute_gradient_form_node.rs does not handle documents using the legacy ReadAttributeGradientTypeNode alias, so they may fail to migrate. Add the equivalent ReadAttributeGradientTypeNode@1 to PassthroughNode@2 mapping.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="document/migrations/nodes/src/graphene_core/passthrough_from_read_attribute_gradient_form_node.rs">

<violation number="1" location="document/migrations/nodes/src/graphene_core/passthrough_from_read_attribute_gradient_form_node.rs:4">
P1: This migration omits the legacy `ReadAttributeGradientTypeNode` alias, which the existing document migration explicitly supports. Register an equivalent `ReadAttributeGradientTypeNode@1` to `PassthroughNode@2` migration and cover it with a test, otherwise those documents can retain an obsolete node after migration.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

This branch was successfully deployed

1 active deployment
graphite-dev (Preview) — 3eb1f230 Deployed Dec 4, 2026 by github-actions[bot]
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.

1 participant