Repository navigation
Conversation
手机上看一轮回复,会连着冒出七八条气泡:「明白,这确实是真实痛点…」「dsh 是…」
「zcode 是…」,最后才是结论。这些是模型在两次工具调用之间写的旁白(工作过程),
不是用户要看的东西——电脑端早就把它们收进「工作过程」折叠条了,手机端没有。
根因在投影层:apps/desktop/src/main/services/remote/web/views.ts 的 toWebMessages
每遇到一次工具调用就 endText(),于是每次工具调用都把前一段旁白断成一个独立气泡。
电脑端不是这样走的:blocks.tsx 的 splitProcess 把最后一个过程块之前的全部内容
(含夹在工具中间的正文)收进折叠条,之后的才算回复。
改法:投影时沿用同一套切法。
- shared/remote-web.ts:WebPart 增加 { k: 'process'; parts: WebPart[] }。
- remote/web/views.ts:记录最后一个工具调用时的 parts 位置,收尾时把该位置之前的
说明文字合成一段 process。判据同电脑端 splitProcess 的 hasVisible——后面还有正文、
或本轮有交付文件,才值得折叠;否则(比如中断在工具调用上、一句话没写)内容照常
显示,不要把仅有的东西也藏起来。note / 回执这类固定块留在折叠条外面。
- mobile/chat.tsx:新增 Process 组件,一行灰字「工作过程(N 段)」,点开才展开原文,
默认收起。复用成员卡已有的 .mfold 折叠动画(grid 1fr↔0fr)。
- mobile/strings.ts、mobile.css:文案与样式。
真机验证(Electron 实际渲染):
- 收起态高度 0、visibility hidden;展开态 150px、visible;
- 箭头收起 none、展开 rotate(180deg);
- 折叠判定 9 项断言:典型多工具轮次收成一段并保留最终回复、无工具调用不折叠、
中断在工具调用上不折叠、有交付文件时折叠且文件留在外面、note 固定在折叠外。
- typecheck、build 通过。
This branch has not been deployed
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.
问题
手机上看一轮回复,会连着冒出七八条气泡:
最后那条才是结论。前面那些是模型在两次工具调用之间写的旁白(工作过程),不是用户要看的。
电脑端早就把它们收进「工作过程」折叠条了,手机端没有。
根因
在投影层。
apps/desktop/src/main/services/remote/web/views.ts的toWebMessages每遇到一次工具调用就endText():于是每次工具调用都把前一段旁白断成一个独立气泡。
电脑端不是这样走的:
blocks.tsx的splitProcess()把最后一个过程块之前的全部内容(含夹在工具中间的正文)收进折叠条,之后的才算最终回复。shared/remote-web.ts的注释其实写明了现在是有意为之:「助手的一轮里每段正文(两次工具调用之间写的话)是一个 text 部分,手机上各自一个气泡」。这在 IM 场景说得通,但手机端同时也是「在手机上看 Deva 干活」的入口,那时只想看结果。改法:投影时沿用同一套切法
shared/remote-web.tsWebPart增加{ k: 'process'; parts: WebPart[] }remote/web/views.tsparts位置,收尾时把该位置之前的说明文字合成一段processmobile/chat.tsxProcess组件:一行灰字「工作过程(N 段)」,点开才展开,默认收起mobile/strings.ts、mobile.css.mfold折叠动画折叠判据同电脑端
splitProcess的hasVisible:后面还有正文、或本轮有交付文件,才值得折叠。否则(比如中断在工具调用上、一句话没写)内容照常显示——不要把仅有的东西也藏起来。note、回执这类固定块留在折叠条外面。这是行为变更
默认收起会改变所有人的手机端体验,所以写清楚:
如果维护者认为应保留现在的平铺展示,可以把默认值改成展开,或加一个设置项;改动集中在一个
useState(false)。验证
真机(Electron 实际渲染):
visibility: hidden;展开态 150px、visiblenone,展开rotate(180deg)note固定在折叠外typecheck、build通过