@benz-ai-x/dsh-md-preview 0.7.2 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,15 +12,17 @@
12
12
  - Markdown chips in the produced-files row of a turn open a right-docked preview panel rendering GFM, syntax-highlighted code, and TeX.
13
13
  - A per-message "Preview documents" action lists that turn's markdown documents.
14
14
  - Non-markdown deliverables keep the shipped open-on-desktop behavior.
15
- - The panel is closable and draggable (320–1280 px, default 500); the dragged width persists for the app session.
15
+ - The document sidebar reserves its own space beside the conversation on wide screens; below 1056 px and when maximized it opens as an overlay. The paperclip right of Session-log download toggles workspace browsing; the X in the panel header closes it, with an unsaved-draft guard. Its width defaults to half the viewport up to 720 px, supports a remembered 360–1200 px drag preference, and clamps to the available space. Native navigation and tool details retain their own controls. Esc closes the panel and returns focus to the header entry.
16
16
  - The panel renders nothing while no preview target is set.
17
+ - **Harness typography and themes** — navigation uses 14px/20px text with 12px/18px parent paths, consistent icons and larger controls. Search stays at the top while entries scroll; the initial rail is 220px and manual widths are preserved. The panel docks from the top of the frame and keeps its own workspace/back and close controls reachable. Full paths and the version are available by focusing the document identity. The editor follows the platform's light/dark palette and code font; rendered Markdown keeps the platform's paragraph rhythm at every width.
17
18
  - **Editing** — the panel's Edit action enters a CodeMirror editor (line numbers, GFM highlighting, Cmd/Ctrl-S save); Save writes back to the workspace, flashes a "Saved" toast, and returns to the rendered view; Cancel discards the draft. Only existing files edit. Non-conflict save failures show the failure code with a Retry action.
18
19
  - **Conflict guard** — saving over a file that changed elsewhere (another session, the agent, an external editor) prompts "the file changed elsewhere": Reload or Overwrite; closing with unsaved edits asks first.
19
20
  - **Workspace browser** — the panel header's Workspace action enters a directory tree of the session workspace (lazy expansion, loading/empty/failed states); single-click renders `.md` rich, `.txt` and other text monospace, other types a clear unsupported notice; the current document highlights and auto-reveals in the tree; full keyboard traversal (arrows/Enter); the header shows the path breadcrumb. Expanded directories silently revalidate on every re-entry (and from the tree's refresh button) — the agent keeps producing files mid-conversation, and a failed refresh never blanks what's on screen.
20
21
  - **Outline** — the header's outline popover lists the document's ATX headings (fenced code never counts); clicking scrolls the rendered heading in the view face and jumps the cursor to the source line in the edit face.
21
22
  - **Side rail (from 640px)** — the file tree and outline live in a collapsible left rail (文件|大纲 tabs, selection remembered); browsing never swaps the document away. Below 640px the face-swap/popover fallback holds; Mod-Shift-O/E jump, Esc dismisses.
22
23
  - **Segmented mode + edit feedback** — a persistent 预览|编辑 control (dirty drafts raise the guard on switch); a status bar with live Ln/Col, size, and the resident saved-at stamp; undo/redo buttons; Mod-B/I/K markup keys (? lists them); documents with inline HTML warn once per edit session.
23
- - **Tree filter** — type to narrow by substring with hit highlighting; a name-matched directory keeps its subtree; clearing restores.
24
+ - **Workspace search** — the browse area's search box finds documents by name across the *whole* session workspace — unexpanded directories included — through a cancellable host traversal that never reads file bodies. Case-insensitive substring match on names; each result shows name plus workspace-relative path (same-name documents stay apart); opening a result re-runs the full read and guard. States stay honest: searching…, "no results" only from a complete search, "incomplete results" with its reason (unreadable directories / traversal or result cap), failure with retry. A new query cancels the old one's work; clearing restores the exact tree you left. (Distinct from the editor's in-document find.)
25
+ - **Quick entries** — two compact rows above the tree: 「Produced this turn」 lists the previewable documents the session's newest turn produced (owning-service facts, closing-seq fenced, live while the turn streams), and 「Recently read」 lists this session's recently read documents recency-first. Both show name plus path and open through the same guarded path with a fresh read; empty sources simply hide; the continue-reading entry keeps its own explicit seat beside them.
24
26
  - **Reading position** — the outline popover highlights the entry owning your position (scroll in the view face, cursor line in the edit face) and keeps it in view; the header shows a dirty dot for unsaved drafts, folds the version into the crumbs tooltip, and annotates the find/save shortcuts; the find panel is localized and shows a match count (n/m).
25
27
  - **Editor find** — the edit face carries a CodeMirror search panel (header button and Mod/Ctrl-F).
26
28
  - **Mermaid diagrams** — fenced ` ```mermaid ` blocks render as diagrams after the document settles; the block banner stays (copy still reads the source), and any failure falls back to the plain code block. Mermaid is inlined into the client bundle but evaluated lazily (first diagram pays the parse cost; bundle ~3.9 MB minified / ~1.1 MB gzip).
@@ -88,7 +90,7 @@ The panel shows `md-preview/<reason>` on failure. All codes:
88
90
  ## Known limits
89
91
 
90
92
  - Inline prose mentions of `.md` files still open on the desktop (owned by ui-deliverables, not this plugin).
91
- - The panel floats above the details column; it does not replace the three-column grid.
93
+ - The panel is contributed through `shell.overlay`; its reversible layout adapter reserves space beside the native frame on wide screens without replacing the host details column. Narrow screens and maximize use an overlay. The adapter depends on the pinned frame DOM and must be checked when upgrading Harness; see [ADR-0004](docs/adr/0004-dock-preview-beside-the-harness-frame.md).
92
94
  - Uploaded document attachments are not previewable (no transcript surface today).
93
95
  - The outline lists ATX headings only (setext forms render but stay out of the popover).
94
96
  - Mermaid renders with its default theme; documents mixing indented code blocks with fenced ones skip the diagram pass entirely (order-parity safety check).
package/README.zh.md CHANGED
@@ -12,15 +12,17 @@ DSH Web GUI 插件:点击对话中出现的 Markdown 文档,在对话右侧打
12
12
  - 回合产出文件 chip 行中的 `.md` / `.markdown` 文档:点击打开右侧预览面板,渲染 GFM、代码高亮和 TeX。
13
13
  - 每条助手消息的操作区新增「预览文档」按钮,列出该回合产出的 Markdown 文档。
14
14
  - 非 Markdown 产出文件保持原有行为(交给系统打开)。
15
- - 面板可关闭、可拖宽(320–1280 px,默认 500);拖出的宽度在本次应用会话内保持。
15
+ - **文档侧边栏**:宽屏展开时让对话区自动缩窄,低于 1056px 或全屏时覆盖展开。头部「Session 日志」右侧使用原生回形针图标,一键开合工作区浏览,面板右上 × 关闭;未保存修改仍先询问。宽度默认取半屏、最多 720px,记忆 360–1200px 的手动拖宽偏好,并按可用空间钳制。原生导航与工具详情保留各自操作;Esc 关闭后焦点返回入口。布局适配依赖锁定基线,见 [ADR-0004](docs/adr/0004-dock-preview-beside-the-harness-frame.md)。
16
16
  - 没有预览目标时面板不渲染。
17
+ - **字体与主题对齐 Harness**:导航主文字 14px/20px、父目录路径 12px/18px,统一图标与控件尺寸。搜索固定在浏览区顶部,条目独立滚动;导航初始宽 220px,保留手动宽度偏好。面板从框架顶部停靠,自身保留工作区/返回与关闭入口;聚焦文档身份可查看完整路径和版本。编辑器使用平台浅/深主题与代码字体,正文在各种宽度下均保持平台 Markdown 段落节奏。
17
18
  - **编辑**:面板「编辑」进入 CodeMirror 编辑器(行号、GFM 高亮、Cmd/Ctrl-S 保存),「保存」写回工作区、显示「✓ 已保存」提示并回到渲染视图,「取消编辑」丢弃草稿;只编辑已存在的文件。保存失败(非冲突)会显示错误码并提供【重试】。
18
19
  - **冲突保护**:保存时若文件已被其它方(agent、其它会话、外部编辑器)修改,提示「文件已变化」,由你选择【重新加载】或【强制覆盖】;带未保存修改关闭面板会先询问。
19
20
  - **工作区浏览**:面板头部「工作区」进入目录树(懒展开、加载/空/失败三态);单击 `.md` 富渲染、`.txt` 等纯文本等宽展示、其它类型明确提示不支持;当前文档在树中高亮并自动定位;支持方向键/Enter 键盘遍历;头部路径面包屑。已展开目录在每次重进浏览脸时**静默重验**(树工具栏也有刷新按钮)——agent 会在会话中途持续产出文件,刷新失败绝不清空现有列表。
20
21
  - **大纲导航**:头部「大纲」弹层列出文档的 ATX 标题(代码围栏内的 `#` 不算);点击后查看脸滚动到渲染标题、编辑脸跳转光标到源行。
21
22
  - **侧栏 rail(≥640px)**:文件树与大纲常驻面板左侧(「文件|大纲」记忆选择),文档不再被浏览替换;<640px 回退换脸/弹层;Mod-Shift-O/E 直达、Esc 收弹层。
22
23
  - **分段控件与编辑反馈**:「预览|编辑」常驻切换(脏草稿切回走守卫);状态栏实时 Ln/Col/字数与常驻「已保存」时间;撤销/重做按钮;Mod-B/I/K 排版键(? 查看键位);含内联 HTML 的文档进编辑时一次性预警。
23
- - **树筛选**:输入即子串缩表、命中高亮、目录命中整枝保留、清空恢复。
24
+ - **工作区搜索**:浏览区搜索框按名称搜索**整个**会话工作区的文档——未展开目录也覆盖——由宿主可取消遍历完成,绝不读取正文。名称不区分大小写子串匹配;每条结果同时显示名称与工作区相对路径(同名文档可分辨);打开结果仍走完整读取与守卫。状态诚实可辨:搜索中…;「没有结果」只在完整搜索且零命中时出现;「结果不完整」会说明原因(目录读取失败/遍历或数量上限)并保留已得结果;失败给出错误码与重试。输入新词即取消旧搜索,清空后精确恢复原浏览展开状态。(与编辑器内查找是两回事。)
25
+ - **快捷入口**:树上方两小节——「当前回合产出」列出最新回合产出的可预览文档(owning service 回合事实、按关闭序号截断、回合进行中实时更新),「最近阅读」按近期使用列出本会话读过的文档。两节均显示名称加路径,打开走同一守卫路径并重新读取;来源为空时该节隐藏;「继续阅读」入口保持自己的独立席位与语义。
24
26
  - **阅读位置跟踪**:大纲弹层高亮当前阅读位置所在的节——查看脸按滚动位置、编辑脸按光标源行推导,并保持该条目在弹层视野内。头部在草稿未保存时显示脏点,版本号折入路径提示,查找/保存按钮标注快捷键;查找面板已本地化并显示匹配计数(n/m)。
25
27
  - **编辑器查找**:编辑脸带 CodeMirror 搜索面板(头部按钮与 Mod/Ctrl-F)。
26
28
  - **Mermaid 图表**:` ```mermaid ` 围栏块在文档渲染定型后增强为图表;块横幅保留(复制仍取源码),任何失败回退纯代码块。mermaid 内联进 client bundle 但**惰性求值**(首个图表才付解析成本;bundle 约 3.9 MB minified / 1.1 MB gzip)。
@@ -88,7 +90,8 @@ allowBuilds:
88
90
  ## 已知限制
89
91
 
90
92
  - 正文中内联提到的 `.md` 文件名仍走系统打开(归 ui-deliverables 所有,不归本插件)。
91
- - 面板悬浮在对话右侧,不替换三栏布局。
93
+ - 文档侧边栏通过锁定基线的可释放布局适配预留空间,窄屏覆盖展开;升级 Harness
94
+ 需重新验证布局适配,原生工具详情贡献保留。
92
95
  - 用户上传的文档附件不可预览(目前没有对应的会话面)。
93
96
  - 大纲只收 ATX 标题(setext 下划线式标题会渲染但不进弹层)。
94
97
  - Mermaid 用默认主题;混用缩进代码块与围栏块的文档整体跳过图表增强(顺序对齐安全检查)。