fix:macOS Markdown 预览目录默认展开并使用完整高度 - #1021
Open
Absinthe-yl wants to merge 3 commits into
Open
Absinthe-yl wants to merge 3 commits into
Absinthe-yl wants to merge 3 commits into
Conversation
# Conflicts: # docs/development/platform-parity-matrix.md
xiaoyumuxi
reviewed
Oct 1, 2026
xiaoyumuxi
left a comment
Collaborator
There was a problem hiding this comment.
补充一个状态保持的边界条件,见 inline comment。
| tocToggle.setAttribute('aria-expanded', String(visible)); | ||
| document.body.classList.toggle('toc-open', visible); | ||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
closeTOC() now persists tocExpanded = false, but the Escape handler calls it even when the document currently has no headings and the TOC toggle is hidden. This means an unrelated Escape (for example, closing the image viewer) can overwrite the preserved expanded preference: open TOC → remove all headings → press Escape → restore headings now leaves the TOC collapsed. Could we only mutate the TOC preference here when !tocToggle.hidden (or otherwise distinguish “TOC unavailable” from an explicit user collapse)?
This branch has not been deployed
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.
Closes #1002
问题
macOS Markdown 预览目录默认隐藏,展开后高度受
66vh / 560px限制,长文档导航时未充分利用右侧空间;点击目录标题后还会自动收起。定位
目录由现有
MarkdownPreview/preview.js生成,初始 HTML 将目录标记为隐藏;目录链接和点击正文的事件会关闭目录。preview.css将目录作为固定浮层,并限制最大高度。修复
验证
preview的32462a59;提交前合并最新4773688e,重新生成矩阵文档并保留双方能力记录。本 PR 相对最新基线仅修改 Markdown 预览 JS/CSS 和功能矩阵。32462a59基线上完成;最新同步仅涉及上游 Windows 功能及矩阵文档,macOS 预览实现未变化。node --check macos/Sources/Lithe/Resources/MarkdownPreview/preview.js、./scripts/verify-runtime-bundle-immutability.sh、./scripts/verify-platform-feature-matrix-change.sh origin/preview HEAD、./scripts/verify-platform-feature-matrix.sh、git diff --check均通过。./scripts/verify-service-boundaries.sh被上游已有的AppModel+RunConfiguration.swift616 行超过 600 行限制阻断,该文件与上游一致,本 PR 未修改。