diff --git a/docs/development/platform-parity-matrix.csv b/docs/development/platform-parity-matrix.csv index 241d81460..f48e47bbe 100644 --- a/docs/development/platform-parity-matrix.csv +++ b/docs/development/platform-parity-matrix.csv @@ -69,6 +69,7 @@ terminal-sessions,工作台,终端,多会话与标签,已实现,待验证,已实 terminal-interaction,工作台,终端,复制粘贴、搜索与调整大小,已实现,待验证,已实现,待验证,Terminal,验证复制粘贴、终端搜索、调整面板大小和高频输入不丢失。,,macos/Sources/Lithe/Views/Terminal,windows/tauri/src/features/terminal terminal-long-command-input,工作台,终端,Windows Shell 超长命令输入,平台专属,不适用,已实现,待验证,Terminal,在 Windows cmd.exe 和 PowerShell 中执行超过 Shell 单行限制的 IDE 多行命令,确认脚本执行、原始命令内容和终端关闭后的临时文件清理。,仅在 IDE 后端为 cmd.exe/PowerShell 的超长多行文本创建一次性脚本;不修改系统 Shell 配置。,macos/Sources/Lithe/Views/Terminal,windows/tauri/crates/terminal/src/connection.rs; windows/tauri/src-tauri/src/terminal.rs markdown-rendering,编辑器,Markdown,Markdown 预览与富文本渲染,已实现,待验证,已实现,待验证,Editor,使用代码高亮、表格、Mermaid、链接和相对路径 fixture 对比渲染结果。,,macos/Sources/Lithe/Views/Editor/MarkdownPreviewView.swift; macos/Sources/Lithe/Core/Ports/MarkdownRendering.swift,windows/tauri/src/features/editor/markdown +markdown-preview-outline,编辑器,Markdown,Markdown 预览目录默认展开、全高滚动与标题跳转,已实现,已验证,未实现,不适用,Editor,在 macOS 原生 Lithe 打开含 60 节标题的 Markdown,验证默认展开、全高目录独立滚动、末尾标题跳转后保持展开、按钮与 Escape 收起;分栏中编辑保存及外部刷新保留折叠选择,删除全部标题隐藏目录,恢复标题保留展开偏好;检查短文档与无标题文档、宽预览正文避让和窄预览可收起。Windows 目录入口待实现。,,macos/Sources/Lithe/Resources/MarkdownPreview/preview.js; macos/Sources/Lithe/Resources/MarkdownPreview/preview.css,windows/tauri/src/features/editor/markdown/markdown-preview.tsx markdown-images-links,编辑器,Markdown,图片导入与链接定位,已实现,待验证,已实现,待验证,Editor,验证本地图片、远程图片、相对链接和打开源文件行为。,,macos/Sources/Lithe/Services/Markdown; macos/Sources/Lithe/Platform/MacOS/MarkdownPreviewWebView.swift,windows/tauri/src/features/editor/markdown; windows/tauri/src/features/viewer history-snapshots,工作台,本地历史,快照列表与 Diff,已实现,待验证,已实现,待验证,Local History,编辑同一文件多次,比较快照时间、内容 Diff 和文件范围。,,macos/Sources/Lithe/Views/History; macos/Sources/Lithe/Services,windows/tauri/src/features/local-history history-restore,工作台,本地历史,恢复、删除与持久化,已实现,待验证,已实现,待验证,Local History,验证恢复、删除、应用重启后持久化和失败回滚。,,macos/Sources/Lithe/Views/History,windows/tauri/src/features/local-history diff --git a/docs/development/platform-parity-matrix.md b/docs/development/platform-parity-matrix.md index 4305bb633..86fde67f7 100644 --- a/docs/development/platform-parity-matrix.md +++ b/docs/development/platform-parity-matrix.md @@ -4,9 +4,9 @@ - 最后复核:2026-09-29 - 盘点状态:initial-static-inventory(根据 macOS Views/Application/Services、Windows features/extensions 和共享契约的代码入口进行初版盘点;未替代真实运行验收。) -- 功能项:120 -- macOS:实现:✅ 105 已实现,🟡 3 部分实现,❌ 7 未实现,🧩 5 平台专属;验证:✔️ 0 已验证,🔍 108 待验证,— 12 不适用 -- Windows:实现:✅ 102 已实现,🟡 11 部分实现,❌ 5 未实现,🧩 2 平台专属;验证:✔️ 0 已验证,🔍 113 待验证,— 7 不适用 +- 功能项:121 +- macOS:实现:✅ 106 已实现,🟡 3 部分实现,❌ 7 未实现,🧩 5 平台专属;验证:✔️ 1 已验证,🔍 108 待验证,— 12 不适用 +- Windows:实现:✅ 102 已实现,🟡 11 部分实现,❌ 6 未实现,🧩 2 平台专属;验证:✔️ 0 已验证,🔍 113 待验证,— 8 不适用 ## 实现状态定义 @@ -72,7 +72,7 @@
-编辑器 · 19 个能力点 +编辑器 · 20 个能力点 | 功能组 | 能力点 | macOS | Windows | 负责人 | 验证方式 | 备注 | | --- | --- | --- | --- | --- | --- | --- | @@ -84,6 +84,7 @@ | 文本编辑 | **LSP 语义高亮**
editor-semantic-highlighting | ✅ 已实现
🔍 待验证
`macos/Sources/Lithe/Models/AppModel/AppModel+LanguageEditing.swift`、`macos/Sources/LitheLanguageIntelligenceModule/Runtime/LanguageServerSession.swift`、`frontend/editor/src/semantic-tokens.ts` | ✅ 已实现
🔍 待验证
`windows/tauri/src/platform/lsp-core-adapter.ts`、`windows/tauri/src/features/editor/lsp/lsp-client.ts`、`windows/tauri/src/features/editor/engines/monaco/semantic-token-provider.ts`、`windows/tauri/src/features/editor/engines/monaco/semantic-token-provider.test.ts`、`windows/tauri/src/platform/lsp-core-adapter.test.ts` | Editor / Language Tooling | 打开普通 Java 文件并等待 JDTLS 就绪,开启语义高亮,确认字段、方法等按协商图例上色;编辑、切换、关闭文档和重连服务器后不应用旧结果;服务器 refresh 后重新请求;关闭设置或大文件降级时保留基础语法高亮。 | Windows 复用 Core semanticTokens 和共享 fixture,修复 #675;Linux 上的适配器与模型测试不替代 Windows WebView2/JDTLS 实机验收。 | | 文本编辑 | **多行标签与标签导航**
editor-multiline-tabs | ✅ 已实现
🔍 待验证
`macos/Sources/Lithe/Views/Editor` | ✅ 已实现
🔍 待验证
`windows/tauri/src/features/tabs` | Editor | 打开足够多文件触发多行标签,确认滚动、切换、关闭和活动文件保持。 | | | Markdown | **Markdown 预览与富文本渲染**
markdown-rendering | ✅ 已实现
🔍 待验证
`macos/Sources/Lithe/Views/Editor/MarkdownPreviewView.swift`、`macos/Sources/Lithe/Core/Ports/MarkdownRendering.swift` | ✅ 已实现
🔍 待验证
`windows/tauri/src/features/editor/markdown` | Editor | 使用代码高亮、表格、Mermaid、链接和相对路径 fixture 对比渲染结果。 | | +| Markdown | **Markdown 预览目录默认展开、全高滚动与标题跳转**
markdown-preview-outline | ✅ 已实现
✔️ 已验证
`macos/Sources/Lithe/Resources/MarkdownPreview/preview.js`、`macos/Sources/Lithe/Resources/MarkdownPreview/preview.css` | ❌ 未实现
— 不适用
`windows/tauri/src/features/editor/markdown/markdown-preview.tsx` | Editor | 在 macOS 原生 Lithe 打开含 60 节标题的 Markdown,验证默认展开、全高目录独立滚动、末尾标题跳转后保持展开、按钮与 Escape 收起;分栏中编辑保存及外部刷新保留折叠选择,删除全部标题隐藏目录,恢复标题保留展开偏好;检查短文档与无标题文档、宽预览正文避让和窄预览可收起。Windows 目录入口待实现。 | | | Markdown | **图片导入与链接定位**
markdown-images-links | ✅ 已实现
🔍 待验证
`macos/Sources/Lithe/Services/Markdown`、`macos/Sources/Lithe/Platform/MacOS/MarkdownPreviewWebView.swift` | ✅ 已实现
🔍 待验证
`windows/tauri/src/features/editor/markdown`、`windows/tauri/src/features/viewer` | Editor | 验证本地图片、远程图片、相对链接和打开源文件行为。 | | | 代码结构 | **当前文件 Outline 与符号树**
outline-symbols | 🟡 部分实现
🔍 待验证
`macos/Sources/Lithe/Views/Language`、`macos/Sources/Lithe/Views/Search` | ✅ 已实现
🔍 待验证
`windows/tauri/src/features/outline` | Language Tooling | 使用 Java 文件验证符号树、展开折叠、排序和跳转;确认 macOS 是否提供同等独立 Outline 入口。 | | | 代码结构 | **引用结果面板与引用跳转**
references-pane | ✅ 已实现
🔍 待验证
`macos/Sources/Lithe/Views/Language/JavaReferencesView.swift` | ✅ 已实现
🔍 待验证
`windows/tauri/src/features/references` | Language Tooling | 从符号发起引用查询,验证结果分组、文件定位、关闭和重新查询。 | | diff --git a/macos/Sources/Lithe/Resources/MarkdownPreview/preview.css b/macos/Sources/Lithe/Resources/MarkdownPreview/preview.css index ccfc1bbc2..fd52e20ba 100644 --- a/macos/Sources/Lithe/Resources/MarkdownPreview/preview.css +++ b/macos/Sources/Lithe/Resources/MarkdownPreview/preview.css @@ -293,7 +293,7 @@ audio { width: min(100%, 520px); } top: 52px; right: 16px; width: min(280px, calc(100vw - 32px)); - max-height: min(66vh, 560px); + bottom: 16px; overflow: auto; padding: 12px 10px; border: 1px solid var(--border); @@ -309,6 +309,10 @@ audio { width: min(100%, 520px); } .toc a[data-level="2"] { padding-left: 18px; } .toc a[data-level="3"] { padding-left: 29px; color: var(--muted); } +@media (min-width: 681px) { + body.toc-open { padding-right: 312px; } +} + .image-viewer { position: fixed; z-index: 100; @@ -333,5 +337,5 @@ audio { width: min(100%, 520px); } @media (max-width: 440px) { .markdown-body { padding: 22px 18px 54px; } .toc-toggle { top: 10px; right: 10px; } - .toc { top: 46px; right: 10px; } + .toc { top: 46px; right: 10px; bottom: 10px; } } diff --git a/macos/Sources/Lithe/Resources/MarkdownPreview/preview.js b/macos/Sources/Lithe/Resources/MarkdownPreview/preview.js index 3f8f93571..836ce0263 100644 --- a/macos/Sources/Lithe/Resources/MarkdownPreview/preview.js +++ b/macos/Sources/Lithe/Resources/MarkdownPreview/preview.js @@ -13,6 +13,8 @@ let scrollCommandVersion = 0; let suppressScrollReportsUntil = 0; let scrollReportFrame = 0; + let tocExpanded = true; + let tocDocumentURL; function setTheme(theme) { document.documentElement.dataset.theme = theme === 'light' ? 'light' : 'dark'; @@ -172,24 +174,29 @@ link.addEventListener('click', event => { event.preventDefault(); heading.scrollIntoView({ behavior: 'smooth', block: 'start' }); - closeTOC(); }); tocList.append(link); }); tocToggle.hidden = headings.length === 0; - if (headings.length === 0) closeTOC(); + updateTOCVisibility(); + } + + function updateTOCVisibility() { + const visible = !tocToggle.hidden && tocExpanded; + toc.hidden = !visible; + tocToggle.setAttribute('aria-expanded', String(visible)); + document.body.classList.toggle('toc-open', visible); } function closeTOC() { - toc.hidden = true; - tocToggle.setAttribute('aria-expanded', 'false'); + tocExpanded = false; + updateTOCVisibility(); } function toggleTOC() { - const opening = toc.hidden; - toc.hidden = !opening; - tocToggle.setAttribute('aria-expanded', String(opening)); + tocExpanded = !tocExpanded; + updateTOCVisibility(); } function closeImage() { @@ -243,6 +250,10 @@ const version = ++renderVersion; const initialScrollCommandVersion = scrollCommandVersion; const scrollRatio = currentScrollRatio(); + if (tocDocumentURL !== payload?.documentURL) { + tocDocumentURL = payload?.documentURL; + tocExpanded = true; + } setTheme(payload?.appearance); content.innerHTML = payload?.html || ''; rewriteLocalAssets(); @@ -263,9 +274,6 @@ event.stopPropagation(); toggleTOC(); }); - document.addEventListener('click', event => { - if (!toc.hidden && !toc.contains(event.target) && event.target !== tocToggle) closeTOC(); - }); viewer.addEventListener('click', event => { if (event.target === viewer || event.target === imageClose) closeImage(); }); diff --git a/shared/platform-feature-matrix.json b/shared/platform-feature-matrix.json index ad707092a..8a0dd0de5 100644 --- a/shared/platform-feature-matrix.json +++ b/shared/platform-feature-matrix.json @@ -1822,6 +1822,29 @@ "owner": "Editor", "verification": "使用代码高亮、表格、Mermaid、链接和相对路径 fixture 对比渲染结果。" }, + { + "id": "markdown-preview-outline", + "area": "编辑器", + "group": "Markdown", + "capability": "Markdown 预览目录默认展开、全高滚动与标题跳转", + "macos": { + "evidence": [ + "macos/Sources/Lithe/Resources/MarkdownPreview/preview.js", + "macos/Sources/Lithe/Resources/MarkdownPreview/preview.css" + ], + "implementationStatus": "implemented", + "verificationStatus": "verified" + }, + "windows": { + "evidence": [ + "windows/tauri/src/features/editor/markdown/markdown-preview.tsx" + ], + "implementationStatus": "missing", + "verificationStatus": "not-applicable" + }, + "owner": "Editor", + "verification": "在 macOS 原生 Lithe 打开含 60 节标题的 Markdown,验证默认展开、全高目录独立滚动、末尾标题跳转后保持展开、按钮与 Escape 收起;分栏中编辑保存及外部刷新保留折叠选择,删除全部标题隐藏目录,恢复标题保留展开偏好;检查短文档与无标题文档、宽预览正文避让和窄预览可收起。Windows 目录入口待实现。" + }, { "id": "markdown-images-links", "area": "编辑器",