Repository navigation
fix: 完成瞬间割行与尾段闪烁——收尾快照取新高度+门控测量回放+淡入自然过期 - #346
Merged
Merged
Conversation
真机复现(无头Chrome驱动真实viewer bundle)定位两条链: 1. 割行:finishStreamingMarkdown 返回的高度是收尾重排前的旧值(延迟到 完成才补的尾段让文档在收尾瞬间长高,流式期间100ms门控的上报又可能 落在等快照窗口内被丢,网页侧同值去重不再补报)→行高卡在旧值, 最后换行的下半被裁。修复:①editor.ts 收尾先同步 publishContentHeight, 返回值即最终布局高度(复现:延迟尾巴场景收尾返回 362→443); ②Swift 侧门控窗口内被拒的测量入缓冲,快照落地取 max 回放。 2. 尾段闪烁:流式结束后装饰器整体清空,刚打的字(260ms淡入未完)的 包裹 span 被瞬间拆掉,尾部文字闪一下。改为淡入条目自然过期、光标 照常消失(复现:贴近真实时序下收尾 DOM 变更 49→10,剩余为已过期 条目与光标,不可见)。 同场景复现确认:相同文本收尾时段落位置完全不动,'位置不一样'的观感 即割行导致的行高错位,非整档重排。
This was referenced Aug 22, 2026
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.
真机反馈
用户复现:#342 后①回答第二行下半部分被裁掉;②完成瞬间文字位置与流式不一致。
根因(无头 Chrome 驱动真实 viewer bundle 复现)
割行+位置错位是同一件事:行高卡在收尾前的旧值。链路:完成时部分尾段才落进文档(流式显示泵节拍+最后token),finishStreamingMarkdown 同步返回的高度是重排前旧值;期间网页 40ms 定时上报若落在'等收尾快照'窗口内会被 Swift 丢弃,而网页侧同值去重后不再补报——行高永久卡短,最后换行的下半被 .clipped() 裁掉,下方内容整体上移,看起来'位置跟流式不一样'。复现确认相同文本收尾时段落位置完全不动,不存在整档重排。
尾段闪烁:流式结束装饰器整体清空,淡入未完(260ms)的尾部字符包裹 span 被瞬间拆除。
修复
验证