fix: route mounted Tolaria workspace links

This commit is contained in:
冰朔 2026-07-17 11:31:28 +08:00
parent d7afc7943d
commit 40a4e347fc
3 changed files with 33 additions and 1 deletions

View File

@ -48,6 +48,9 @@
10. `0010-fix-resolve-relative-page-links-from-source-notes.patch` 10. `0010-fix-resolve-relative-page-links-from-source-notes.patch`
- 按当前笔记所在目录归一化 `../``./` 页面路径; - 按当前笔记所在目录归一化 `../``./` 页面路径;
- 避免多个页面都叫 `README.md` 时跳到错误页面。 - 避免多个页面都叫 `README.md` 时跳到错误页面。
11. `0011-fix-resolve-links-inside-mounted-workspaces.patch`
- 使用来源页面所属的挂载工作区解析相对路径;
- 主仓与挂载知识库同时打开时仍能跳到正确页面。
## 恢复与验证 ## 恢复与验证
@ -62,12 +65,13 @@ git am /path/to/0007-feat-complete-portable-page-block-set.patch
git am /path/to/0008-fix-restore-internal-note-links-and-reading-rhythm.patch git am /path/to/0008-fix-restore-internal-note-links-and-reading-rhythm.patch
git am /path/to/0009-test-lock-in-readable-editor-theme-defaults.patch git am /path/to/0009-test-lock-in-readable-editor-theme-defaults.patch
git am /path/to/0010-fix-resolve-relative-page-links-from-source-notes.patch git am /path/to/0010-fix-resolve-relative-page-links-from-source-notes.patch
git am /path/to/0011-fix-resolve-links-inside-mounted-workspaces.patch
pnpm build pnpm build
pnpm lint pnpm lint
``` ```
`0001``0002` 保留为早期两补丁拆分档案;只有在不使用 `0003` `0001``0002` 保留为早期两补丁拆分档案;只有在不使用 `0003`
原型系列时才单独应用。上述 `0003 → 0010` 顺序已于 2026-07-17 原型系列时才单独应用。上述 `0003 → 0011` 顺序已于 2026-07-17
在服务器最新 `bingshuo/guanghu@514ab19` 的新克隆上完整复现。 在服务器最新 `bingshuo/guanghu@514ab19` 的新克隆上完整复现。
## 研发规则 ## 研发规则

View File

@ -0,0 +1,26 @@
From 387ce84da12f33c64d179d7e2582124ae952091f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=86=B0=E6=9C=94?= <565183519@qq.com>
Date: Fri, 17 Jul 2026 11:31:05 +0800
Subject: [PATCH] fix: resolve links inside mounted workspaces
---
src/components/SingleEditorView.tsx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/components/SingleEditorView.tsx b/src/components/SingleEditorView.tsx
index 0440e5a..a0e2dc8 100644
--- a/src/components/SingleEditorView.tsx
+++ b/src/components/SingleEditorView.tsx
@@ -1208,7 +1208,8 @@ export function SingleEditorView({ editor, entries, onNavigateWikilink, onChange
handleMouseMove: handleCodeBlockCopyMouseMove,
} = useCodeBlockCopyTarget(containerRef)
useBlockNoteSideMenuHoverGuard(containerRef)
- useEditorLinkActivation(containerRef, onNavigateWikilink, vaultPath, sourceEntry?.path)
+ const sourceVaultPath = sourceEntry?.workspace?.path ?? vaultPath
+ useEditorLinkActivation(containerRef, onNavigateWikilink, sourceVaultPath, sourceEntry?.path)
useEffect(() => {
_wikilinkEntriesRef.current = entries
--
2.50.1 (Apple Git-155)

View File

@ -31,6 +31,7 @@ Tolaria 页面路由的兼容层;当前页面还把部分参考路径放在代
- `apps/tolaria/patches/0008-fix-restore-internal-note-links-and-reading-rhythm.patch` - `apps/tolaria/patches/0008-fix-restore-internal-note-links-and-reading-rhythm.patch`
- `apps/tolaria/patches/0009-test-lock-in-readable-editor-theme-defaults.patch` - `apps/tolaria/patches/0009-test-lock-in-readable-editor-theme-defaults.patch`
- `apps/tolaria/patches/0010-fix-resolve-relative-page-links-from-source-notes.patch` - `apps/tolaria/patches/0010-fix-resolve-relative-page-links-from-source-notes.patch`
- `apps/tolaria/patches/0011-fix-resolve-links-inside-mounted-workspaces.patch`
- 桌面验收包:`HoloLake Era 0.1.4 Review` - 桌面验收包:`HoloLake Era 0.1.4 Review`
- Bundle ID`com.guanghu.desktop.review.20260717.page` - Bundle ID`com.guanghu.desktop.review.20260717.page`
- DMG SHA-256`846884e8…c66bc303a` - DMG SHA-256`846884e8…c66bc303a`
@ -39,6 +40,7 @@ Tolaria 页面路由的兼容层;当前页面还把部分参考路径放在代
- 回归测试先失败后修复:相对 Markdown 页面链接普通单击跳转; - 回归测试先失败后修复:相对 Markdown 页面链接普通单击跳转;
- 原生点击发现重复 `README.md` 会误跳后,再补回归测试:路径按来源页面目录归一化并跳到唯一正确页面; - 原生点击发现重复 `README.md` 会误跳后,再补回归测试:路径按来源页面目录归一化并跳到唯一正确页面;
- 挂载多工作区复测后,补齐来源页面所属工作区路径,避免拿当前主仓目录解析挂载页面链接;
- 定向 Vitest16 项通过; - 定向 Vitest16 项通过;
- ESLint、TypeScript 与 Vite production build 通过; - ESLint、TypeScript 与 Vite production build 通过;
- Tauri Apple Silicon App 与 DMG 构建通过; - Tauri Apple Silicon App 与 DMG 构建通过;