Repository navigation
feat(chat): fold AI process by round + quiet fold bar + row rhythm - #8
Merged
Merged
Conversation
PR-1 + PR-2 + P1-3 of the chat-page UI plan (会话页UI优化建议报告.md): Round model (ChatFlatItems.kt): - fold unit is now the ROUND (user message -> next user message), not the assistant message: one bar per round, round-wide totals, bar owned by the round's LAST assistant message (messageId == expansion key) - rules: <=2 foldable steps never fold; a running round is always open (effectiveExpanded = isRunning || expanded) so completion auto-collapses with no trigger of its own; a collapsed round keeps its latest 2 steps visible; speaker/sub-agent filters extracted into effectiveBlocks so the pre-pass and the row loop can never disagree about foldable steps - isFloatingProcessTool: single channel — with folding on the running round renders every step in-list, so the viewport-pinned overlay only serves fold-OFF mode (removes the in-flight tool double display) Fold bar (ChatAssistantMessageUI.kt): - quiet divider style: centred label between two hairlines in onSurfaceVariant (taixu RoundCollapseButton pattern), failure tints the status icon with theme error; copy unchanged (chat_process_summary_*) Row rhythm (P1-3): - flatItemTopGap pure projection replaces LazyColumn spacedBy(2.dp) and the per-row ad-hoc paddings (UserBubble 10/14+4, AssistantHeader 10+2, ThinkingBlock 4, ToolCallPill 3): user bubble 12dp (16dp back-to-back), user->header 16dp, process->process 2.5dp, process->text 4dp, same-message md flow 2dp, default 8dp Tests: ChatFlatItemsProcessFoldTest / ToolOnlyFoldTest rewritten to the new contract (running rounds open, <=2 never folds, keep-2 tail, multi-message rounds, resume joins the previous round); timeline/group-speaker/sub-agent suites unchanged and still green.
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.
背景
会话页 UI 对标报告(taixu / OmniBot)的 PR-1 + PR-2 + P1-3 合并落地:AI 过程折叠从"按 assistant 消息"改为"按轮次",折叠条降噪,行间距建立节奏体系。用户已确认折叠条文案保持原样(
chat_process_summary_*未动)。轮次折叠模型(ChatFlatItems.kt)
messageId== 展开键,ChatScreen 的切换代码零改动)effectiveExpanded = isRunning || expanded)——完成即自动收起,无需任何收起触发器;effectiveBlocks,轮次预扫描与行循环共享,折叠条统计与实际渲染永不漂移isFloatingProcessTool在折叠开启时恒为 false——运行中的轮次在列表内展示全部步骤,视口底部悬浮条不再重复显示同一张工具卡(悬浮条仅服务折叠关闭模式;PR-3 将整体移除)折叠条降噪(ChatAssistantMessageUI.kt)
居中文字 + 两侧发丝线(taixu RoundCollapseButton 模式),onSurfaceVariant 主题色,失败仅状态图标染 error——替换原来的 accent 填充卡片 + 描边 + iOS 蓝/红硬编码。文案不变。
行间距节奏(P1-3)
flatItemTopGap纯函数投影替换spacedBy(2.dp)与各行自带 padding(UserBubble 10/14+4、AssistantHeader 10+2、ThinkingBlock 4、ToolCallPill 3):测试
ChatFlatItemsProcessFoldTest/ChatFlatItemsToolOnlyFoldTest按新契约重写:运行中全开、≤2 不折、保留最新 2 步、多消息轮次一条折叠条、resume 续写并入前一轮、轮次键 = 最后一条 assistant 消息 id风险与回滚
行为变更点:折叠开启时运行中的轮次不再"边跑边收"(改为完成后整体收起,与 taixu/OmniBot 一致);悬浮工具条在折叠开启时不再出现(列表内已展示)。回滚 = revert 本提交,无数据迁移。