diff --git a/packages/app/src/components/session/session-header.tsx b/packages/app/src/components/session/session-header.tsx index b983633d8069..216731957f69 100644 --- a/packages/app/src/components/session/session-header.tsx +++ b/packages/app/src/components/session/session-header.tsx @@ -27,6 +27,7 @@ import { Persist, persisted } from "@/utils/persist" import { StatusPopover, StatusPopoverV2 } from "../status-popover" import { IconButtonV2 } from "@opencode-ai/ui/v2/icon-button-v2" import { Icon as IconV2 } from "@opencode-ai/ui/v2/icon" +import { MenuV2 } from "@opencode-ai/ui/v2/menu-v2" const OPEN_APPS = [ "vscode", @@ -48,6 +49,9 @@ const OPEN_APPS = [ type OpenApp = (typeof OPEN_APPS)[number] type OS = "macos" | "windows" | "linux" | "unknown" +const isOpenApp = (value: unknown): value is OpenApp => + typeof value === "string" && OPEN_APPS.some((app) => app === value) + const MAC_APPS = [ { id: "vscode", @@ -322,7 +326,7 @@ export function SessionHeader() { {(mount) => ( @@ -390,8 +394,8 @@ export function SessionHeader() { class="mt-1" value={current().id} onChange={(value) => { - if (!OPEN_APPS.includes(value as OpenApp)) return - selectApp(value as OpenApp) + if (!isOpenApp(value)) return + selectApp(value) }} > @@ -510,7 +514,114 @@ export function SessionHeader() { } > - +
+ + + } + /> + + } + > +
+ openDir(current().id)} + aria-label={language.t("session.header.open.ariaLabel", { app: current().label })} + icon={ + + +
+ } + > + +
+ } + /> + setMenu("open", open)} + > + } + /> + + + + {language.t("session.header.openIn")} + { + if (!isOpenApp(value)) return + selectApp(value) + }} + > + + {(option) => ( + { + setMenu("open", false) + openDir(option.id) + }} + > +
+ +
+ {option.label} +
+ )} +
+
+
+ + { + setMenu("open", false) + copyPath() + }} + > +
+ +
+ {language.t("session.header.open.copyPath")} +
+
+
+
+
+
+
+ +
)} diff --git a/packages/ui/src/v2/components/icon.tsx b/packages/ui/src/v2/components/icon.tsx index 60202a85c8a7..b8ce338e0967 100644 --- a/packages/ui/src/v2/components/icon.tsx +++ b/packages/ui/src/v2/components/icon.tsx @@ -65,6 +65,10 @@ const icons = { viewBox: "0 0 16 16", body: ``, }, + copy: { + viewBox: "0 0 16 16", + body: ``, + }, } const spriteID = "opencode-v2-icon-sprite"