阅读器内聚划线笔记与宿主回调 - #18
Open
hehetoshang wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
Talebook 模板在 candle-reader 外部再次实现了划线笔记工具栏和面板,两套选区监听与 UI 相互覆盖。本改动把划线笔记完整收回阅读器,并为宿主保留纯数据回调边界。
关键改动
annotation_callbacks.load/save契约;未注入时按书写入浏览器localStorage。实际验证
npm run lint:通过。npm run test:e2e -- --workers=1:42 passed。npm run build:通过。并行 E2E 在高负载下出现过既有 audiobook 自动播放高亮的时序超时(最终一次默认 2-worker 运行 41 passed / 1 failed);串行完整套件 42 passed,失败用例单独重跑通过。本次未修改有声书定位实现。
风险与兼容性
annotation_callbacks为可选新增参数,旧初始化代码不需要修改。load和save;已注入回调但调用失败时不会静默写本地,避免宿主与本地分叉。book_id隔离,缺省时使用book_url。截图
当前执行环境只有 CLI 提交通道,无法直接向 GitHub PR 上传本地截图;上述两个移动视口已通过 Playwright 实际渲染并人工检查。