restyle chat ui - #622
Conversation
- Introduced macOS DMG settings in tauri.conf.json, including custom background image and window/app positioning. - Added a new background image for the DMG installer.
…tion scripts - Added macOS DMG settings to the Makefile, including background image and volume icon configurations. - Introduced a new Python script for deterministic DMG layout, ensuring stable Finder metadata. - Created a verification script to check the integrity of the generated DMG, ensuring required files and symlinks are present. - Updated GitHub Actions workflow to install the necessary dmgbuild tool for building DMGs.
…ffTable, FilterTable, FineTuneCard, Flowchat, and LoadingState
…unctionality - Updated CSS for chat gallery to enhance overflow handling and layout consistency. - Modified `ComposerGallery` to support additional props and improve state management. - Introduced new `LIVEAGENT_OVERVIEW_MESSAGES` for project overview in fixtures. - Added scenario for `liveagent-overview` to enhance conversation context. - Integrated `GalleryComposerHarness` into `TranscriptGallery` for better composer handling. - Improved Markdown styling for better readability and consistency across components.
- Introduced a new TaskRows component to display task progress with animated status indicators. - Implemented SpinnerRing and Badge components for visual feedback on task states. - Enhanced task detail display with expandable rows and dynamic status updates. - Updated tests to validate the new task progress semantics and UI behavior. - Adjusted existing test cases to accommodate the new structure and ensure consistency.
…tus tests - Changed the opacity class assertion in AskUserQuestionCard test from "opacity-55" to "opacity-50". - Refactored AssistantStatus test to simplify the rendering check, ensuring it validates the text-only label without the Loader2 component. - Adjusted imports and removed unused components in AssistantStatus for cleaner code.
|
PR governance checks failed — this PR has been converted to draft.
Fix the items above, then click Ready for review to re-run the checks. |
…ompact chip design - Added a `compactChip` prop to `ToolCallItem` for a more streamlined display option. - Updated the layout and styling of `ToolCallItem` to support compact chip rendering, improving visual consistency. - Refactored `ToolTraceGroup` to utilize the new `compactChip` feature, enhancing the overall user interface. - Adjusted component structure for better responsiveness and usability in chat interactions.
- Introduced a new `resultContent` variable to streamline the rendering of tool results based on various conditions. - Enhanced error handling and readability for tool results, ensuring errors are displayed prominently. - Adjusted layout and styling for better integration with the `compactChip` design, improving overall user experience. - Simplified conditional rendering to improve code clarity and maintainability.
…atus handling - Removed the LiveStatusFooter component to simplify the rendering logic for live statuses. - Updated GatewayTranscriptListRegion to directly manage tool status and duration calculations. - Refactored test cases to align with the new structure and ensure accurate assertions for live status rendering. - Improved the AssistantBubble component to utilize the new AssistantTurnContent for better organization of round data. - Enhanced the AssistantWorkTrace component to display elapsed time for running tasks, improving user feedback during live interactions.
…d ToolTraceGroup components - Introduced user interaction tracking to prevent automatic expansion/collapse of components based on running state until user interaction occurs. - Updated state management logic in both AssistantWorkTrace and ToolTraceGroup to improve user experience during live interactions. - Ensured that component states are only modified after user actions, enhancing control over UI behavior.
… layout - Introduced new tests for the AssistantWorkTrace and ToolTraceGroup components to ensure proper behavior during state transitions. - Added tests for the mention popup layout to verify that the popup list remains compact and aligns file names with icons. - Enhanced the ChatComposerBar component to conditionally display the expand toggle based on editor overflow state.
…ionality - Updated TaskProgressIndicator to include a panel toggle for task details, improving user interaction. - Refactored tests to validate the new panel toggle behavior, ensuring it correctly reflects the expanded/collapsed state. - Adjusted rendering logic to manage task display states more effectively, enhancing overall user experience during task progress visualization.
…veAgent into codex/chat-ui-gallery
…functionality - Added a new ToolCategoryGallery component to showcase various tool categories and their functionalities. - Updated ChatGalleryPage and ChatGalleryPreview to include the new tooling category, enhancing the overall chat gallery experience. - Introduced new scenarios for tool categories in the scenarios.ts file, allowing for better organization and access to tool-related activities. - Enhanced AssistantBubble and AssistantWorkTrace components to improve user interaction and display of tool activities. - Added tests to ensure proper functionality of the new tool category features and their integration within the chat gallery.
…nality - Refactored `AssistantBubbleUnit` and `AssistantActivityRow` to remove `isAgentMode` prop, streamlining the component structure. - Enhanced `AssistantWorkTrace` to utilize new utilities for managing work entries and thinking states. - Updated tests to reflect changes in component behavior, ensuring accurate rendering and functionality. - Introduced new tests for `ThinkingDisclosure` and `thinking-trace` to validate reasoning and live status features. - Removed obsolete `ThinkingActivity` tests and related components to clean up the codebase.
- Introduced `awaitingDecision` state to manage user interactions that require approval, freezing progress indicators during this state. - Updated `LiveSparkle` and `AssistantWorkTrace` components to reflect the new state, ensuring accurate visual feedback when awaiting user decisions. - Enhanced CSS styles for better visibility of action rows based on pointer capabilities, improving user experience across devices. - Added tests to validate the new behavior of components under the awaiting decision state, ensuring robustness in rendering and functionality. - Improved translations for user-facing messages related to decision waiting states in both English and Chinese.
- Adjusted test assertions in `thinking-trace.test.mjs` and `live-status-width.test.mjs` to reflect changes in the `LiveSparkle` component and `AssistantWorkTrace` class names. - Modified spacing in `AssistantBubbleUnit` and `RoundBlockContent` to ensure consistent vertical rhythm in the UI. - Enhanced `LazyCollapse` and `ToolTraceGroup` components to improve layout behavior and prevent unnecessary gaps. - Updated test descriptions for clarity and accuracy regarding the expected layout behavior.
…ents - Introduced new tests in `live-status-width.test.mjs` to validate the layout of the `LiveSparkle`, `AssistantWorkTrace`, `ToolTraceGroup`, and `ToolCallItem` components. - Updated the `AssistantWorkTrace` and `LiveSparkle` components to ensure proper alignment and spacing of icons within their respective layouts. - Enhanced the `ToolTraceGroup` and `ToolCallItem` components to maintain consistent visual alignment with the overall chat interface. - Improved test descriptions for clarity regarding the expected layout behavior of the components.
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # crates/agent-ui/src/components/IconSet.tsx # crates/agent-ui/src/pages/chat/ChatComposerBar.tsx
合并 main 时这两个文件被错误还原为合并前版本,丢失了 CLI identity 头相关导出,导致 GUI/Gateway WebUI tsc 失败。 Co-authored-by: Cursor <cursoragent@cursor.com>
任意数值圆角(rounded-[Npx])不通过 check:ui-boundaries: 4px→rounded-xs、10px→rounded-lg、24/25px→rounded-4xl, 4px 像素点上的 1px 圆角视觉无感知,直接移除。 Co-authored-by: Cursor <cursoragent@cursor.com>
AssistantBubble/ChatTranscript 自动合并产生的格式与 import 顺序偏移用 biome 修复;布局一致性测试中硬编码的 rounded-[25px]/[24px]/[4px] 断言同步改为标准 token。 Co-authored-by: Cursor <cursoragent@cursor.com>
时间戳原先是独立 chrome,可能一直显示;收进左侧三个按钮的同一容器,避免 hover 不同步。 Co-authored-by: Cursor <cursoragent@cursor.com>
|
fix: 模型回复时间戳现在与左侧三个操作按钮共用同一套 hover 显隐。 时间戳原先是独立的 hover chrome,和复制 / 重试 / 分支按钮的 opacity 可能脱节,于是出现「按钮会藏、时间一直亮着」的情况。现已把时钟收进按钮同一容器,并用纯颜色 token 避免 提交: |
悬浮面板的 ul 只设了 overflow-y-auto,overflow-x 随之变成 auto;无空格的长路径 / URL 撑开行宽后整张气泡出现横向滚动条。 现在标题 line-clamp-2 + break-words,列表显式 overflow-x-hidden;所有行共用一个 tooltip(base-ui 分离式触发器 + payload),只有真正被截断的行才在 hover 时弹出完整 标题,完整可见的短行不打扰。指针从截断行直接滑进相邻完整行时顺手收掉旧弹层,避免 hover 逻辑把这次移动当作「换触发器」而让弹层卡住。 Co-authored-by: Cursor <cursoragent@cursor.com>
|
fix: 任务列表悬浮气泡里超长的任务标题现在两行截断,被截断的行 hover 时用 tooltip 展示完整标题。 气泡的 Tooltip 用 base-ui 的分离式触发器( 已在 dev server 上实测明暗两套主题(中文长句 / 无空格长路径 / 长英文句),并给 gui 与 webui 两份 indicator 测试补上截断、共享 handle、打开否决与 stale-close 的用例; 提交: |
WebUI 经共享 AssistantTurnContent 传了 collapseAfterAnswer,回合落定且有总结 文案时「处理中」区块折叠成一行「已处理 Ns」;GUI 为虚拟化拆行绕过了该组件、 自行拼装 AssistantWorkTrace,却没接这个 prop,加上 rowModel 零 remount 让 running 期间初始化的 expanded=true 一直保留,落定后区块始终展开。 work-trace 单元新增 hasAnswer(layout.answer 非空),纳入 canReuseLiveUnit 比较以便落定时刷新缓存单元;GUI 气泡据此传 collapseAfterAnswer。仅有工具 没有文案的回合不折叠——此时 trace 就是整条回复。 Co-authored-by: Cursor <cursoragent@cursor.com>
WebUI / GUI 同步核对对本 PR 的 UI 改动做了一遍两端同步核对。绝大部分改动落在共享 发现一处行为不一致,已在 c552424 修复:
核对为等价实现、无需处理:
|
折叠后的工具组头部把各类别标签拼成一句,zh-CN 用空串连接,"读取了文件"和 "运行了命令"黏成"读取了文件运行了命令",中文没有词边界无法断句。 现在 zh-CN 用全角竖线 "|" 分隔(全角字符自带留白,不另加空格),其他语言用 " | ";同一类别多次操作仍只出一次标签,不会产生多余分隔符。 Co-authored-by: Cursor <cursoragent@cursor.com>
思考块此前靠 flex-col-reverse 做纯 CSS 贴底。WKWebView 在 column-reverse 容器里 追加内容时不会稳定锚定在底部,每次流式追加都让视口位移(滚动条整体上移),手动滚 动前部分内容还会不可见;同时 column-reverse 容器的 scrollTop 恒 <= 0,外层会话 的 useScrollFollow 用 scrollTop > 0 判断内层滚动器是否在消费向上滚轮,永远判否, 叠加 overscroll-contain 后表现为鼠标滚不动。 现在滚动容器与内层内容元素经 callback ref 接入共享的 useScrollFollow(content 传 内层包裹层:max-h 夹住后外层盒子不再变化,只有 scrollHeight 在涨),reattachZonePx 为 0,仅在 active && open 时启用。流式时自动贴底,用户上滚即脱离、滚回底部重新贴 底;已结束的段落展开后从头往下正常阅读。 Co-authored-by: Cursor <cursoragent@cursor.com>
|
fix: 两处回复区交互问题,分别在 7daab81 与 c1660f9 修复。 1. 折叠的工具批次标签黏连(7daab819)工具组折叠后头部把各类别标签拼成一句,zh-CN 用空串连接,"读取了文件"和"运行了命令"黏成 2. 思考块流式输出时滚动条上移 / 鼠标滚不动(c1660f99)
现在滚动容器与内层内容元素经 callback ref 接入共享的 验证
|
任务进度药丸与回到底部按钮都锚定在输入卡片顶部上方且垂直区间几乎重合, 药丸所在的输入区层 z-20 盖住 z-10 的按钮;按钮又以面板中心定位,而 desktop 卡片列为对齐正文右移 18px,两者水平也对不齐。 输入区新增 measureComposerOverlay 一并测出预留线之上浮动元素(药丸、队列 面板)的额外高度与卡片列中心偏移,通过 onFloatingOverhangChange / onCenterOffsetChange 上报;转录页按钮 bottom 再让出这段高度、left 按偏移平移。 正文底部预留与 FloorNavRail 不受影响。 Co-authored-by: Cursor <cursoragent@cursor.com>
|
fix: 回到底部按钮不再与任务进度药丸("全部完成")重叠,并与输入卡片、药丸居中对齐。提交: 现象有任务列表时,回到底部按钮几乎完全被"全部完成"药丸盖住;把按钮抬高后又能看到两者水平中心差约 18px。 原因
修复
验证
|
模型回复中途触发上下文压缩时,历史持久化为 assistant → summary → assistant
(两半之间没有 user 消息),旧渲染逐项出行,变成"两条回复夹一张检查点卡",
且前半段没有 answer 文案,折叠后只剩已编辑文件卡。
方案:把压缩视为回复内部的里程碑而不是回复之间的分隔。
- 共享真源 lib/chat/replyContinuity.ts:stitchCompactedReplies 把
assistant/checkpoint 连续链缝成一条 reply;检查点变成零 block 的
CompactionSeamRound,块级消费者(已编辑文件/用量/回复文本/用量环倒扫)
天然穿透,已编辑文件卡跨压缩点聚合全部文件。尾随检查点(空闲手动压缩、
压缩后即停)仍为独立分隔卡。
- rekeyContinuationRounds 按位置重键续跑段(p<n>:r<i>),live 续跑与其
落库孪生按同一规则重键,落定零 remount。
- 布局层新增 GroupedRoundBlock{kind:"checkpoint"} 工作区条目,作为阶段
边界,两侧工具批次不合并。
- GUI rowModel:历史按缝合组建行(缓存按 leader 记录成员);运行中把刚
落库的前半段 + 检查点吸收进 live activity 行;adoptSettledTwin 的 origin
别名挂在 reply leader 上。
- WebUI rows.ts:raw pass 之后加一次 stitchCompactedRows,流式与历史两条
路径都覆盖。
- 视觉:压缩家族共用紫色色带 CompactionBand(轻依赖、不引 Markdown)。
运行中"正在压缩上下文"= active 色带(底缘扫光 + 图标呼吸,reduced-motion
退化为静态线);落定"已压缩上下文,继续处理"= 可点色带 + 消息数/压缩后
token 两枚 chip,展开摘要正文。与灰色的思考/工具行明显区分,便于浏览历史
时定位压缩点。
测试:web reply-continuity 10 例、GUI 行模型 4 例(含运行中吸收 + 落定零
remount)、jsdom 真渲染 2 例、WebUI store 流式场景 1 例;预览页
web/test/browser/compaction-seam-preview.html 供肉眼回归。
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
运行中压缩后的回复缝合 + 紫色压缩色带(eafcc8a7)问题模型回复中途触发上下文压缩时,历史持久化为 方案:一条回复,检查点变"缝合行"把压缩视为回复内部的里程碑,而不是回复之间的分隔。
视觉压缩家族共用紫色色带
验证
🤖 Generated with Claude Code |
往上滚到顶部加载更早的一页历史时,桌面端视口会跳约一屏,且在 WebKit 上 甩动一次可能连续拉进多页。 根因有三层: - GUI ChatTranscript 在 prepend 后手写 scrollTop 做补偿(scrollTop + scrollHeight 差),但虚拟列表已经用 'origin' 模式把新页吸进原点、行位置 没动;两套补偿叠加,视口被拉回到发请求那一刻记下的位置,且绕开了 virtualizer 的写入追踪。 - virtual-core 的 rebase 先写 scrollTop 再 notify 布局:浏览器按写入瞬间的 sizer 高度钳制,sizer 只有消费者渲染后才长高,正债(前置一页)写入落短, 而布局已按整笔债移动 → 视口与布局撕开。空闲状态下前置一页没有滚动事件 来结算债务,一直挂到用户下次滚动才写,届时必钳制。 - 翻页触发读的是 DOM scrollTop:origin 模式下未结算期间 scrollTop 停在原 处,每个滚轮 tick 都重新满足"接近顶部",一页接一页叠上去。 修复: - virtual-core maybeRebaseOrigin:先 notify(true) 同步发布 rebased 布局( React 适配器 flushSync 让 sizer 先长高),再写 scrollTop;写前记录可滚动 上限,echo 恰好落在上限且意图在其之外 = 被钳制而非用户移动,同一趟把未 确认的余量退回 origin(isClampedRebaseEcho / resolveRebaseTransaction) 并强制一次 notify 重绘;携带用户移动的 echo 仍按落地处理。视口已进入顶部 空带时只以可达部分(max(0, offset+delta))武装事务,避免退回再钳制的死循 环。新增 scheduleIdleRebase:_willUpdate / 空闲 re-measure 产生的债务在下 一帧结算,不再等滚动事件。 - 新增 getSettledScrollOffset()= scrollOffset - originOffset,即结算后离内容 真实顶部的距离,供翻页触发使用;types/index.d.ts 同步。 - GUI:翻页逻辑迁到 TranscriptList 紧挨 virtualizer,删除手写 scrollTop 补 偿;阈值读 settled offset(480px)。硬顶(scrollTop ≤ 1)保留为独立触发 (WebKit 甩动期间推迟 rebase,视口钉在 0 而债务仍在上方,用户顶着顶部滚 不进去),但按"到访一次触发一次"上锁,橡皮筋事件不会重复触发;in-flight 锁在 finally 后延一帧释放,让新页先进入 settled offset。 - WebUI GatewayTranscript:同一套 settled offset + 硬顶上锁判定。 - 两端 vite.config 把 @tanstack/react-virtual 排除出 optimizeDeps:预打包会 把 vendored fork 源码内联进 .vite 缓存,改 fork 不 --force 就一直跑旧代码。 测试:virtual-core harness 新增 DOM sizer 模拟(只在 notify 时跟随布局, 写入按 sizer 钳制)与 notifies 记录;origin-anchoring 新增 7 例(空闲前置 一页次帧结算零跳动 / 钳制 echo 退回余量 / 无 echo 由 verify 帧回滚 / 用户 移动不误判钳制 / 顶部空带内 rebase 不死循环 / 空闲 re-measure 次帧结算 / rebase 同步发布)。GUI chat-transcript-scroller 断言两端不再手写 scrollTop、 触发读 settled offset、硬顶上锁存在。 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
加载更早历史:交给虚拟列表 origin 锚定,修复翻页跳动与连续叠页(b81b4663)现象往上滚到顶部触发"加载更早"时,桌面端视口会跳约一屏;在 WebKit 上甩动一次还可能连续拉进多页历史。 根因(三层叠在一起)
修复virtual-core(
GUI
WebUI dev 体验:两端 验证
🤖 Generated with Claude Code |
wait