experiment: better web picker using @pierre/tree (#31208)

This commit is contained in:
Luke Parker 2026-06-16 17:43:23 +02:00 committed by GitHub
commit 88f5b9a90e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 1297 additions and 211 deletions

View file

@ -1,4 +1,4 @@
import { contextBridge, ipcRenderer } from "electron"
import { contextBridge, ipcRenderer, webUtils } from "electron"
import type { ElectronAPI, WslServersEvent } from "./types"
import type { UpdaterState } from "@opencode-ai/app/updater"
@ -88,6 +88,7 @@ const api: ElectronAPI = {
openFilePicker: (opts) => ipcRenderer.invoke("open-file-picker", opts),
readPickedFile: (token, path) => ipcRenderer.invoke("read-picked-file", token, path),
releasePickedFiles: (token) => ipcRenderer.invoke("release-picked-files", token),
getPathForFile: (file) => webUtils.getPathForFile(file),
saveFilePicker: (opts) => ipcRenderer.invoke("save-file-picker", opts),
openLink: (url) => ipcRenderer.send("open-link", url),
openPath: (path, app) => ipcRenderer.invoke("open-path", path, app),

View file

@ -78,6 +78,7 @@ export type ElectronAPI = {
}) => Promise<{ token: string; files: { path: string; name: string; size: number }[] } | null>
readPickedFile: (token: string, path: string) => Promise<ArrayBuffer>
releasePickedFiles: (token: string) => Promise<void>
getPathForFile: (file: File) => string
saveFilePicker: (opts?: { title?: string; defaultPath?: string }) => Promise<string | null>
openLink: (url: string) => void
openPath: (path: string, app?: string) => Promise<void>