Repository navigation
fix(desktop): Markdown 目录在宽预览中让出正文位置,窄预览浮层底色不透明 - #1919
Merged
Merged
Conversation
- 预览宽于 680 像素时(与旧 macOS 预览相同),打开目录让正文右侧让出目录栏宽度, 目录栏贴右侧占满高度,不再遮挡正文;打开或关闭时页面保持顶部那一行不动。 - 更窄时目录仍浮在正文上方,底色改用 --lithe-popup-background。 - 宿主把 --lithe-popup-background 从编辑区颜色改为 Ground:工作台背景图下编辑区颜色透明, 浮层会透出下面的文字;Ground 始终不透明。插件页的弹层也用这个变量。 - 新增 TestPagePopupColorStaysOpaqueOverTheBackground;更新功能矩阵与 Agent Note。
xiaoyumuxi
marked this pull request as ready for review
November 14, 2026 11:31
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.
关联 Issue / Linked issue
PR 类型 / Type
改动说明 / What changes
背景 / Why
#1912 把 Markdown 预览的目录画进了 web view 页面,但目录是浮在正文上方的面板,存在两个问题:
改动 / Changes
assets/markdown.css、assets/markdown.js)body加outline-open,正文右侧让出目录栏的宽度(280 + 2×12 像素)。阈值与旧 macOS 预览相同。flex: 1 1 auto),长目录在栏内独立滚动。assets/markdown.css)--lithe-popup-background(新的--popup变量),不再用页面底色。workbench/pluginpages.go)--lithe-popup-background从colors.Editor改为colors.Ground。applyLook会把 Panel、Editor 设为透明,Ground 始终不透明。TestPagePopupColorStaysOpaqueOverTheBackground(workbench_background_test.go),断言背景图下页面表面透明、弹层颜色等于不透明的 Ground。markdown-preview-outline:更新能力描述、证据、验收步骤和说明。新增的验收步骤是宽页正文避让、窄页不透明浮层和背景图下不叠字。2026-11-14-web-view-previews.md:新增“目录不遮挡正文”决策,并把“目录始终浮在正文上方”记为被否方案。验证列表补上新测试,适用范围补上pluginpages.go。不在本 PR 范围内 / Out of scope
无。
类型专属:fix
复现与根因
.outline用position: fixed浮在页面上,正文没有避让。它的底色是var(--page),也就是--lithe-surface。pluginPageTheme()把--lithe-surface和--lithe-popup-background都映射为colors.Editor。该映射由 Epic(0.7.0): 基于 Viva 框架的跨平台方案的迁移(#1794) #1799(0faecba49)引入,有背景图时 Editor 是透明的,所以面板也透明。检查项
desktop/internal/workbench/workbench_background_test.go。把映射改回 Editor 时的失败输出:popup color over the background = "rgba(0, 0, 0, 0)", want the opaque ground "rgba(25, 26, 28, 1)"。markdown.js和markdown.css自动断言,见“验证”;整机步骤写在功能矩阵的 verification 里。pluginPageTheme()只被插件页(pluginpages.go)和预览页(preview_pages.go)调用。--lithe-popup-background在本仓库只有 Markdown 页面使用,插件页从同一个变量取值。.agents/notes/implemented/bug-fix/记录:约束已写进现有的 web 预览架构 Note(“目录不遮挡正文”决策与被否方案),没有另建 bug-fix Note。范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/markdown-preview-outline.json。两端证据补上pluginpages.go与workbench_background_test.go,验证状态保持不变(整机验收未做)。./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh和./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/preview HEAD.artifacts/下生成的矩阵视图插件归属 / Plugin ownership
develop-lithe第三节“插件归属与宿主零依赖”的自查命令,结果为空--lithe-popup-background只在有背景图时由透明改为不透明,没有背景图时取值不变,不改变插件接口统一日志系统 / Structured logging
N/A:没有新增或改动生命周期里程碑、终态、降级或失败路径。
界面文案 / i18n
node scripts/i18n/verify-app-language-localization.mjs和node scripts/i18n/generate-i18n.mjs --check,没有放宽脚本或扩大豁免名单逻辑归属 / Logic placement
性能与内存 / Performance and memory
ResizeObserver路径。设置 / Settings
N/A:没有新增或修改设置项。
插件契约 / Plugin contract
N/A:不涉及 Rust Core 插件契约、能力版本或宿主方法;
--lithe-*主题变量名不变。发行包与资源 / Bundle and resources
./scripts/desktop/verify/verify-runtime-bundle-immutability.sh无用代码与重构 / Dead code and refactoring
验证 / Verification
scripts/desktop/desktop-go.sh test ./internal/workbench ./internal/webpreview -count=1(基于最新 preview)TestPagePopupColorStaysOpaqueOverTheBackground:把映射临时改回colors.Editor再运行markdown.js、markdown.css,1100 像素宽页--lithe-surface透明、--lithe-popup-background不透明)gofmt -l desktop/internal/workbench desktop/internal/webpreviewnode scripts/i18n/verify-app-language-localization.mjs、node scripts/i18n/generate-i18n.mjs --check./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/preview HEAD./scripts/agent-notes/verify-agent-notes.sh./scripts/desktop/verify/verify-runtime-bundle-immutability.sh未能执行的检查和原因:
color-mix与固定定位行为待整机确认。提交前确认 / Final checks
preview创建,目标分支为preview