Skip to content

feat(sketch tool): add redo for the sketch tool - #3661

Merged
rodolforg merged 2 commits into
synfig:masterfrom
Abdelhadi-Wael:redo-for-sketch
Feb 5, 2026
Merged

rodolforg merged 2 commits into
synfig:masterfrom
Abdelhadi-Wael:redo-for-sketch

Conversation

@Abdelhadi-Wael

Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @Abdelhadi-Wael, 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 user experience of the sketch tool by implementing a 'redo' feature. This allows users to recover from accidental 'undo' operations, providing a more forgiving and flexible drawing environment. The changes involve fundamental modifications to how stroke history is managed, the addition of new data structures, and the integration of a user-friendly interface element.

Highlights

  • Redo Functionality: Introduced a 'redo' feature for the sketch tool, allowing users to reverse previously undone drawing actions.
  • Redo History Management: Added a dedicated redo_stroke_list to store strokes that have been undone, enabling them to be redone.
  • UI Integration: Integrated a 'Redo Last Stroke' button into the sketch tool's options panel, providing an accessible way to utilize the new functionality.
  • Undo/Redo Logic: Modified the undo_stroke function to move strokes to the redo_stroke_list and implemented the redo_stroke function to restore them. The redo history is cleared when new strokes are drawn or all persistent strokes are cleared, adhering to standard undo/redo behavior.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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

@github-actions

Copy link
Copy Markdown

Thank you for contributing!
Below is how your contribution will appear in Synfig's release notes. Review it and improve your pull request's title and description so that your contribution is clear. You can add images, videos, and anything else you want. Have fun!

✨ New Features

  • (Sketch tool Related) Add redo for the sketch tool

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

Copy link
Copy Markdown

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 'redo' functionality for the sketch tool, which is a valuable addition. The implementation correctly mirrors the existing 'undo' logic by managing a redo stack. My review focuses on improving code maintainability and efficiency. I've suggested using std::list::splice for more efficient element transfers between lists and refactoring duplicated code into a helper function to enhance readability and reduce redundancy.

Comment thread synfig-studio/src/gui/duckmatic.h Resolved
Comment thread synfig-studio/src/gui/duckmatic.h Resolved
@rodolforg

Copy link
Copy Markdown
Contributor

Although I approved, maybe the Redo button should be next the Undo button, not with Clear button in the middle of them.
image

@Abdelhadi-Wael

Copy link
Copy Markdown
Contributor Author

Weird, they are in the correct order, in the code and on my build!

image image

@rodolforg
rodolforg merged commit 3647833 into synfig:master Feb 5, 2026
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.

2 participants