fix(mermaid): 修复代码更新后的渲染状态恢复 - #78
Merged
Merged
Conversation
wang-kaopu
force-pushed
the
fix/mermaid-render-state
branch
from
August 28, 2026 13:19
e885421 to
a9a9656
Compare
mrzhangkris
pushed a commit
to mrzhangkris/dsh-genui
that referenced
this pull request
Sep 2, 2026
* test(mermaid): 覆盖源码更新后的状态恢复 * fix(mermaid): 重置源码更新后的渲染状态 * test(mermaid): 消除异步渲染测试竞态 * chore(build): 同步 lib 构建产物
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
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.
问题
MermaidNode之前分别维护html和failed两份状态。当一次 render 失败后再收到新的有效 code:
failed可能继续残留;修复
将渲染状态收敛为显式状态机:
loadingreadyerrorcode 更新时先进入
loading,成功后进入ready,异常时进入error,并保留 async lifecycle guard,避免旧 render 覆盖新状态。测试
新增回归测试覆盖:
验证
提交 PR 前已执行:
pnpm run checklib/产物