fix: open native directory picker for new instances
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
---
|
||||
id: T-207
|
||||
title: 接入新建实例的 Windows 目录选择器
|
||||
phase: 2
|
||||
deps: [T-206]
|
||||
status: DONE
|
||||
created: 2026-07-22
|
||||
owner: codex
|
||||
---
|
||||
|
||||
## 需求与背景
|
||||
|
||||
新建实例的“选择路径”此前只是表单反馈,不会打开 Windows 文件夹选择器,用户无法通过按钮设置 User Data Dir。
|
||||
|
||||
## 方案与边界
|
||||
|
||||
- Windows 平台适配层使用隐藏的 STA PowerShell 进程打开 `FolderBrowserDialog`,避免在 Gio FrameEvent 中阻塞。
|
||||
- Gio Shell 在 goroutine 中调用目录选择器,并通过结果通道和 `Window.Invalidate` 回到 UI;成功后回填 User Data Dir,取消或失败保留原输入。
|
||||
- 同时限制重复打开:选择器已打开时不创建第二个对话框。
|
||||
- 本任务只覆盖新建实例的 User Data Dir;设置页各路径选择按钮仍是后续范围。
|
||||
|
||||
## 验收要点
|
||||
|
||||
- 点击“选择路径”打开 Windows 文件夹选择器。
|
||||
- 选择目录后回填输入框;取消时不清空输入。
|
||||
- 平台命令和 Shell 回填逻辑有单元测试。
|
||||
- `go test ./...`、`go vet ./...` 和 Windows 构建通过。
|
||||
|
||||
## 执行记录
|
||||
|
||||
- 状态:DONE
|
||||
- 变更:新增 `internal/platform/files` Windows 目录选择器和 Gio 异步回填状态;更新 UI 测试与当前状态文档。
|
||||
- 验证:`gofmt`、`go test ./...`、`go vet ./...`、Windows build/smoke 通过。
|
||||
- 阻塞:无。
|
||||
- 残余风险:当前 PowerShell adapter 依赖 Windows Forms 和 `powershell.exe` 可用;设置页的路径选择器尚未复用该 adapter。
|
||||
Reference in New Issue
Block a user