Feature/workspace enhancements#674
Open
yangzexuan-cc wants to merge 10 commits into
Open
Conversation
解决了以下问题: 1. 文件树不展示隐藏文件:新增"显示隐藏文件"按钮,默认仅隐藏 .git 目 录,开启 toggle 后显示全部文件。通过 query 参数 showHidden 从 前端 store 贯穿到后端 readTree,过滤逻辑改为可切换而非硬编码。 2. 文件树不自动同步文件变化:在 WebSocket 连接建立后对 workDir 启 动 fs.watch 递归监听,200ms 防抖后通过新增的 file_changed ServerMessage 推送到前端。前端 handleFileChanged 收到后自动刷新 变化文件的父目录树和已打开的预览标签,保持展开状态不变。 3. 手动刷新文件树后展开节点内容丢失:修复 handleRefresh 逻辑,去掉 invalidateExpandedTreeCache 的破坏性清除,改为先清缓存再并行加 载所有展开路径,避免展开节点数据被删除后未重新加载。 4. Mermaid 流程图节点文本不显示:DOMPurify 的 svg profile 默认 过滤 foreignObject 元素(Mermaid 用其渲染节点文本),添加 ADD_TAGS: ["foreignObject"] 允许通过。 5. 新增 KaTeX 公式渲染:支持行内公式 $...$ 和块级公式 $$...$$, 在 marked 解析前预处理避免特殊字符被转义。 6. 新增 PlantUML 图表渲染:服务端 POST /api/settings/plantuml/render 通过本地 plantuml.jar 渲染 SVG,前端设置页面支持配置 jar 路径。 未配置时回退为语法高亮代码块。 7. 文件预览 Tab 新增刷新按钮:只刷新当前文件内容,不影响文件树。 8. 浏览器模式开发支持:vite.config.ts 添加 proxy 将 /health、/api、 /ws 代理到后端 127.0.0.1:3456。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- runSuite: 退出码非零时仍尝试读取 summary,汇总覆盖率指标 - root suites: lcov.info 存在即读取,不再要求 exitCode === 0 - evaluateThresholds: 有 summary 的 suite 参与阈值检查 - desktop vitest: 添加 --coverage.reportOnFailure Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
proxy 掩盖了 desktopRuntime.ts 中 baseUrl 回退到 Vite origin 的问题。 正确方案:start-dev.sh 设置 VITE_DESKTOP_SERVER_URL 让 hasExplicitDefaultBaseUrl() 返回 true,baseUrl 保持为 127.0.0.1:3456。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
PR quality triageChanged areas: area:desktop, area:server CLI core policy: No CLI-core policy block detected. Missing-test policy: Blocked by policy until a maintainer applies Coverage baseline policy: No coverage-baseline policy block detected. CLI core files:
Coverage policy files:
Expected checks:
Test coverage signals:
Risk notes:
Hard merge gates still come from GitHub Actions, not AI review. Dosu handoff: Dosu can be used as the AI reviewer for risk explanation, missing-test prompts, and maintainer Q&A. If it does not comment automatically from the PR template, ask: @dosubot review this PR for changed-area risk, missing tests, docs impact, desktop startup risk, and CLI core impact. |
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
isSymlink检测 + 图标)、文件监听(chokidar替代fs.watch)@startuml代码块 → SVG 图表、KaTeX$...$/$$...$$公式渲染spawn -pipe渲染、pathHasSymlinkComponent跳过 canonical 边界检查、覆盖率门禁容忍测试失败影响范围
workspacePanelStore(showHiddenFiles、isSymlink、file_changed handler)、settingsStore(plantumlJarPath 配置)PlantUMLRenderer(新增)、MarkdownRenderer(PlantUML + KaTeX 分发)、WorkspacePanel(symlink 图标、refresh 按钮)Settings(PlantUML jar 路径输入框)workspaceService(readTree isSymlink、readFile symlink 类型检测、chokidar 文件监听、pathHasSymlinkComponent)settings(PlantUML pipe 渲染端点)handler(file watcher 生命周期管理)、events(file_changed 消息类型)quality-gate/coverage.ts(容忍非零退出码读取覆盖率数据)测试说明
自动测试:
PlantUMLRenderer.test.tsx(5 条)、workspace-service.test.tssymlink 专项(检测、目录展开、readFile 穿透)手工测试清单(桌面端改动必须):
./docs/script/start-dev.sh一键启动localhost:1420.开头文件可见,.git隐藏tests/doc/有测试 symlink)@startuml的 Markdown$E=mc^2$的文档touch工作区内文件剩余风险
Dirent.isDirectory()在 macOS 和 Windows 上对指向目录的 symlink 行为不同,已用fs.stat()统一修正startWatchercatch 块空),不会影响主流程changed-lines匹配逻辑依赖 lcov 与 git diff 的路径对齐,当前运行显示 "No changed lines matched",但不影响 suite 级覆盖率阈值