Repository navigation
v1.6.0 — 目录树右键菜单 / A tree context menu
v1.6.0 — 目录树右键菜单 / A tree context menu
中文
目录里右键任意一行(或悬停出现的 ⋯ 按钮),就能直接在那一行上操作;同一行再点一次关闭菜单。
菜单内容
| 分组 | 文件行 | 目录行 |
|---|---|---|
| 打开 | 打开、编辑(打开并直接进编辑模式) |
— |
| 引入对话 | 引用到对话(@提及) |
— |
| 复制 | 复制 [[名称]] |
— |
| 关联 / 外部 | 查看关联、在文件管理器中显示、在 Obsidian 中打开 |
在文件管理器中显示 |
| 写操作 | 重命名…、移到 .trash… |
新建笔记… |
菜单是刻意的短:把正文插入对话 和另外三种「复制路径」都删了 —— 实际用起来它们和 引用到对话 / 复制 [[名称]] 重复,留着只是占位置。
写操作刻意保守
移到 .trash从不硬删除:移进<库>/.trash/<时间戳>-<原名>,可以手动移回来。重命名只改名字,不重写别的笔记里的[[链接]]—— 改名后断链样式会精确指出哪些链接失效了。新建笔记建单个文件 + 最小 frontmatter。- 三者都:按库根校验路径、目标已存在一律拒绝、Windows 会改写(
甲.)或建不了(NUL)的名字也拒绝,失败时说清原因。
「在文件管理器中显示」修好了两次
- 先修「完全没反应」:spawn 失败也回 200,现在只有真启动成功才报成功,失败会明确报错并提示「宿主还是旧版」。
- 再修「开了但看不见」:
explorer /select作为子进程启动会继承隐藏显示状态 —— 窗口建了、文件选中了、IsWindowVisible是 false。现在 Windows 上走已在运行的外壳(COM):窗口可见、文件选中、并提到前台。 - 最后修「开两次」:一次点击被执行两遍(菜单在 mousedown 关闭、重渲染后又投递一次 click)。客户端加 800ms 幂等窗(只对会产生可见副作用的动作),宿主再加 1200ms 同路径去重兜底。
English
Right-click any row in the tree — or the ⋯ button that appears on hover — and act on that row directly; a second click on the same row closes the menu.
What is in it
| Group | Note row | Folder row |
|---|---|---|
| open | 打开, 编辑 (opens already editing) |
— |
| hand off | 引用到对话(@提及) |
— |
| copy | 复制 [[名称]] |
— |
| links / elsewhere | 查看关联, 在文件管理器中显示, 在 Obsidian 中打开 |
在文件管理器中显示 |
| writes | 重命名…, 移到 .trash… |
新建笔记… |
Deliberately short: "paste the body into the conversation" and three of the four copy spellings were removed — in use they duplicated 引用到对话 and 复制 [[名称]], and a longer menu is a worse menu.
Writes stay conservative. .trash is a move into <vault>/.trash/<timestamp>-<name>, never a delete. Rename does not rewrite other notes' [[links]]; the broken-link styling then says exactly which links now miss. Create writes one file with a minimal frontmatter. All three validate against the vault root, refuse an existing target, refuse a name Windows would rewrite (甲.) or cannot create (NUL), and name the failure instead of swallowing it.
"Reveal in the file manager" took three fixes
- Fixing "nothing happens": a failed spawn still answered 200. Now only a real launch reports success, and a stale host is named as such.
- Fixing "it opened but was invisible":
explorer /selectas a spawned child inherits the caller's hidden show-state — the window existed, the item was selected, andIsWindowVisiblewas false. On Windows the route now asks the running shell through COM: the window comes out visible, selects the item, and is raised. - Fixing "it opens twice": one click ran the action twice, because the menu closes on
mousedownand a re-render delivers the click again. A per-action 800 ms guard (only for actions whose duplicate is visible) plus a 1200 ms same-path dedupe on the host.
Tests: host-check 139 assertions against the real vault (including the four write routes on files it creates and removes), mount-check 27 steps, render-check for the menu/dialog composition, plus the manifest, platform and lifecycle contracts.