优化 Mermaid 多图文档的滚动性能 - #19
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6ce82a184f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| private dispose() { | ||
| this.destroyed = true; |
There was a problem hiding this comment.
Reset the widget when CodeMirror remounts it
When a diagram scrolls far enough outside CodeMirror's rendered viewport, CodeMirror destroys its DOM while the decoration can retain the same MermaidDiagramWidget instance and call toDOM() again when the user scrolls back. Permanently setting destroyed here means the new DOM's observeVisibility() immediately returns, leaving the diagram stuck on “Rendering Mermaid diagram...” instead of restoring its cached SVG.
Useful? React with 👍 / 👎.
变更
content-visibility浏览器布局/绘制优化验证
npm test:197 个测试文件通过,2403 个测试通过,7 个跳过npm run lintnpm run renderer:buildnode scripts/sync-tauri-version.mjs --check 1.2.7