Repository navigation
feat(ui): 接入系统原生文件与文件夹选择框(保留手动输入) - #126
Merged
Merged
Conversation
Wire zero-cgo mygo.Dialog.Open/Save via injectable ui.FileDialogHandler and BindFileDialog for all 6 local path inputs while keeping manual path input intact. Suppresses OS dialogs in TRACE_QUIET and closed-window states, runs dialogs off the UI thread with generation guards, adds unit/layout/uishots coverage, and updates DEC-082, roadmap, and ui docs. Signed-off-by: chialecode <315431287+chialecode@users.noreply.github.com>
Owner
Author
|
Agent:独立代码审查(PR #126,头提交 审查结论:先修复实现与测试本身质量完整,未发现代码逻辑、安静测试( 阻塞问题[P1] 与最新
|
…e test Signed-off-by: chialecode <315431287+chialecode@users.noreply.github.com>
…icker Signed-off-by: chialecode <315431287+chialecode@users.noreply.github.com>
Owner
Author
|
Agent:独立代码复审(PR #126,头提交 审查结论:可合并(待 CI
|
Merged
4 of 5 tasks
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.
Closes #111
做了什么
internal/ui/file_dialog.go定义可替换接口FileDialogHandler、FileDialogOptions(pick_directory/open_file/save_file)与App.BindFileDialog,后台协程唤起选择框并通过事件循环与代次守卫写回:取消保留原输入、关闭弹窗或切换页面后丢弃迟到结果、错误就地温和提示,且"file-dialog"归入后台等待键不触发顶部加载横幅。internal/shell/shell.go与internal/shell/file_dialog.go绑定mygo.Dialog.Open/mygo.Dialog.Save(挂载主窗口Parent: win,智能解析初始目录与默认保存文件名),在TRACE_QUIET、窗口关闭或退出时静默返回空结果,严格满足安静测试要求;零新增第三方依赖,internal/service与cmd/trace-server不依赖 MyGo(INV-05)。设置 › 存储缓存保存位置(CacheDirInput):“选择文件夹…”(文件夹选择框)。设置 › 存储添加已有的缓存文件夹(AddLibraryRootInput):“选择文件夹…”(文件夹选择框)。媒体库 › 导入(Transfer.ImportPath):“选择文件夹…”(文件夹选择框)。媒体库 › 导出对话框(Transfer.ExportPath):“选择文件夹…”(文件夹选择框)。订阅 › 导出订阅对话框(SubFile.ExportPath):“选择位置…”(保存文件框,*.json,默认trace-subscriptions.json)。订阅 › 导入订阅对话框(SubFile.ImportPath):“选择文件…”(打开文件框,*.json;选中新路径后清空旧预览并推进subImportGen)。internal/ui/file_dialog_test.go(覆盖 6 处入口选中/取消/错误/无绑定回退/异步防重入与关闭弹窗或切页丢弃迟到结果/1280·1000·720 长路径零横向溢出)与internal/shell/file_dialog_test.go(覆盖安静模式/关窗/退出守卫与 3 类模式默认路径解析)。tools/uishots场景(settings-storage、library-export-dialog、subscriptions-export-dialog,并在library-import-preview与subscriptions-import-preview断言选择按钮;顺带修复remote_fixture.goreset()未重置ConflictDiff.Open导致远程/导入导出截图被旧弹窗遮挡的问题)。docs/decisions.md(新增DEC-082)、docs/delivery/roadmap.md(移除路径无系统选择框已知限制)与docs/ui.md(§3.6、§3.7 存储、§3.9)。验证
go test -v -run "TestFileDialog|TestShellFileDialog" ./internal/ui ./internal/shell— 退出码 0(全部 6 组新增单测与布局断言通过,全程安静零弹窗)。go run ./tools/uishots -out artifacts/uishots— 退出码 0(321 张 PNG 截图与断言全部通过,已人工查看 1280/720 渲染效果)。go run ./tools/check— 退出码 0(gofmt -l、go vet ./...、go test ./...、依赖方向 INV-05、trace-serverLinuxamd64/arm64构建与GOOS=linux go vet ./...、tools/checkdocs、git diff --check HEAD全部通过)。LESSONS.md(git worktree下pre-push钩子注入GIT_DIR会干扰tools/release测试),先单独完整通过go run ./tools/check后使用git push --no-verify推送。go test -race(本机无 cgo 工具链,记为not-run);Windows 交互桌面上原生 COM 选择框的实际弹框与视觉交互需实机验收(记为not-run)。风险
internal/shell、internal/ui、tools/uishots与文档;零新增依赖、零数据结构变更、未触碰高风险清单,安静测试守卫由单测覆盖)risk:high,等用户合并)每个提交都带
Signed-off-by(git commit -s)。