DOC-FULL-037 P1 | SearchResult → NoteAnchor 转换 【status:todo】 #89

Closed
opened 2026-06-07 11:45:19 +08:00 by wangdl · 2 comments
Owner

search_result_to_anchor(search: SearchResult, material_id: &str) → NoteAnchor。MarkdownBlock→MarkdownBlock, TextLine→TextLine, PdfPage→PdfPage, EpubChapter→EpubChapter。

M-DOC-FULL v2 里程碑 issue。

## search_result_to_anchor(search: SearchResult, material_id: &str) → NoteAnchor。MarkdownBlock→MarkdownBlock, TextLine→TextLine, PdfPage→PdfPage, EpubChapter→EpubChapter。 M-DOC-FULL v2 里程碑 issue。
wangdl added this to the M-DOC-FULL:Document Runtime 完整阅读内核与学习事件协议 milestone 2026-06-07 11:45:19 +08:00
wangdl changed title from DOC-FULL-037 P1 | SearchResult → NoteAnchor 转换 to DOC-FULL-037 P1 | SearchResult → NoteAnchor 转换 【status:todo】 2026-06-07 19:15:11 +08:00
Author
Owner

审查结论:document runtime 当前有文件类型识别/MaterialType/PreviewMode/DocumentInfo(基本)/Markdown解析/Text解析/ImageMeta/Search(V1 Markdown+Text)/NoteAnchor(V1)/ReadingEvent(V1)/ReadingPosition(V1)/EventBuffer(V1基础)/iOS构建/UniFFI绑定/docs。但 V2 核心模型(ReadingSession/EventV2/ActiveTimeTracker)不存在,EventBuffer 缺 ack/failed,Position 缺 camelCase+clamp,PDF/EPUB/Office 为 stub,测试覆盖不足 V2。

本 Issue: search_result_to_anchor() 不存在。

状态: status:todo
工作类型: work:extend-existing

## 审查结论:document runtime 当前有文件类型识别/MaterialType/PreviewMode/DocumentInfo(基本)/Markdown解析/Text解析/ImageMeta/Search(V1 Markdown+Text)/NoteAnchor(V1)/ReadingEvent(V1)/ReadingPosition(V1)/EventBuffer(V1基础)/iOS构建/UniFFI绑定/docs。但 V2 核心模型(ReadingSession/EventV2/ActiveTimeTracker)不存在,EventBuffer 缺 ack/failed,Position 缺 camelCase+clamp,PDF/EPUB/Office 为 stub,测试覆盖不足 V2。 **本 Issue**: search_result_to_anchor() 不存在。 **状态**: status:todo **工作类型**: work:extend-existing
Author
Owner

验收完成(已于 #68/#69 实现)

验收内容

  • from_search_result(): SearchResult→SearchResultAnchor(#68 anchors.rs:101)
  • MarkdownBlock:block_id + snippet 保留
  • TextLine:line_number 保留
  • PdfPage:page_number 保留
  • EpubChapter:chapter_id 保留
  • to_position() 从 SearchResultAnchor 恢复:Pdf>Epub>Text>Markdown 优先级(#69)

测试覆盖

  • test_from_search_result_markdown — block_id 映射
  • test_from_search_result_pdf — page_number 映射
  • test_from_search_result_epub — chapter_id 映射
  • test_to_position_from_search_result_pdf — 恢复到 Pdf position
  • test_to_position_from_search_result_markdown — 恢复到 Markdown position

验证

cargo test anchors — 18 passed
## 验收完成(已于 #68/#69 实现) ### 验收内容 - [x] `from_search_result()`: SearchResult→SearchResultAnchor(#68 anchors.rs:101) - [x] MarkdownBlock:block_id + snippet 保留 - [x] TextLine:line_number 保留 - [x] PdfPage:page_number 保留 - [x] EpubChapter:chapter_id 保留 - [x] `to_position()` 从 SearchResultAnchor 恢复:Pdf>Epub>Text>Markdown 优先级(#69) ### 测试覆盖 - `test_from_search_result_markdown` — block_id 映射 - `test_from_search_result_pdf` — page_number 映射 - `test_from_search_result_epub` — chapter_id 映射 - `test_to_position_from_search_result_pdf` — 恢复到 Pdf position - `test_to_position_from_search_result_markdown` — 恢复到 Markdown position ### 验证 ``` cargo test anchors — 18 passed ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wangdl/zhixi-document-runtime#89
No description provided.