Repository navigation
fix(editor): increase max viewbox size limit for large diagrams - #202
Conversation
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! 此拉取请求解决了当渲染内容较多(例如复杂的时序交互图)时,用户无法正常缩放查看细节的问题。通过扩展 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
|
There was a problem hiding this comment.
Code Review
本次改动将 MAX_VIEWBOX_SIZE 从 2000 增加到 20000,以支持更大大尺寸图表的缩放,解决了在复杂图表中无法正常缩放的问题。这是一个直接有效的修复。
然而,此项改动会影响到相关的单元测试。__tests__/unit/editor/interactions/zoom-wheel.test.ts 中的测试用例 'prevents zoom out when viewBox would exceed MAX_VIEWBOX_SIZE' 仍然依赖于旧的 2000 这个硬编码限制。为了确保代码质量和未来的可维护性,请务必更新此测试用例,使其与新的 20000 限制保持一致。
此外,我提供了一个关于将 MAX_VIEWBOX_SIZE 作为可配置项的建议,以提高组件的灵活性,您可以酌情考虑。
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #202 +/- ##
==========================================
+ Coverage 45.92% 45.94% +0.01%
==========================================
Files 338 338
Lines 27000 27009 +9
Branches 2189 2191 +2
==========================================
+ Hits 12400 12409 +9
Misses 14590 14590
Partials 10 10
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
8c14803 to
af19880
Compare
CR后的改动详情 (Changes)核心逻辑重构文件:
文档更新路径:
|
|
@xxMudCloudxx 加个 vx,我主页介绍中有我的微信号。 |
背景 (Background)
当渲染内容较多(例如复杂的时序交互图)时,SVG 的 viewBox 宽度往往会超过原有的硬编码限制 (2000)。这导致 zoom-wheel 交互逻辑误判当前视图已达到最大缩放边界,从而阻止用户的滚轮缩放操作,使得在大图模式下无法正常缩放查看细节。
改动详情 (Changes)