优化folder打开逻辑

This commit is contained in:
xintaofei
2026-03-25 18:24:32 +08:00
parent b330a4f936
commit 388f92637c
9 changed files with 119 additions and 13 deletions

View File

@@ -345,7 +345,7 @@ export function BranchDropdown({
setWorktreeOpen(false)
await runGitTask(t("tasks.newWorktree", { name }), async () => {
await gitWorktreeAdd(folderPath, name, wtPath)
await openFolderWindow(wtPath)
await openFolderWindow(wtPath, { newWindow: true })
await setFolderParentBranch(wtPath, branch)
})
}

View File

@@ -54,13 +54,14 @@ export function FolderNameDropdown() {
if (selected) {
await openFolderWindow(
Array.isArray(selected) ? selected[0] : selected,
{ newWindow: true },
)
}
}
async function handleSelect(path: string) {
try {
await openFolderWindow(path)
await openFolderWindow(path, { newWindow: true })
} catch {
// ignore
}

View File

@@ -82,7 +82,7 @@ export function FolderTitleBar() {
const result = await openFileDialog({ directory: true, multiple: false })
if (!result) return
const selected = Array.isArray(result) ? result[0] : result
await openFolderWindow(selected)
await openFolderWindow(selected, { newWindow: true })
} catch (err) {
console.error("[FolderTitleBar] failed to open folder:", err)
}