Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EAGLE-1263: Add undo snapshot after adding edge between two nodes #719

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

james-strauss-uwa
Copy link
Collaborator

@james-strauss-uwa james-strauss-uwa commented Jul 3, 2024

Summary by Sourcery

This pull request introduces a new feature that creates an undo snapshot whenever an edge is added between two nodes in the graph. This ensures that users can revert the action if needed.

  • New Features:
    • Added functionality to create an undo snapshot after adding an edge between two nodes.

Copy link
Contributor

sourcery-ai bot commented Jul 3, 2024

Reviewer's Guide by Sourcery

This pull request implements an undo snapshot feature in the GraphRenderer class. Specifically, after an edge is added between two nodes, a snapshot is pushed to the undo stack with a descriptive message. This ensures that the action can be undone if necessary.

File-Level Changes

Files Changes
src/GraphRenderer.ts Introduced an undo snapshot feature after adding an edge between two nodes.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

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

Hey @james-strauss-uwa - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@@ -2144,6 +2144,7 @@ export class GraphRenderer {

eagle.addEdge(srcNode, srcPort, destNode, destPort, loopAware, closesLoop, (edge : Edge) : void => {
eagle.checkGraph();
eagle.undo().pushSnapshot(eagle, "Added edge from " + srcNode.getName() + " to " + destNode.getName());
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Consider using template literals for string concatenation.

Using template literals can make the string concatenation more readable and maintainable. For example: Added edge from ${srcNode.getName()} to ${destNode.getName()}.

Suggested change
eagle.undo().pushSnapshot(eagle, "Added edge from " + srcNode.getName() + " to " + destNode.getName());
eagle.undo().pushSnapshot(eagle, `Added edge from ${srcNode.getName()} to ${destNode.getName()}`);

@james-strauss-uwa james-strauss-uwa self-assigned this Jul 3, 2024
@james-strauss-uwa james-strauss-uwa merged commit 0d4cc9c into master Jul 4, 2024
1 check passed
@james-strauss-uwa james-strauss-uwa deleted the eagle-1263 branch July 4, 2024 07:04
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