dsh-mindmap 0.10.0 → 0.10.1
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/CHANGELOG.md +5 -1
- package/README.md +7 -3
- package/README.zh-CN.md +7 -3
- package/client.js +854 -333
- package/package.json +8 -2
package/CHANGELOG.md
CHANGED
|
@@ -6,10 +6,14 @@ All notable changes to this project are documented here. Release-specific notes
|
|
|
6
6
|
|
|
7
7
|
### Added
|
|
8
8
|
|
|
9
|
+
- Better Sidebar native tab coexistence: when `dsh-better-sidebar` is installed, the mindmap registers as a single-instance tab (`dsh-mindmap:mindmap`) inside Better Sidebar instead of rendering its own floating panel. The in-tab toolbar is a single compact row (mindmap list, current mindmap, export button on the same line), labeled 脑图列表; the header 思维脑图 button opens or focuses the tab. When Better Sidebar is absent, the standalone floating panel with drag-resizable width and layout-push CSS remains unchanged (labeled 目录). `dsh-better-sidebar` is declared as an optional peer dependency — no duplicate instance is bundled. The mode switch is fully reversible via a `sidebarBus`-driven reversible effect: if Better Sidebar is unloaded mid-session, the standalone panel and layout-push CSS are restored automatically. A session-scoped data bridge (`sessionStore`) passes header-slot-captured `nodes`/`inputActions` to the tab component, with cleanup on session switch and component unmount.
|
|
9
10
|
- Collapsible subtrees: every node with children shows a small toggle on its connector. Collapsing hides the subtree and reports how many nodes are hidden, which keeps large maps navigable. The state is view-only — the markdown file is untouched and image export still covers the full subtree. Collapsed nodes reset when the document changes, and stale ids are pruned after the AI rewrites the tree.
|
|
10
11
|
|
|
11
12
|
### Fixed
|
|
12
13
|
|
|
14
|
+
- 内嵌 M 徽标增大至 16px、字母加粗,改为透明底与跟随文件名主题色的描边,改善换肤后的辨识度。
|
|
15
|
+
- 内嵌模式的 Markdown 文件恢复为紧凑 M 徽标;其他格式文件仅展示,禁用悬停反馈、打开、拖拽与右键操作,文件夹仍可展开。
|
|
16
|
+
- 内嵌 Better Sidebar 的列表与标签采用宿主字体角色(正文 14px、界面 12px),目录改用 14px 线框图标,修复字号继承偏大及标签字号混杂;独立模式和脑图节点排版不变。
|
|
13
17
|
- 画布拖拽不再吞掉折叠开关等控件的点击。
|
|
14
18
|
- 目录打开/焦点同步:宿主草稿 API 不可读时不再静默放弃;有非空草稿时指令转入剪贴板。
|
|
15
19
|
- Settings now wait for a late-arriving client connection instead of permanently capturing its initial absence. The client also supports direct settings descriptors and the current positional update API, while retaining the legacy envelopes.
|
|
@@ -135,4 +139,4 @@ First release of dsh-mindmap: a plain Markdown file in the session working direc
|
|
|
135
139
|
|
|
136
140
|
- Manual edits to a `.md` outside the AI tools are only picked up on the next AI `mindmap_*` touch of that file.
|
|
137
141
|
- The panel is unavailable in a blank (no-session) state, since it lives in a session-scoped slot.
|
|
138
|
-
- Running two layout-push plugins (e.g. dsh-better-sidebar) with both panels open at once is a known boundary: both target `#root` and the later-injected rule wins.
|
|
142
|
+
- ~~Running two layout-push plugins (e.g. dsh-better-sidebar) with both panels open at once is a known boundary: both target `#root` and the later-injected rule wins.~~ Resolved in `[Unreleased]`: when Better Sidebar is installed, the mindmap registers as a native tab inside it and no longer writes its own layout-push CSS.
|
package/README.md
CHANGED
|
@@ -18,9 +18,9 @@ A DeepSeek Harness plugin that turns a plain Markdown file into a live mindmap.
|
|
|
18
18
|
- **Four tools** (`mindmap_create` / `mindmap_open` / `mindmap_get` / `mindmap_update`) — plain Markdown files in the session working directory; the root node title is the filename and stays in sync both ways (`renameRoot` renames the file, collisions are rejected).
|
|
19
19
|
- **Live panel with zero extra channels** — the panel consumes the session snapshot (`mindmap_*` tool results), so every AI edit re-renders immediately.
|
|
20
20
|
- **Reliable open, recoverable loading state** — AI create/open results always expand the panel (a structural-fingerprint selector drives snapshot recomputation even when the host reuses the nodes array reference); after clicking a `.md` in the tree, the loading state recovers three ways: case-only path mismatches auto-merge (case-insensitive filesystems), tool errors show inline, and a ~30s watchdog switches to a timeout state — both failure states offer a one-click retry that re-sends the open request.
|
|
21
|
-
- **Floating right panel** — toggled by the 思维脑图 button
|
|
22
|
-
- **Directory tree tab** — a persistent tree of the session working directory (served by a plugin-owned read-only route), lazy-loaded per directory; right-click to create a mindmap (at the root or inside a directory); left-click a `.md` to open it instantly and hand it to the AI for editing.
|
|
23
|
-
- **Single-mindmap mode** — two tabs only:
|
|
21
|
+
- **Floating right panel or native sidebar tab** — when `dsh-better-sidebar` is installed, the mindmap registers as a native single-instance tab (`dsh-mindmap:mindmap`) inside Better Sidebar, with a compact one-row toolbar (mindmap list, current mindmap, and export on the same line); the header 思维脑图 button opens or focuses that tab. When Better Sidebar is absent, the panel falls back to a standalone floating right panel toggled by the 思维脑图 button — drag-resizable (280px ~ 80% viewport), persisted, and pushing the chat left (layout-push) so the two never overlap. AI create/open/view intents always open or focus the panel/tab and switch to the target document, including when it is currently closed or the same document is opened again. The mode switch is fully reversible: if Better Sidebar is unloaded mid-session, the standalone panel and layout-push CSS are restored automatically.
|
|
22
|
+
- **Directory tree tab** — a persistent tree of the session working directory (served by a plugin-owned read-only route), lazy-loaded per directory; right-click to create a mindmap (at the root or inside a directory); left-click a `.md` to open it instantly and hand it to the AI for editing. Labeled 目录 in standalone mode and 脑图列表 in sidebar mode.
|
|
23
|
+
- **Single-mindmap mode** — two tabs only: the tree/list tab and 脑图 (the current mindmap); opening another `.md` replaces the previous one.
|
|
24
24
|
- **"What you see is what the AI edits"** — when the visible mindmap differs from the AI's working document, the panel automatically asks the AI to open it, keeping the chat focus in sync.
|
|
25
25
|
- **MarkGrove-style mapping** — heading hierarchy, nested lists (empty items become placeholder nodes), code blocks as leaf nodes, paragraphs promoted to their own nodes (019 block concept), stable structural IDs, and orthogonal connector lines between nodes.
|
|
26
26
|
- **Centered canvas with zoom and pan** — the mindmap opens centered in the canvas (scrollable without edge clipping when larger); a floating zoom bar at the canvas top-right (zoom out / percent / zoom in / fit) applies auto fit-to-view on open (small maps stay at 100%), steps through 25%–300% with a stable view center, and keeps re-fitting as the AI edits — until you zoom manually. Click any node to zoom in on it and its whole subtree, with the node pinned at the left-center of the canvas. The canvas also pans by drag: the **middle button** anywhere (even over a node), the **left button on blank canvas** (the Mac trackpad「click and drag」path), or **Space + left button** when the drag must start on a card. Panning works in both directions even when content does not overflow; content follows the pointer 1:1, blank space shows a grab hand, and a 4px threshold separates drag from click — so clicking blank space still clears the selection and clicking a node still focuses it, while a real drag never wipes the selection ring.
|
|
@@ -28,6 +28,10 @@ A DeepSeek Harness plugin that turns a plain Markdown file into a live mindmap.
|
|
|
28
28
|
- **PNG export** — one click on 导出图片 exports the current mindmap.
|
|
29
29
|
- **Safety** — `mindmap_create` / `mindmap_update` require native approval by default. Automation can explicitly opt out with `requireApproval: false`; the client has **no write path** to the filesystem — every edit goes through the AI tools.
|
|
30
30
|
|
|
31
|
+
Inside Better Sidebar, the mindmap list uses the host's 14px body typography. Markdown files carry a compact M badge; folders and other files use 14px outline icons. Other file formats are display-only, without hover feedback, opening, dragging, or context menus; folders remain expandable. Tabs, actions, and hints use the host's 12px typography role. Standalone mode retains its original appearance, and mindmap node typography, zoom, and image export are unchanged.
|
|
32
|
+
|
|
33
|
+
The embedded M badge uses a transparent background and inherits the filename's theme color for both its bold letter and outline, so it follows light/dark themes and custom skins without relying on accent-color contrast.
|
|
34
|
+
|
|
31
35
|
## Requirements
|
|
32
36
|
|
|
33
37
|
| Component | Baseline |
|
package/README.zh-CN.md
CHANGED
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
- **四个工具**(`mindmap_create` / `mindmap_open` / `mindmap_get` / `mindmap_update`)——会话工作目录里的普通 `.md` 文件;根节点标题 = 文件名,双向同步(`renameRoot` 触发文件重命名,撞名报错不覆盖)。
|
|
19
19
|
- **零通道实时面板**——面板直接消费会话快照里的 `mindmap_*` 工具结果,AI 每改一步面板即渲染一次。
|
|
20
20
|
- **打开必达 + 加载态可恢复**——AI create/open 结果落地,面板必展开(节点结构指纹驱动快照重算,不受宿主数组引用稳定性影响);点目录树 `.md` 后的加载态有三条恢复路径:路径仅大小写不一致时自动匹配(大小写不敏感文件系统)、工具报错即时显示错误信息、约 30 秒无结果转超时提示——错误/超时态均带「重试」一键重发打开指令。
|
|
21
|
-
-
|
|
22
|
-
- **常驻目录树 tab**——工作目录结构懒加载树(插件自建只读路由);空白处/目录右键新建脑图;左键点 `.md` 秒开 tab 并自动交给 AI
|
|
23
|
-
-
|
|
21
|
+
- **原生侧栏 Tab 或右侧悬浮面板**——安装了 `dsh-better-sidebar` 时,脑图注册为 Better Sidebar 内的原生单实例 Tab(`dsh-mindmap:mindmap`),工具栏只有一行(脑图列表、当前脑图、导出图片在同一行);头部「思维脑图」按钮打开或聚焦该 Tab。未安装时回退为独立的右侧悬浮面板——会话头部按钮开合,宽度可拖(280px ~ 80% 视口)并持久化,打开时**聊天区向左让位**(布局推挤,互不遮挡)。AI 创建、打开或查看脑图时自动展开或聚焦面板/Tab 并切换到目标文档,即使当前收起或重复打开同一文档也能接续跟随。模式切换完全可逆:Better Sidebar 运行中卸载后,独立面板与布局推挤 CSS 自动恢复。
|
|
22
|
+
- **常驻目录树 tab**——工作目录结构懒加载树(插件自建只读路由);空白处/目录右键新建脑图;左键点 `.md` 秒开 tab 并自动交给 AI 打开,随后直接对话继续编辑。独立面板模式标签为「目录」,侧栏模式标签为「脑图列表」。
|
|
23
|
+
- **单脑图模式**——面板只有树/列表和「脑图」两个 tab,打开新脑图替换旧的那颗。
|
|
24
24
|
- **「所见即所编」焦点同步**——可见脑图与 AI 工作文档不一致时,面板自动让 AI 打开它,聊天焦点始终跟随你的眼睛。
|
|
25
25
|
- **MarkGrove 同款映射与连线**——标题层级挂树、列表缩进(空项 = 占位节点)、代码块叶节点、段落升格为独立节点(019 块概念)、稳定结构 ID、节点间直角折线。
|
|
26
26
|
- **画布居中、缩放与平移**——脑图打开后居中呈现(超出画布时可滚动、无边缘裁剪);画布右上角浮动缩放条(缩小 / 比例 / 放大 / 适配),打开时自动适配合适比例(小图保持 100%),25%–300% 逐级缩放且视图中心不跳变,AI 编辑后持续自动再适配,直到你手动缩放。点击任意节点即可聚焦:节点滚到画布左侧居中,视图放大到它和整棵子树完整可见(上限 100%)。画布还能拖着走:**中键**随处拖(含节点上)、**空白处左键拖**(Mac 触控板「点按并拖移」)、或 **Space + 左键拖**(必须从节点上起手时);无论内容是否溢出都可横纵双向拖动,内容跟手 1:1,空白处呈抓手光标,4px 阈值把拖与点分开——点空白仍取消选中、点节点仍聚焦,真拖不会误清选中圈。
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
- **PNG 导出**——面板右上角「导出图片」一键导出当前脑图。
|
|
29
29
|
- **安全**——`mindmap_create`/`mindmap_update` 默认进入原生审批;可通过 `requireApproval: false` 为自动化场景明确关闭。客户端**没有任何写文件通道**,一切编辑都经 AI 工具。
|
|
30
30
|
|
|
31
|
+
内嵌 Better Sidebar 时,脑图列表采用宿主的 14px 正文字体。Markdown 文件显示紧凑的 M 徽标,文件夹与其他文件使用 14px 线框图标;其他格式文件仅展示,没有悬停反馈、打开、拖拽或右键菜单,文件夹仍可展开。标签、操作按钮和提示采用宿主的 12px 字体角色。独立模式保留原有外观;脑图节点的字体层级、缩放和图片导出保持不变。
|
|
32
|
+
|
|
33
|
+
内嵌 M 徽标采用透明底、粗体字母与细描边,字母和边框跟随文件名的主题文字颜色;浅色、深色及自定义皮肤切换时同步适配,不依赖品牌色与底色的对比。
|
|
34
|
+
|
|
31
35
|
## 环境要求
|
|
32
36
|
|
|
33
37
|
| 组件 | 基线 |
|