Skip to content

Make the node graph use Table<GradientStops> instead of GradientStops#3837

Merged
Keavon merged 6 commits intomasterfrom
table-gradient
Feb 26, 2026
Merged

Make the node graph use Table<GradientStops> instead of GradientStops#3837
Keavon merged 6 commits intomasterfrom
table-gradient

Conversation

@Keavon
Copy link
Member

@Keavon Keavon commented Feb 26, 2026

Partly closes #2779

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Keavon, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the internal representation and handling of gradient stops within the node graph system. By standardizing the use of Table<GradientStops> across various components, it aims to simplify the type system, streamline node implementations, and improve consistency. This change impacts how gradient values are stored, processed by nodes, and presented in the editor's property panels.

Highlights

  • Standardized GradientStops Usage: The node graph system has been refactored to consistently use Table<GradientStops> instead of bare GradientStops for gradient-related values, simplifying type handling and node implementations.
  • TaggedValue Refinement: The TaggedValue enum has been updated to remove ColorNotInTable and direct GradientStops variants, aligning with the new table-based approach for colors and gradients.
  • Node Definition Updates: Numerous node definitions across gcore, graphic, math, raster, and vector modules have been adjusted to accept and return Table<GradientStops> where GradientStops was previously used, including changes to default values and internal logic.
  • Migration and Widget Adjustments: Migration logic has been updated to consolidate GradientTableValueNode into GradientValueNode, and UI widget property handling for colors and gradients has been revised to reflect the new type structure.
Changelog
  • editor/src/messages/portfolio/document/node_graph/node_properties.rs
    • Reordered and consolidated Color and Option<Color> type handling.
    • Updated Table<GradientStops> and GradientStops type handling to reflect the new standardization.
    • Removed handling for TaggedValue::ColorNotInTable and TaggedValue::GradientStops within the color_widget function.
  • editor/src/messages/portfolio/document/node_graph/utility_types.rs
    • Removed TaggedValue::GradientStops from the FrontendGraphDataType mapping.
  • editor/src/messages/portfolio/document/utility_types/network_interface/resolved_types.rs
    • Removed TaggedValue::GradientStops from the TypeSource mapping.
  • editor/src/messages/portfolio/document_migration.rs
    • Removed the gradient_table_value node replacement.
    • Added aliases for GradientTableValueNode to the gradient_value node replacement.
  • node-graph/graph-craft/src/document/value.rs
    • Imported GradientStop.
    • Removed TaggedValue::ColorNotInTable and TaggedValue::GradientStops enum variants.
    • Added a new to_gradient helper function for parsing gradient strings.
    • Updated TaggedValue::from_type to handle Table<GradientStops> using the new to_gradient function.
    • Removed a test case related to ColorNotInTable.
  • node-graph/interpreted-executor/src/node_registry.rs
    • Adjusted the MonitorNode registration for GradientStops.
  • node-graph/libraries/rendering/src/renderer.rs
    • Consolidated import statements for graphic_types::raster_types and graphic_types::vector_types::gradient.
  • node-graph/node-macro/src/parsing.rs
    • Removed GradientStops from MonitorNode test macro implementations.
  • node-graph/nodes/gcore/src/animation.rs
    • Consolidated import statements for graphic_types.
    • Removed Context -> GradientStops from quantize_real_time and quantize_animation_time node implementations.
  • node-graph/nodes/gcore/src/context_modification.rs
    • Consolidated import statements for graphic_types.
    • Removed Context -> GradientStops from the context_modification node implementation.
  • node-graph/nodes/gcore/src/logic.rs
    • Consolidated import statements for graphic_types.
    • Changed Context -> GradientStops to Context -> Table<GradientStops> in switch node implementations.
  • node-graph/nodes/graphic/src/graphic.rs
    • Changed the return type of colors_to_gradient from GradientStops to Table<GradientStops>.
    • Updated colors_to_gradient logic to handle empty or single-color inputs and always return a Table<GradientStops>.
  • node-graph/nodes/math/src/lib.rs
    • Modified gradient_value to accept and return Table<GradientStops> with a default value.
    • Removed the gradient_table_value node.
    • Updated sample_gradient to accept Table<GradientStops> as input with a default and extract GradientStops from the table for evaluation.
  • node-graph/nodes/raster/src/adjustments.rs
    • Removed GradientStops from the list of types that various adjustment nodes (e.g., luminance, gamma_correction, hue_saturation) can directly operate on, implying Table<GradientStops> is now expected.
  • node-graph/nodes/raster/src/blending_nodes.rs
    • Removed GradientStops from the input types for blend and color_overlay nodes.
  • node-graph/nodes/raster/src/gradient_map.rs
    • Changed the gradient input to Table<GradientStops> with a default value.
    • Updated the gradient_map logic to extract GradientStops from the input table.
  • node-graph/nodes/vector/src/vector_nodes.rs
    • Changed the gradient input for assign_colors to Table<GradientStops> with a default value.
    • Updated assign_colors logic to extract GradientStops from the input table for processing.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
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 refactors the node graph to consistently use Table<GradientStops> instead of GradientStops directly. This change improves consistency with how other types like Color are handled. The refactoring touches many files, including node definitions, UI property generation, data type handling, and document migrations. The changes are logical and well-executed. I've found one minor issue in the colors_to_gradient node implementation, which I've commented on.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copy link

@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.

No issues found across 26 files

@Keavon Keavon merged commit f1cbc4b into master Feb 26, 2026
8 checks passed
@Keavon Keavon deleted the table-gradient branch February 26, 2026 22:07
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.

Paints as graphics

1 participant