Repository navigation
fix: 完成割字与整块闪烁根因——撤销#342高度动画+收尾尾巴按流式节奏逐字补完 - #351
Merged
Merged
Conversation
taekchef
force-pushed
the
codex/stream-polish-3
branch
2 times, most recently
from
August 22, 2026 14:20
53a07a6 to
b2ab452
Compare
对照打磨好的流式PR(53ef8be/a0bcd37/3b303f3)逐段 diff 确认:网页流式引擎 在好状态与现在完全一致,完成瞬间的割字+闪块来自两处: 1. #342 引入的收尾高度缓动(撤销):WebView 内容瞬间到位而行高 140ms 渐追,期间 .clipped() 把最后一行下半裁掉——好状态高度是瞬时定格, 最多闪一帧。恢复瞬时赋值。 2. 完成时一次性倾倒未流式文本(节奏化):模型收尾段常只在结束载荷里 到达,叠加显示泵抽干,finish 把整段尾巴一次 push,>24 字符不吃淡入 →整块弹出+行高跳。改为纯增量尾巴>24字符时按 12字/33ms 流式节奏 逐字补完(同淡入同光标,上限8秒强制收束),补完再结束会话。 非增量(前文改写)仍走整档路径;新的流式推送/stop 会打断节奏。 浏览器逐帧复现验证:节奏化下旧段落位置零位移、文字271→464按步长长、 光标跟随至补完;swift build 通过;test:editor 17/17。
taekchef
force-pushed
the
codex/stream-polish-3
branch
3 times, most recently
from
August 22, 2026 14:42
27717ae to
773a40a
Compare
对照打磨好的流式PR逐段diff确认:网页流式引擎在好状态与现状完全一致,问题在: 1. #342 高度缓动(撤销):内容瞬间到位而行高140ms渐追,期间.clipped()裁掉 最后一行下半——好状态高度是瞬时定格。 2. 完成时一次性倾倒未流式文本:模型收尾段常只在结束载荷到达,叠加显示泵 drainNow抽干,finish整段push,>24字符不吃淡入→整块弹出+行高跳。 改为纯增量尾巴>24字符时按12字/33ms逐字补完(同淡入同光标),补完再 结束会话;墙钟3秒/240tick上限强制收束;单步异常兜底整档落地。 节奏化由原生显式开启(finishStreamingMarkdown(text,{paced:true})): 无窗口/隐藏 WebView 会整体挂起 JS 定时器,自检环境不能依赖;App 侧有 活定时器享受节奏化,自检走同步契约保持确定性。自检的 ok/mermaidError 断言改为到截止时间才判死。淡入装饰映射加文档边界保护(大diff替换时 resolve越界会炸掉整次dispatch)。 验证:本地 WeiBeiWebEditorCheck 连续绿×2;浏览器真实bundle节奏路径 完整补完(129→130块,旧段落零位移);typecheck/test:editor 18/18; swift build 通过。
taekchef
force-pushed
the
codex/stream-polish-3
branch
from
August 22, 2026 14:50
773a40a to
da8a09e
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.
对照好状态定位
按用户要求把「打磨好的流式PR(淡入/动效重构/泵节拍)」与现状逐段 diff:网页流式引擎代码在好状态(720ba75)与现在完全一致,完成链路无差异。现状问题是:
.clipped()把最后一行下半裁掉——好状态是瞬时定格,最多一帧。这也解释了用户『之前都好好的』:fix: 流式收尾两处体验回退——窄布局状态词字号镜像与完成跳变 #342 之前没有这个动画。改动
验证