feat(structure): introduce sequence-interaction structure with hierarchical layout#204
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! 此 PR 旨在通过引入一个全新的 Highlights
Changelog
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 #204 +/- ##
==========================================
+ Coverage 45.95% 46.05% +0.09%
==========================================
Files 338 341 +3
Lines 27047 27892 +845
Branches 2202 2270 +68
==========================================
+ Hits 12430 12845 +415
- Misses 14606 15035 +429
- Partials 11 12 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
59f7f23 to
32565a1
Compare
|
commit 32565a1的修改主要集中在 交互流程图的视觉表现 以及 DSL 关系解析算法 的改进,解决了标签遮挡的视觉痛点,并扩展了对复杂连线样式的支持。 1. 交互流程图优化 (Sequence Interaction)核心变更文件:
2. 正则优化核心变更文件: 正则算法优化通过重构 代码对比- const RELATION_TOKEN = /[<>=o.x-]{2,}/;
- const ARROW_TOKEN = /[<>=o.x-]{2,}/g;
+ const RELATION_TOKEN = /(?:[<>o.x-]{2,}|[<>=]{2,})/;
+ const ARROW_TOKEN = /(?:[<>o.x-]{2,}|[<>=]{2,})/g;逻辑演进
3. syntax增强核心变更文件: 代码背景: 逻辑对比分析❌ 修改前 (Before)
✅ 修改后 (After)
该修复通过以下逻辑保证了向后兼容性:
syntax的增强修复了
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
此 PR 引入了一个全新的 sequence-interaction 结构,用于支持时序交互图的可视化,这是一个非常棒的功能增强。整体实现考虑得很周全,包括了多种节点、连线和布局样式的支持。代码结构清晰,特别是将几何计算相关的工具函数抽离到独立的模块中,并辅以完备的单元测试,值得称赞。
在审查中,我发现 getTangentAngle 工具函数在计算路径起点的切线角度时存在一个错误,这会导致双向箭头的渲染不正确。我在 src/designs/utils/geometry.tsx 及其测试文件中留下了具体的修改建议。修复此问题后,此 PR 将会是一个非常出色的贡献。
|
@Aarebecca 结构组件中 BtnAdd/BtnRemove 的交互逻辑与数据操作指令是否在计划中,我发现80%的结构有BtnsGroup但是被双重隐藏且缺失交互逻辑 |
BtnAdd/BtnRemove 的交互逻辑是由编辑器统一控制的,各结构只需要按照规范将按钮放置即可 |
|
@xxMudCloudxx 可以把最典型的 1 ~ 2 个模版加到 skill 中的模版列表中,方便 AI 生成时推荐出来 |
…measurement logic
763bfca to
21730c3
Compare
|
应该差不多了 |





📝 描述
为了支持时序交互图的层级布局可视化需求,本 PR 引入了全新的
sequence-interaction结构组件。该组件旨在通过灵活的配置支持多种节点样式、连线风格及布局模式,丰富了现有的图表展示能力。🛠 改动详情
1. 新增结构组件
src/designs/structures/sequence-interaction.tsx,支持泳道(lifelines)和层级节点布局。src/designs/structures/index.ts中完成组件导出与注册。2. 模板定义与配置
新增
src/templates/sequence-interaction.ts,提供丰富的预设配置:badge-card,compact-card,capsule-item,rounded-rect-node。dashed)、动画 (animated)。compact)、宽松 (wide)。一共 4(样式) * 3(连线) * 3(布局) = 36个模板
3. 数据支持
shared/datasets.ts和shared/get-template-data.ts中添加了相应的示例数据,确保模板能够正常渲染演示内容。样式
节点样式
有
badge-card、compact-card、capsule-item和rounded-rect-node:连线风格
有默认、dashed、animated:
布局风格
有默认、紧凑、宽松间距
时序错位
DSL
未完成的工作