feat: support comment mode - #16
Open
renjie-run wants to merge 2 commits into
Open
Conversation
seafile-dev
reviewed
Aug 3, 2026
seafile-dev
left a comment
There was a problem hiding this comment.
Verdict: Comment
Warnings:
- 新增 comment mode 没有对应自动化测试,关键的启停、事件拦截、元素数据及滚动位置更新路径未受回归保护。见内联评论。
Suggested fix: 为 CommentModeAdapter 添加 JSDOM 测试,并覆盖 enable/disable、click/hover 的 postMessage payload、scroll RAF 合并和 destroy 清理。
seafile-dev
requested changes
Aug 3, 2026
seafile-dev
left a comment
There was a problem hiding this comment.
Verdict: Request changes
Blocking:
- Comment mode 的 postMessage 信任边界被绕过:任意嵌入方可启用模式,随后获得预览 DOM 的 htmlHint、文本、样式和坐标。见内联评论。
Warnings:
- 新增模式缺少关键交互回归测试;见此前评论。
seafile-dev
requested changes
Aug 3, 2026
seafile-dev
left a comment
There was a problem hiding this comment.
Verdict: Request changes
Blocking:
- Comment-mode control messages are accepted from an untrusted source, then selected-DOM data is posted back with
*; see inline comment.
Warnings:
- Hover state is never cleared after the pointer leaves the iframe; see inline comment.
- The earlier comment review also covers the missing regression tests.
seafile-dev
requested changes
Aug 3, 2026
seafile-dev
left a comment
There was a problem hiding this comment.
Verdict: Request changes
Blocking:
- Comment-mode control messages are accepted from an untrusted source, then selected-DOM data is posted back with
*; see inline comment.
Warnings:
- Hover state is never cleared after the pointer leaves the iframe; see inline comment.
- The earlier comment review also covers the missing regression tests.
seafile-dev
reviewed
Aug 4, 2026
seafile-dev
reviewed
Aug 4, 2026
seafile-dev
left a comment
There was a problem hiding this comment.
Verdict: Comment
Warnings:
IframeAdapter.destroy()对普通对象调用forEach,在 comment mode 已启用的销毁路径会提前抛错,导致监听器与 crosshair 样式残留;见新增内联评论。
Suggested fix: 使用Object.values(this.pendingRequests)迭代后再执行 CommentModeAdapter 清理,并增加该销毁路径的回归测试。
renjie-run
force-pushed
the
ai-page-comment
branch
from
August 8, 2026 06:39
fbf0073 to
a54bb73
Compare
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.
No description provided.