fix: open native directory picker for new instances
This commit is contained in:
+1
-1
@@ -35,4 +35,4 @@ owner: codex
|
||||
- 变更:Gio Shell 改为左侧导航并移除窗口内“Chub 浏览器管理”文字;路径搜索接入独立 task ID、取消令牌、结果通道和 `Window.Invalidate`;新建实例增加 Label、目录选择入口与 Chrome/Edge RadioButton;同步更新 HTML 原型。
|
||||
- 验证:`gofmt`、HTML script syntax check、`go test ./... -count=1`、`go vet ./...`、`scripts/smoke-windows.ps1` 均通过。
|
||||
- 阻塞:无。
|
||||
- 残余风险:原生 Windows 文件/目录选择器仍需后续 platform adapter;`go test -race` 在当前环境因 `CGO_ENABLED=0` 不可用。
|
||||
- 残余风险:新建实例的原生目录选择器已由 T-207 接入;设置页路径选择器仍需同一 platform adapter 扩展;`go test -race` 在当前环境因 `CGO_ENABLED=0` 不可用。
|
||||
|
||||
@@ -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