Skip to content

测试:补齐 #367–#371 对话能力的单元/集成覆盖 - #372

Merged
nicechencs merged 3 commits into
devfrom
cursor/chat-test-coverage-dd50
Sep 20, 2026
Merged

nicechencs merged 3 commits into
devfrom
cursor/chat-test-coverage-dd50

Conversation

@nicechencs

@nicechencs nicechencs commented Sep 20, 2026

Copy link
Copy Markdown
Owner

范围

origin/dev tip b5eda8e49a980eec7b53bb1603541940d2e38037#371)开出,以测试覆盖为主。本轮为 CI 红灯做了两处最小修复,不进入大纲挂载 / 循环产品修复。

CI 修复(e7191848

  1. TypecheckChatSessionRail 顶栏「新建对话」改为 onClick={() => onNewChat()},不再把点击事件传进 onNewChat
  2. Browser mock smokee2e/browser/chat-overflow.spec.tsgetByRole('button', { name: '新建对话', exact: true })[data-help="chat-new"] 对上唯一主按钮,与组上「在此工作目录新建对话」加号分开。界面文案未改。

大纲显示门槛

左侧大纲只有三项同时成立才显示

  1. 偏好打开(默认开;关掉则整条轨不挂)
  2. 至少 2 条用户发出的消息(对面-only 回合不计数)
  3. 面板宽度 ≥ 720px(未量到或 719 只留测量层,不画刻度)

这次补上的覆盖

能力 主要测试
大纲跳到发出的消息(#371 显示门槛 + chat-outline-model / hover / ChatOutlineRail / ChatTranscript 锚点 chat-msg-*groupByTurn 只跟用户消息
顶栏快捷切换会话(#369 adjacentSessionId / 快捷键和弦 / 单条禁用上下条 / 空列表回退标题 / 未设目录短名
历史按工作目录分组(#368 空列表、同时间按 id、Windows 与 POSIX 不合并、conversationWorkspaceKey 空白目录、handoff 已在列表时保持 identity
本轮改过的文件可预览(#367 locations[] / files[] / file:// / 无效 JSON / 嵌套深度 / 路径归一;ChatTurnEditList 选中态;ChatEditPreviewPanel 开关与空正文
思考过程与工具分开显示(#370 thinking-only 无工具行;错误行不进思考折;气泡同时出思考条和工具 chip;正文到达后收起思考条
计划条 / 计划清单 新增 ChatPlanBar.test.tsruntimePlanEntryTone 别名;Rust extract_todo_plan
工作区显示文件夹名 cwdShortName 拒绝 ..;历史轨多组标题;未设组不加号;顶栏短名

验证

pnpm typecheck          # pass
pnpm typecheck:test     # pass

pnpm exec playwright test e2e/browser/chat-overflow.spec.ts
# 1 passed

pnpm exec vitest run src/pages/chat/ChatSessionRail.test.ts src/pages/chat/chat-layout.test.ts
# 41 passed

非目标

  • 不进入大纲挂载 / 循环产品修复
  • 不合入 dev(留给 review)
Open in Web Open in Cursor 

cursoragent and others added 2 commits September 20, 2026 15:32
#367#371 及邻近对话能力补 Vitest 与 Rust 单元测试:大纲跳到发出的消息、顶栏切换会话、历史按工作目录分组、改过文件预览、思考/工具分栏、计划条、工作区显示。不改产品行为。

Co-authored-by: NiceChen <nicechencs@gmail.com>
用户找不到左侧大纲时,三项须同时成立:偏好打开、至少两条用户消息、面板宽度 ≥720。补 shouldShowChatOutline 与 ChatOutlineRail / ChatTranscript 的显示与隐藏对照,不改产品代码。

Co-authored-by: NiceChen <nicechencs@gmail.com>
onClick 包一层再调 onNewChat,避免把点击事件当成工作目录。冒烟用 exact name 和 data-help=chat-new 对上唯一的「新建对话」,与组上的加号分开。

Co-authored-by: NiceChen <nicechencs@gmail.com>
@nicechencs
nicechencs marked this pull request as ready for review September 20, 2026 15:57
@nicechencs
nicechencs merged commit 370bff3 into dev Sep 20, 2026
4 checks passed
@nicechencs
nicechencs deleted the cursor/chat-test-coverage-dd50 branch September 20, 2026 15:57
cursor Bot pushed a commit that referenced this pull request Sep 20, 2026
#372 按旧实现要求一条用户消息时整段空 DOM。产品侧设置打开时要挂着量宽层,轨道仍隐藏。门槛用例改成认量宽层,不认空壳当轨道。

Co-authored-by: NiceChen <nicechencs@gmail.com>
nicechencs added a commit that referenced this pull request Sep 20, 2026
* 对话:宽面板时挂上聊天大纲轨道

设置打开、对话面板够宽、至少两条用户消息时,原先在消息未齐时量宽失败后不再重绑,轨道一直不出现。改为量对话舞台宽度、量宽节点始终挂上,并补上挂载回归。

Co-authored-by: NiceChen <nicechencs@gmail.com>

* 对话:新建对话不再把点击事件写进工作目录

主按钮把点击事件当成文件夹传给创建会话,JSON.stringify 遇到循环引用后会话建不出来。点击不再传事件,路径只接受字符串或空,并补上回归。

Co-authored-by: NiceChen <nicechencs@gmail.com>

* 对话:零宽空壳不算大纲已挂上

探针确认宽面板里轨道没挂上、也点不了。量宽为 0 时不再当成已量到,空测量层不能冒充轨道;回归要求出现可点的 tab 刻度。

Co-authored-by: NiceChen <nicechencs@gmail.com>

* 测试:一条用户消息时保留大纲量宽层

#372 按旧实现要求一条用户消息时整段空 DOM。产品侧设置打开时要挂着量宽层,轨道仍隐藏。门槛用例改成认量宽层,不认空壳当轨道。

Co-authored-by: NiceChen <nicechencs@gmail.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
@nicechencs nicechencs mentioned this pull request Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants