forked from ZenUml/core
-
Notifications
You must be signed in to change notification settings - Fork 15
Server-Side Y Coordinates #310
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
Open
zicjin
wants to merge
39
commits into
mermaid-js:main
Choose a base branch
from
zicjin:feature/vertical-coordinates
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
Collaborator
Collaborator
Collaborator
Author
Collaborator
|
DSL还是比较稳定的。过去七八年基本没有大的影响布局的变化。UML本身也没有什么改进(虽然不是啥好事😄)。 |
- model separate top/bottom occurrence insets to match CSS padding/borders - rework server-side occurrence measurement to preserve collapsed margins - refresh async-message-mini Playwright snapshot to capture corrected lifeline position
Collaborator
Author
|
我本地测试是可以了,如果要保留新的 async-message-mini.spec.ts 需要更新 linux snapshots |
…ordinates' into feature/vertical-coordinates
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.







新增一个确定性的布局引擎(src/positioning/VerticalCoordinates.ts 以及 src/positioning/vertical/* 中的辅助模块),它遍历解析树,测量 Markdown 注释、片段、async/sync/creation/return 语句,并记录绝对的 top/height 与锚点(message、occurrence、return)。具备主题感知的间距常量覆盖我们当前使用的 Tailwind 类,且按主题的覆盖项可扩展 THEME_OVERRIDES。按参与者为 creation 锚点建立索引,以便生命线能够找到各自的 «create» 偏移量。
通过 verticalCoordinatesAtom 将新引擎接入 state(src/store/Store.ts:37-57),共享现有的 width provider、来自 Coordinates 的参与者排序,以及与 MessageLayer 相同的起点检测逻辑。现在任何使用方都可以从该 atom 提取完整的语句坐标或特定锚点。
生命线现在使用这些预计算值,而不是查询 DOM(src/components/DiagramFrame/SeqDiagram/LifeLineLayer/LifeLine.tsx:1-69)。每条生命线都会监听 verticalCoordinatesAtom 的变化,应用已解析的 creation 偏移量(或沿用旧的 20 px 回退),并在无需等待布局抖动或 participant_set_top 事件的情况下将自身标记为就绪。
新增 src/positioning/VerticalCoordinates.spec.ts,用带有 stub width provider 的方式覆盖 creation 锚点的顺利路径(happy path),以便在浏览器构建之外暴露回归问题。
新增 StatementCoordinateDebug overlay,当 localStorage.zenumlDebug 为真值时,会显示完整的语句 Y-map,支持过滤、复制到剪贴板以及 console-table 日志输出,以便快速发现不匹配问题(src/components/DiagramFrame/Debug/StatementCoordinateDebug.tsx:1-121)。
已运行 bun test src/positioning/VerticalCoordinates.spec.ts。