fix(sequence-interaction): resolve lifeline penetration issues using SVG masks instead of white overlays#214
Conversation
…SVG masks instead of white overlays
Summary of ChangesHello @xxMudCloudxx, 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! 此拉取请求旨在解决序列图中生命线穿透半透明节点导致的 UI 瑕疵。此前通过叠加白色矩形进行遮挡的方案,在背景色多样或节点半透明时会产生明显的“白条”问题。本次重构废弃了这种物理遮挡方式,转而利用 SVG 蒙版技术,在生命线经过节点时动态地“挖空”相应区域,从而实现生命线的物理断开,确保了在各种视觉条件下都能提供精确且自然的渲染效果。 Highlights
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #214 +/- ##
==========================================
+ Coverage 46.14% 46.15% +0.01%
==========================================
Files 341 341
Lines 27930 28003 +73
Branches 2282 2289 +7
==========================================
+ Hits 12887 12924 +37
- Misses 15031 15067 +36
Partials 12 12
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
@xxMudCloudxx 可以多尝试使用 ai 写代码。 |
我用得应该比较多,让ai分析需求,cr什么的 |
嗯嗯,也让 ai 去 coding~ 然后也想想怎么做一些措施,让项目更容易被 ai 维护和迭代,比如一些 skill 约束等。 |
背景与问题:
此前,为了处理生命线(Lifeline)穿透半透明节点的问题,我简单地在节点处叠加了白色矩形进行遮挡。但这一做法忽略了 SVG 背景颜色的多样性:当背景并非纯白,或者节点具有半透明属性时,这些白色遮挡条在浅色背景下会显得非常突兀,导致明显的 UI “白条”视觉缺陷。
改进方案:
为了彻底修复该 UI 瑕疵,我重构了遮挡逻辑:
废弃物理遮挡: 移除了节点处的硬编码白色窄条。
引入 SVG Mask: 改用蒙版(Mask)技术,根据节点位置动态地在生命线上“挖空”对应区域。
预期收益:
通过这种方式,生命线在节点处会实现物理意义上的断开而非视觉上的覆盖。这不仅完美适配了半透明节点的渲染需求,也确保了在任何背景颜色下,节点周围的视觉表现都能保持一致且自然。