Skip to content

v1.5.0 — 属性、局部关系图谱与链接状态

Choose a tag to compare

@DedsecLemon DedsecLemon released this 26 Oct 12:30
· 7 commits to main since this release

v1.5.0 — 属性、局部关系图谱、链接状态

三件事之前都缺,而且缺的原因相同:面板只看得见眼前这一篇笔记。

属性(frontmatter)—— 显示,而不是丢弃

// Drop YAML frontmatter: it is metadata, not prose. —— 这句话对一份文档成立,对一个侧栏阅读器不成立。这篇笔记是什么(type、status、parent)、怎么归档(tags),恰恰是最该先看到的。

现在笔记页顶部有一个可折叠的属性卡,按文件里的顺序列出:列表变 chips、布尔打勾、日期与数字照原样、值是 [[链接]] 的仍然可点。渲染器与属性卡共用同一个 parseProperties,两边对「正文从哪开始」不可能有分歧。

关系图谱 —— 只做局部(反向链接 + 本文引用)

笔记页底部是这篇笔记的边:

  • 引用本文:哪些笔记链到这里,并显示那一行原文
  • 本文引用:这篇链接到谁,坏目标标出来

点任意一行,目标笔记打开成它自己的一页 —— 顺着链接走不会丢掉正在读的那篇。

全库关系图谱是刻意不做的:窄侧栏里一张发丝球图提供不了信息,这个功能在早期设计时就被否掉过。读者真正需要的是脚下这条边。

数据来自一条新路线 GET /dsh-obsidian/links:走一遍库,返回每篇笔记的标题、摘录、标签,以及它的 [[链接]] 落到哪里。本库实测 714 篇 / ~1080 条链接 / ~0.5 秒 / ~290 KB,缓存 15 秒(?refresh=1 重建,面板上的 刷新 就是它)。它和搜索一样有界 —— 文件数/字节/深度上限 + truncated 标记,因为建索引等于把整个库读一遍。

链接状态 —— 断链看得出来,悬停有预览

  • 指向不存在笔记的 [[链接]:变淡 + 虚线 + 悬停说明「笔记不存在:X」—— 否则一张密集的目录通篇一个颜色,断了一半也看不出来
  • 悬停正常链接:浮出一张卡,显示目标标题 + 目标开头一句;目标不存在时明确说出来,而不是给一张空卡

可验证

  • render-check 新增:属性种类与正文剥离、属性卡渲染、断链样式、悬停卡、以及 backlinksOf / outlinksOf / linkStatus / previewOf 的派生逻辑
  • mount-check 新增一步:挂载一篇笔记,断言属性卡、1:2 的边计数、断链样式,以及点反向链接会打开那篇笔记
  • host-check 对真实知识库断言索引:覆盖 714 篇、链接能解析到已索引的笔记、[[笔记.md]] 也能解析、同页锚点不会被当成外链、刷新能重建
  • 仓库 render / mount / host(110) / manifest(24) / platform(30) / lifecycle(10) 全绿

升级提醒

宿主半改了,这次必须重启 DSH(只刷新页面不行 —— 没有 /links 路线,属性卡与关联面板会是空的/不出现)。

English

v1.5.0 adds the three things the panel was missing because it only ever looked at the note in front of it.

Properties: frontmatter was dropped as "metadata, not prose". In a sidebar reader it is the first thing you want — what the note is and how it is filed. The note page renders it as a collapsible card in file order (lists as chips, booleans ticked, dates and numbers as themselves, [[links]] clickable), and the renderer reads the same parseProperties, so card and body cannot disagree.

The graph, locally: GET /dsh-obsidian/links walks the vault once and returns every note's title, excerpt, tags and where its [[links]] land — this vault: 714 notes, ~1080 links, ~0.5 s, ~290 KB, cached 15 s. The page shows 引用本文 (who links here, with the line) and 本文引用 (what this links to, broken targets marked); every row opens its note as its own page. A whole-vault graph stays rejected on purpose: a narrow sidebar cannot show it usefully.

Link states: an unresolved link is muted with a dashed underline and says so on hover; any link's hover shows a card with the target's title and first line, and a missing target says that instead of showing an empty card.

Pinned by new render-check assertions (property kinds, the card, broken-link style, hover card, and the backlink/outlink/preview derivations), a new mount-check step (properties card, 1:2 edges, broken style, clicking a backlink opens that note), and host-check assertions against the real vault (coverage, resolution, .md targets, anchors not leaking as edges, refresh). Restart DSH — the host half changed.