Repository navigation
[skip eval] fix: 推荐问题先占位再淡入,回答结束不再停顿 - #387
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 11, 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.
问题
回答写完后,推荐问题要过 0.6 到 1.5 秒才出现,而且是「你可能想问」和三条问题整块一起弹出来,看起来像卡了一下。dev 实测:回答结束后约 0.7 秒内界面没有任何变化,然后整块出现。
原因
推荐问题要基于完整回答生成,后端在正文结束后才开始生成,并等结果通过
suggested_questions_ready送达后才关闭流。前端只在流关闭(!isStreaming)后才渲染推荐区,所以生成期间没有任何占位,加载提示也显示不出来。改动
AssistantMessage:消息已标记推荐问题生成中(suggestedQuestionsStatus === 'pending'),并且打字机已经把正文全部显示完时,流还没关闭也先渲染推荐区。不生成推荐的消息,以及正文还在逐字显示的消息,行为不变。SuggestedQuestions:加载状态从一行跳动的小点,改成「你可能想问:」标题加三行与问题按钮等高的占位条。问题到达后原位淡入(300ms,开启减少动态效果时不做动画),高度不再跳。「正在生成可继续追问的问题...」改为只对读屏可见。只改了前端展示,不影响模型行为,也不影响后端送达逻辑。
验证
🤖 Generated with Claude Code