|
@@ -2,7 +2,7 @@ import { render, useRenderer, useTerminalDimensions } from "@opentui/solid"
|
|
|
import { registerOpencodeSpinner } from "./component/register-spinner"
|
|
import { registerOpencodeSpinner } from "./component/register-spinner"
|
|
|
import { Deferred, Effect } from "effect"
|
|
import { Deferred, Effect } from "effect"
|
|
|
import { Service, type Endpoint } from "@opencode-ai/client/effect/service"
|
|
import { Service, type Endpoint } from "@opencode-ai/client/effect/service"
|
|
|
-import { OpenCode } from "@opencode-ai/client"
|
|
|
|
|
|
|
+import { OpenCode, type SessionInfo } from "@opencode-ai/client"
|
|
|
import { Global } from "@opencode-ai/util/global"
|
|
import { Global } from "@opencode-ai/util/global"
|
|
|
import { ClipboardProvider, useClipboard } from "./context/clipboard"
|
|
import { ClipboardProvider, useClipboard } from "./context/clipboard"
|
|
|
import { LogProvider, useLog, type LogSink } from "./context/log"
|
|
import { LogProvider, useLog, type LogSink } from "./context/log"
|
|
@@ -69,7 +69,7 @@ import { DialogThemeList } from "./component/dialog-theme-list"
|
|
|
import { DialogHelp } from "./ui/dialog-help"
|
|
import { DialogHelp } from "./ui/dialog-help"
|
|
|
import { DialogAgent } from "./component/dialog-agent"
|
|
import { DialogAgent } from "./component/dialog-agent"
|
|
|
import { DialogSessionList } from "./component/dialog-session-list"
|
|
import { DialogSessionList } from "./component/dialog-session-list"
|
|
|
-import { DialogOpen } from "./component/dialog-open"
|
|
|
|
|
|
|
+import { DialogOpen, DialogOpenKey, loadDialogOpen } from "./component/dialog-open"
|
|
|
import { SessionTabs } from "./component/session-tabs"
|
|
import { SessionTabs } from "./component/session-tabs"
|
|
|
import { sessionTabsFitVertically } from "./ui/layout"
|
|
import { sessionTabsFitVertically } from "./ui/layout"
|
|
|
import { ThemeErrorToast } from "./component/theme-error-toast"
|
|
import { ThemeErrorToast } from "./component/theme-error-toast"
|
|
@@ -478,6 +478,7 @@ function App(props: { pair?: DialogPairCredentials }) {
|
|
|
const promptRef = usePromptRef()
|
|
const promptRef = usePromptRef()
|
|
|
const plugins = usePlugin()
|
|
const plugins = usePlugin()
|
|
|
const clipboard = useClipboard()
|
|
const clipboard = useClipboard()
|
|
|
|
|
+ let openingOpen: Promise<SessionInfo[]> | undefined
|
|
|
// Toast once when an MCP server enters a failed or needs-auth state so the user knows to act,
|
|
// Toast once when an MCP server enters a failed or needs-auth state so the user knows to act,
|
|
|
// without having to open the status panel. Tracking the last alerted status avoids re-toasting
|
|
// without having to open the status panel. Tracking the last alerted status avoids re-toasting
|
|
|
// the same problem on every refresh while still re-alerting if the state changes.
|
|
// the same problem on every refresh while still re-alerting if the state changes.
|
|
@@ -680,8 +681,14 @@ function App(props: { pair?: DialogPairCredentials }) {
|
|
|
title: "Open session or project",
|
|
title: "Open session or project",
|
|
|
category: "Session",
|
|
category: "Session",
|
|
|
slash: { name: "open", aliases: ["projects", "project"] },
|
|
slash: { name: "open", aliases: ["projects", "project"] },
|
|
|
- run: () => {
|
|
|
|
|
- dialog.replace(() => <DialogOpen />)
|
|
|
|
|
|
|
+ run: async () => {
|
|
|
|
|
+ if (dialog.key === DialogOpenKey || openingOpen) return
|
|
|
|
|
+ const previous = dialog.stack.at(-1)
|
|
|
|
|
+ openingOpen = loadDialogOpen(data, client)
|
|
|
|
|
+ const sessions = await openingOpen
|
|
|
|
|
+ openingOpen = undefined
|
|
|
|
|
+ if (dialog.stack.at(-1) !== previous) return
|
|
|
|
|
+ dialog.replace(() => <DialogOpen sessions={sessions} />, undefined, { key: DialogOpenKey, size: "large" })
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
...Array.from({ length: 9 }, (_, i) => ({
|
|
...Array.from({ length: 9 }, (_, i) => ({
|