feat(editor): 审阅面板补齐成 Word 式审阅窗格——作者/类型/理由/处置联动(dev-board#377) - #708
Merged
Conversation
多方修订混在一份文档里时,律师分不清哪条是 AI 改的、哪条是自己或别人改的; AI 写的修订理由(批注)与修订本身也没有任何关联。四件事全在宿主侧做完,引擎不动。 1) 作者可辨识:每张修订卡带作者色条 + 作者 chip(AI WorkDeck 固定标识、自己的 显示「名字(我)」),顶部四桶筛选(全部/AI/我/其他人)。「我」的判据与 load_document 传给引擎的 authorName 同源(LibreOfficeEditor.currentAuthorName 抽成一处);拿不到用户名时任何非 AI 作者一律算「其他人」,不把未署名的算到 自己头上。四个数字恒按未筛选全量算。 2) 格式类修订正确标注:worker 如实回传 RedlineType 原串并带上 RedlineDescription, 面板映射成 插入/删除/格式/段落格式,认不出的原样显示引擎串。改造前只分 「Delete 与其余」,格式修订一律显示成「插入」。 3) 修订理由挂到修订上:list_revisions / list_comments 回传同一坐标系的 paraKey/start/end(rangeLocator 走 paraIndex 缓存二分定位),宿主纯函数按 「同段落 + 闭区间相交或首尾相接」关联——**不按批注正文前缀识别**, 「【修訂理由】」是模型自己写的、不固定。挂不上的批注照旧单独列,批注页标出 「已挂到 N 条修订」。跨 story(表格单元格/页眉页脚)定位不到时回 paraKey:-1, 一律不关联,宁可不挂也不猜。 4) 处置联动:接受/拒绝一张卡且引擎至少命中一条后,把该卡关联的理由批注按 id 标记为已解决(不删除——删了「当初为什么这么改」就永久消失)。一条都没命中 时不动批注;resolveAll 刻意不联动(拿不到处置了哪些)。 合并逻辑口径:作者与类型进合并判据(不同作者/类型绝不合并),理由不进(否则一次 替换的删+插会被切碎),整组理由取组内并集去重。批量处置仍走 resolve_revisions、 仍按降序传索引、仍以 redline 条数变化复核。 测试: - frontend/tests/project-home/review-grouping.test.mjs(纯函数 8 例) - frontend/tests/project-home/review-panel-author-reason.test.mjs(组件级 5 例, 共用底座 tests/_lib/review-panel-vm.mjs,喂真纯函数实现) - lowa-e2e 新增组 33(真引擎):作者双署名、两段不同 paraKey、加粗产生的 Format 修订经宿主映射标成「格式」、理由批注挂到第一段 AI 修订且不误挂同段落的用户 格式修订、按 id 标记已解决后批注仍在清单里 - 五处「还原病灶即转红」验证 + e2e 摘掉 list_comments 坐标后组 33 转红 - test:project-home 334 passed / test:lowa-unit 13 passed / test:lowa-e2e 541 passed / check:locales / check:emits 全绿 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
dev-board#377(#367 调查结论的落地项):用户分不清哪条修订是 AI 改的,AI 的修订理由批注与修订无关联。
四件事,全在宿主侧:
合并判据:作者与类型进判据,理由不进;批量仍走 resolve_revisions、降序索引、redline 条数复核。
验证:test:project-home 334/334(新增 13)、lowa-e2e 541/541(真引擎,新组 33 含真负例:同段不重叠的用户格式修订不被误挂)。子 agent 五处病灶还原各转红。主会话独立还原:authorKind 短路 → 5 红;dist 里 applyLocator 短路 → e2e 4 红;恢复后全绿。
未做:全部接受/拒绝不联动批注;表格/页眉页脚内不关联;ParagraphFormat 映射未在真机产生过。
🤖 Generated with Claude Code