fix: open native directory picker for new instances

This commit is contained in:
QiuSW
2026-07-22 16:06:39 +08:00
parent 6f08c9c9d0
commit dbbb5c0e98
12 changed files with 289 additions and 14 deletions
+3
View File
@@ -14,6 +14,7 @@ import (
"chub/internal/domain"
"chub/internal/platform/browser"
"chub/internal/platform/config"
"chub/internal/platform/files"
"chub/internal/platform/logging"
"chub/internal/ui"
"gioui.org/app"
@@ -102,6 +103,8 @@ func runWindow(logger *slog.Logger) {
window.Option(app.Title("Chub"), app.Size(unit.Dp(1100), unit.Dp(720)))
theme := material.NewTheme()
shell := ui.NewShell(theme)
directoryPicker := files.NewDirectoryPicker()
shell.OnChooseDirectory(directoryPicker.ChooseDirectory, window.Invalidate)
discoverer := browser.NewDiscoverer()
shell.OnPathSearch(func(ctx context.Context, field ui.PathField, current string) (string, error) {
switch field {