feat(desktop): add safe iOS Simulator deletion - #3726
Merged
GaoWeiLiuXD merged 1 commit intoSep 2, 2026
Conversation
Expose trusted-renderer deletion for Cindy-created simulators, clean up active runtime resources before removal, and keep retries idempotent after partial persistence failures. Update confirmation copy and focus behavior with regression coverage. Also make the existing doc-tools utility-process probe accept tsx CommonJS-shaped module namespaces so the required unit gate passes on Node 22. Signed-off-by: JiangJiahao <jiangjiahao@xd.com>
|
| Filename | Overview |
|---|---|
| apps/desktop/src/main/mcp-integrations/ios-simulator.ts | 新增 Renderer 专用删除分支、统一运行期资源清理以及 Viewer recovery teardown 准入检查,未发现可发布缺陷。 |
| packages/ios-simulator-runtime/src/instance-actor.ts | 删除前确认精确设备存在,并支持物理删除成功但持久化释放失败后的安全重试。 |
| apps/desktop/src/shared/iosSimulatorIpc.ts | 将 delete_instance 加入 Renderer 工具类型,同时保持其不属于 MCP 工具注册集合。 |
| apps/desktop/src/renderer/features/right-sidebar/plugins/ios-simulator/IOSSimulatorTabBody.tsx | 仅为 Cindy 创建设备展示删除入口,并通过 destructive ConfirmDialog 发起精确路由删除。 |
| apps/desktop/src/main/maker-ipc/tests/iosSimulatorHandlers.test.ts | 补充可信 Renderer 删除调用的 IPC 参数校验与 Host 转发覆盖。 |
| apps/desktop/src/main/mcp-integrations/tests/ios-simulator.test.ts | 覆盖停止与运行设备删除、资源清理顺序、外部设备拒绝、失败保留和 Viewer recovery 竞态。 |
| packages/ios-simulator-runtime/src/instance-actor.test.ts | 覆盖物理删除后所有权持久化失败并重试释放绑定的场景。 |
Sequence Diagram
sequenceDiagram
participant U as 用户
participant R as Trusted Renderer
participant I as Main IPC
participant H as Simulator Host
participant A as Instance Actor
participant S as CoreSimulator
U->>R: 确认删除 Cindy 设备
R->>I: delete_instance(session, instance, generation, lease)
I->>I: 校验可信窗口与会话访问
I->>H: 用户来源的精确路由调用
H->>H: 阻止新启动并清理运行期资源
H->>A: stop(route)
A->>S: 必要时 shutdown
H->>A: delete(updated route)
A->>S: findExact / deleteExact
A->>A: 释放所有权记录
A-->>H: 删除结果
H-->>R: 刷新设备与绑定状态
Reviews (1): Last reviewed commit: "feat(desktop): add safe simulator deleti..." | Re-trigger Greptile
Contributor
|
这条 PR 给内置 iOS 模拟器加了删除设备能力,属于新产品交互,也改到了模拟器 Host/runtime 删除链,先进入维护者确认,不自动合并。 请维护者在 PR 上 Approve;如果要改,请 Request Changes,作者改完后再 Approve。讨论 issue:#3736 |
Contributor
|
命中 UI 路径(apps/desktop/src/renderer/features/right-sidebar/plugins/ios-simulator/IOSSimulatorTabBody.tsx)但 description 未附界面效果证据——建议补充改动后效果:截图/录屏,或改动后界面的 HTML 页面(```html 代码块、.html 附件或在线预览链接),便于确认界面符合 DESIGN.md 设计规范 |
Contributor
Author
DavidShenXD
approved these changes
Sep 2, 2026
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.


这次改了什么
摘要
为 Desktop 内置 iOS 模拟器面板补充安全的设备删除能力,解决每个任务绑定一个 Cindy 模拟器后,设备列表可能持续累积的问题。
creationProvenance === "cindy"的设备显示删除入口;外部创建的模拟器继续禁止删除。tsx可能返回 CommonJS-shaped default namespace 的情况补充现有 doc-tools 子进程测试兼容,不改变 doc-tools 产品逻辑。变更类型
feat新功能fix缺陷修复refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
UI 变化
docs/design-rules/DESIGN.md§11.1:操作按钮使用“动词 + 对象”,确认按钮为“删除设备”,不使用裸“删除”。docs/design-rules/DESIGN.md§14.2:确认框打开后焦点落到主操作按钮,并由焦点回归测试锁定。ConfirmDialog与其destructive语义 token,未新增单模式或硬编码颜色。怎么验证的
自动验证
手工验证
未执行的验证
风险
风险分类
影响与回滚
提交前检查
git commit -s,见 DCO)