DOC-FULL-019 P0 | NoteAnchor 完整模型 【status:partial】 #68
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Material/MarkdownBlock/TextLine/PdfPage/Image/EpubChapter/KnowledgeItem/SearchResult 类型,含 materialId/knowledgeItemId/blockId/lineNumber/pageNumber/chapterId/positionSnapshot
M-DOC-FULL 里程碑 issue。详见设计文档。
DOC-FULL-019 P0 | NoteAnchor 完整模型to DOC-FULL-019 P0 | NoteAnchor 完整模型 【status:partial】审查结论: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: anchors.rs 7 种类型。from_position() 实现。缺: from_search_result()、SearchResult anchor 映射。
状态: status:partial
工作类型: work:extend-existing
完成报告
改动文件
crates/zx_document_core/src/anchors.rs— NoteAnchor 枚举新增SearchResultAnchor变体(material_id + block_id/line_number/page_number/chapter_id + snippet),新增position_snapshot: Option<ReadingPosition>字段到 6 个变体(Material/MarkdownBlock/TextLine/PdfPage/Image/EpubChapter),新增from_search_result()构造函数crates/zx_document_ffi/src/lib.rs— 新增create_note_anchor_from_searchuniffi 导出 + C-ABI 包装crates/zx_document_ffi/src/zx_document.udl— 更新 NoteAnchor 枚举(SearchResultAnchor + position_snapshot)向后兼容
position_snapshot使用#[serde(skip_serializing_if = "Option::is_none", default)],旧 JSON 无此字段仍可正确反序列化test_backward_compat_no_snapshot验证测试覆盖(6 个新增)
test_from_search_result_markdown/test_from_search_result_pdf/test_from_search_result_epubtest_search_result_anchor_serde/test_anchor_serde_with_snapshot/test_backward_compat_no_snapshot代码证据
验证