Skip to content

Conversation

@rubbishmaker
Copy link
Contributor

@rubbishmaker rubbishmaker commented Dec 18, 2025

当两个节点之间只有一条边时,不应该进入平行边的transform处理。#7477

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @rubbishmaker, 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 introduces a fix to the process-parallel-edges transform. Previously, the transform would attempt to apply parallel edge styling logic even when there was only a single edge connecting two nodes. The change ensures that this specific transform is only engaged when there are indeed multiple edges between nodes, thereby preventing incorrect visual rendering and improving the efficiency of the styling process.

Highlights

  • Bug Fix: Resolved an issue where the process-parallel-edges transform was incorrectly applied to single edges between two nodes.
  • Performance Improvement: The transform now exits early when only one edge exists between two nodes, avoiding unnecessary calculations for parallel edge styling.

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

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

你好,感谢你的贡献。这个修复是正确的,它解决了当两个节点之间只有一条边时,该边仍被作为平行边处理的问题。通过在 length === 1 的情况下直接 return,可以避免不必要地修改边的样式,这符合“不处理单个边”的预期行为。

我有一个关于此更改引入的行为变化的评论,请查看。

style.loopDist = Math.floor(i / len) * distance + 50;
} else if (length === 1) {
style.curveOffset = 0;
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

这个改动可以很好地处理那些一直都是单独存在的边,避免了不必要的样式修改。但它也引入了一个行为变化:如果一条边之前是平行边(因此是弯曲的),后来因其他平行边被删除而变成了单独的边,这个改动会导致它保持弯曲。之前的代码会通过设置 style.curveOffset = 0 将其拉直。

这种行为上的变化可能不是我们所期望的。如果希望恢复之前的拉直行为,同时又不影响那些“原生”的单边,我们可能需要在这里增加更复杂的逻辑来重置样式。例如,可以检查 style.curveOffset 是否有非零值,如果有,则将其设置为 0 并触发一次更新,然后才返回。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个行为变化是符合预期的吧,不管怎么样,当只有一条边的时候始终使用配置的样式,不进入平行边处理

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