Skip to content

fix(record): 记录 switch_tab,并按 tab 维护 Trace v3 页面状态 - #108

Open
shnpd wants to merge 1 commit into
feat/trace-v3-recorderfrom
fix/trace-v3-multitab-state
Open

fix(record): 记录 switch_tab,并按 tab 维护 Trace v3 页面状态#108
shnpd wants to merge 1 commit into
feat/trace-v3-recorderfrom
fix/trace-v3-multitab-state

Conversation

@shnpd

@shnpd shnpd commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

摘要

  • Trace v3 在用户切 tab 时记录 switch_tab(由 supports_tab_switch_steps 能力协商开启)。
  • 按 tab 缓存 settled observation(settledByTab),切 tab 后的操作绑定到当前 tab 的页面状态,而不再误用上一个 tab 的 lastSettled
  • legacy v2 reducer 丢弃 switch_tab,保持旧客户端兼容。

背景

基于 feat/trace-v3-recorder。此前多 tab 录制时,切 tab 后的 click/fill 可能错误关联到前一个 tab 的 settled state。

测试计划

  • 单测:extension record / observation / v2 reducer 相关测试通过
  • 录一段 Trace v3:在两个 tab 间切换,并在目标 tab 继续操作
  • 确认 trace.jsonop: "switch_tab",且后续 step 使用目标 tab 的 states
  • 确认 v2 / 未声明 supports_tab_switch_steps 的客户端不会产出或依赖 switch_tab

@shnpd
shnpd changed the base branch from main to feat/trace-v3-recorder August 18, 2026 07:50
Co-authored-by: Cursor <cursoragent@cursor.com>
@shnpd
shnpd force-pushed the fix/trace-v3-multitab-state branch from f57fcbf to ace6af4 Compare August 18, 2026 07:57
@shnpd
shnpd requested review from Ljy-0827 and iuyo5678 and a lite review from Copilot August 18, 2026 08:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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