feat(settings): add Playwright MCP config and improve CDP layout#1979
feat(settings): add Playwright MCP config and improve CDP layout#1979kaizhou-lab merged 2 commits intomainfrom
Conversation
…yout - Add Playwright MCP configuration with --cdp-endpoint in CDP settings - Separate DevTools toggle and CDP section into independent cards - Use collapsible panels for MCP configs (chrome-devtools + playwright) - Hide port and MCP config when CDP remote debugging is disabled - Fix copy icon using @icon-park/react Copy component - Align current port section with other settings rows - Add i18n keys for Playwright MCP config across all 6 locales - Update SystemModalContent tests for new layout and Playwright config
Code Review:feat(settings): add Playwright MCP config and improve CDP layout (#1979)变更概述本 PR 实际包含多个独立特性和修复,远超标题所述范围:(1) CDP 设置页新增 Playwright MCP 配置和折叠面板布局;(2) 新增 inline thinking 消息类型,将 thought 事件转换为可展开的思考过程显示;(3) CodeBlock 组件重构为默认折叠(3 行预览)模式;(4) Markdown 组件 memoize 优化;(5) 多处 bug 修复(序列化防护、Codex 启动信号退出、会话创建并发守卫、Linux headless 强制启用等)。涉及 process、renderer、common 三个进程层共 57 个文件。 方案评估结论: PR 涵盖了多个不相关的特性和修复,ideally 应拆分为独立 PR 以降低 review 难度和回滚风险。但各项改动的实现方案总体合理:thinking 消息系统正确使用了 msg_id 合并和 DB 持久化;CodeBlock 折叠状态使用模块级 Map 持久化避免流式更新重建丢失状态;序列化防护提前捕获 JSON.stringify 异常。有一处残留的 JSDoc 注释需清理,CodeBlock 的指纹碰撞可能导致不同代码块共享展开状态。 问题清单🟡 MEDIUM — AcpAgentManager 残留的旧方法 JSDoc 注释文件: 问题代码: /**
* Filter think tags from message content during streaming
* This ensures users don't see internal reasoning tags in real-time
*
* @param message - The streaming message to filter
* @returns Message with think tags removed from content
*/
/**
* Emit a thinking message to the UI stream.
* Creates a new thinking msg_id on first call per turn, reuses it for subsequent calls.
*/
private emitThinkingMessage(...)问题说明: 修复建议: /**
* Emit a thinking message to the UI stream.
* Creates a new thinking msg_id on first call per turn, reuses it for subsequent calls.
*/
private emitThinkingMessage(...)🟡 MEDIUM — CodeBlock 指纹碰撞导致不同代码块共享展开/折叠状态文件: 问题代码: function getBlockFingerprint(language: string, firstLine: string): string {
const key = `${language}:${firstLine}`;
...
return key;
}问题说明:指纹仅由 修复建议:在指纹中加入更多区分信息,例如代码块的前几行内容或行数: function getBlockFingerprint(language: string, lines: string[]): string {
const preview = lines.slice(0, PREVIEW_LINES).join('\n');
const key = `${language}:${lines.length}:${preview}`;
...
return key;
}🔵 LOW —
|
| # | 严重级别 | 文件 | 问题 |
|---|---|---|---|
| 1 | 🟡 MEDIUM | AcpAgentManager.ts:811 |
残留的旧方法 JSDoc 注释 |
| 2 | 🟡 MEDIUM | CodeBlock.tsx:28 |
指纹碰撞导致代码块共享展开状态 |
| 3 | 🔵 LOW | MessageList.tsx:358 |
increaseViewportBy 增大的内存影响 |
| 4 | 🔵 LOW | — | PR 包含多个不相关特性 |
结论
本报告由本地 pr-review skill 生成,包含完整项目上下文,无截断限制。
CONCLUSION: CONDITIONAL
IS_CRITICAL_PATH: false
PR_NUMBER: 1979
- Remove stale JSDoc comment for deleted filterThinkTagsFromMessage method - Improve CodeBlock fingerprint to include line count and preview content, preventing different code blocks with same language and first line from sharing expanded/collapsed state Review follow-up for #1979
PR Fix 验证报告原始 PR: #1979
总结: ✅ 已修复 2 个 | ❌ 未能修复 0 个
|
Summary
@playwright/mcp@latest --cdp-endpoint) alongside existing chrome-devtools config in CDP settingsi-carbon:copywith@icon-park/reactCopycomponent), align current port row with other settingsTest plan
bunx tsc --noEmitpassesbun run lintpasses (0 errors)bun run i18n:types && node scripts/check-i18n.jspassesSystemModalContent.dom.test.tsx— 14 tests pass including new tests for: