Skip to content

Add Gradient tool control bar buttons, Reverse Stops and Reverse Direction#3830

Merged
Keavon merged 2 commits intomasterfrom
gradient-reversal-buttons
Feb 25, 2026
Merged

Add Gradient tool control bar buttons, Reverse Stops and Reverse Direction#3830
Keavon merged 2 commits intomasterfrom
gradient-reversal-buttons

Conversation

@Keavon
Copy link
Member

@Keavon Keavon commented Feb 25, 2026

capture_49_.mp4

@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 enhances the Gradient tool by introducing new user interface controls for reversing gradient stops and direction. These additions provide more intuitive and direct manipulation of gradients, improving the overall user experience when working with fills. The changes include both the backend logic for these operations and the frontend integration into the tool's options bar, ensuring the UI dynamically reflects the current selection state.

Highlights

  • New Gradient Controls: Added 'Reverse Stops' and 'Reverse Direction' buttons to the Gradient tool's control bar, allowing users to easily manipulate gradient appearance.
  • Gradient Reversal Logic: Implemented core logic to reverse the order of color stops within a gradient and to swap the start and end points of a gradient, affecting its direction.
  • Dynamic UI State: Introduced a mechanism to track if a selected layer has a gradient, enabling or disabling the new gradient control buttons accordingly to provide clear user feedback.
Changelog
  • editor/src/messages/tool/tool_messages/gradient_tool.rs
    • Added ReverseStops and ReverseDirection variants to the GradientOptionsUpdate enum.
    • Implemented process_message logic to handle ReverseStops by reversing gradient color stops for selected layers.
    • Implemented process_message logic to handle ReverseDirection by swapping gradient start and end points for selected layers.
    • Introduced has_selected_gradient field to GradientToolData to track gradient presence on selected layers.
    • Added UI buttons for 'Reverse Stops' and 'Reverse Direction' to the Gradient tool's layout, with dynamic enabled/disabled states.
    • Added a new helper function has_gradient_on_selected_layers to determine if any selected layer contains a gradient.
    • Updated existing message processing to refresh tool options based on gradient selection changes.
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 adds 'Reverse Stops' and 'Reverse Direction' functionality to the Gradient tool, including control bar buttons. The implementation is mostly solid, and a specific suggestion has been provided to refactor duplicated code in the message handler for these new options, which will improve the code's maintainability.

@Keavon Keavon force-pushed the gradient-reversal-buttons branch from 4fd421a to d10c842 Compare February 25, 2026 07:40
@Keavon Keavon merged commit 8117ddc into master Feb 25, 2026
5 checks passed
@Keavon Keavon deleted the gradient-reversal-buttons branch February 25, 2026 08:48
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