Skip to content

feat(notes): add cross-book word notes with WebDAV sync - #25

Merged
luyishui merged 0 commit into
luyishui:mainfrom
kiri603:codex/cross-book-word-notes
Nov 29, 2026
Merged

luyishui merged 0 commit into
luyishui:mainfrom
kiri603:codex/cross-book-word-notes

Conversation

@kiri603

@kiri603 kiri603 commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

使用场景

在一本书里为一个词记下释义或用法,之后在另一本书遇到同一个词时可以点开查看和编辑。新建笔记时可勾选「对所有书中的同一单词生效」,原有的单书笔记仍可使用。

改动

  • 统一存储跨书词条,通过笔记编辑器和阅读器弹窗查看、更新、删除或取消跨书生效。
  • 开启 WebDAV 自动同步后,通过 Readest/System/word-notes.json 合并跨书词条和删除记录。手动按书上传和下载沿用原有范围。
  • 合并同一个词在不同设备创建的条目时,保留原批注引用。远端快照结构不合法时保留远端文件。服务端支持强 ETag 时,使用条件写入并在冲突后重新读取合并。

验证

  • 应用全量 Vitest 通过(42 个测试文件,381 项测试),其中 64 项覆盖笔记编辑、跨书查找、同步合并、删除与冲突重试。
  • TypeScript 检查通过,变更文件通过 ESLint 和 Prettier。
  • 双设备真机验证待补。可以在设备 A 的第一本书创建跨书词条,在第二本书点开同一个词。开启自动同步后,在设备 B 编辑该词条,再从 A 验证更新和删除是否传播。

@luyishui

Copy link
Copy Markdown
Owner

感谢 @kiri603 的贡献!我们已经把改动整合进当前开发分支,并针对冲突、评审修复和移动端 UI 做了调整。commit 中已通过 Co-authored-by 保留你的署名。这个 PR 暂时先不关闭,感谢!

luyishui added a commit that referenced this pull request Nov 28, 2026
Merge PR #24 and PR #25 with review fixes and regression coverage.

Co-authored-by: kiri603 <212926027+kiri603@users.noreply.github.com>

Refs: #24

Refs: #25
luyishui added a commit that referenced this pull request Nov 28, 2026
PR #24: cross-device reading progress
- merge per-book config with progressUpdatedAt and four-state JSON merge
- add cross-window lease, light tick, applySyncedProgress
- touches WebDavAutoSyncRunner, contentMerge, engine, readerStore, bookDataStore

PR #25: cross-book word notes
- add WordNote/WordNoteTombstone and Settings/word-notes.json
- sync word-notes.json over WebDAV with tombstones
- add notebook/annotator UI and 17 regression tests
- touches wordNotesStore, wordNotesSync, WordNotePopup, useWordNotes

42 files changed.

Refs: #24
Refs: #25
Co-authored-by: kiri603 <212926027+kiri603@users.noreply.github.com>
luyishui added a commit that referenced this pull request Nov 28, 2026
PR #24: cross-device reading progress
- merge per-book config with progressUpdatedAt and four-state JSON merge
- add cross-window lease, light tick, applySyncedProgress
- touches WebDavAutoSyncRunner, contentMerge, engine, readerStore, bookDataStore

PR #25: cross-book word notes
- add WordNote/WordNoteTombstone and Settings/word-notes.json
- sync word-notes.json over WebDAV with tombstones
- add notebook/annotator UI and 17 regression tests
- touches wordNotesStore, wordNotesSync, WordNotePopup, useWordNotes

42 files changed.

Refs: #24
Refs: #25

Co-authored-by: kiri603 <212926027+kiri603@users.noreply.github.com>
@luyishui
luyishui merged commit a20e84f into luyishui:main Nov 29, 2026
luyishui added a commit that referenced this pull request Nov 29, 2026
- harden device baselines, unverified fingerprints, and remote probing
- add cross-window sync lease and auto-sync policy
- add word-note store, helpers, and UI wiring
- expand regression coverage for progress and word-note sync

38 files changed.

Refs: #24
Refs: #25
@luyishui

luyishui commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

补充更正一下上条留言:之前说“通过 Co-authored-by 保留署名”不够准确。Co-authored-by 会显示在 commit 页面和个人贡献图,但 GitHub 仓库的 Contributors 列表只统计 commit author,不统计 co-author,所以不会出现在仓库贡献者列表里。抱歉。

我们已经调整了合并方式:PR #24 的 5e2752da 和 PR #25 的 c55f7bf1 已作为原始 commit 保留进 main,作者仍是 @kiri603;后续评审修复单独提交。现在仓库 Contributors 已统计到你的 2 个 commit。由于原始 commit 已进入 main,GitHub 已将这两个 PR 标记为 MERGED;感谢!

@luyishui

Copy link
Copy Markdown
Owner

@kiri603 同步一下最终状态:

你的两个 PR 都已经合并进 main:

合并时我们针对冲突、设备同步基线、词条存储和回归测试做了一些 review 修复,这些修复放在单独的 commit 里,没有覆盖你的作者身份。

由于原始 commit 已进入 main,GitHub 自动把这两个 PR 标记为 MERGED,Merged 状态无法再改回 OPEN;如果后续还有问题,直接在这里留言即可。

感谢你的贡献!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants