Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion packages/app/src/components/session/session-header.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createEffect, createMemo, onCleanup, Show } from "solid-js"
import { createStore } from "solid-js/store"
import { Portal } from "solid-js/web"
import { useParams } from "@solidjs/router"
import { useNavigate, useParams } from "@solidjs/router"
import { useLayout } from "@/context/layout"
import { useCommand } from "@/context/command"
import { useLanguage } from "@/context/language"
Expand Down Expand Up @@ -34,6 +34,7 @@ export function SessionHeader() {
const sync = useSync()
const platform = usePlatform()
const language = useLanguage()
const navigate = useNavigate()

const projectDirectory = createMemo(() => decode64(params.dir) ?? "")
const project = createMemo(() => {
Expand Down Expand Up @@ -288,11 +289,35 @@ export function SessionHeader() {
platform.openLink(url)
}

const leftMount = createMemo(() => document.getElementById("opencode-titlebar-left"))
const centerMount = createMemo(() => document.getElementById("opencode-titlebar-center"))
const rightMount = createMemo(() => document.getElementById("opencode-titlebar-right"))

return (
<>
<Show when={leftMount()}>
{(mount) => (
<Portal mount={mount()}>
<Show when={!layout.sidebar.opened()}>
<TooltipKeybind
class="hidden xl:flex shrink-0"
placement="bottom"
title={language.t("command.session.new")}
keybind={command.keybind("session.new")}
>
<Button
variant="ghost"
class="size-6 p-0"
onClick={() => navigate(`/${params.dir}/session`)}
aria-label={language.t("command.session.new")}
>
<Icon size="small" name="plus-small" />
</Button>
</TooltipKeybind>
</Show>
</Portal>
)}
</Show>
<Show when={centerMount()}>
{(mount) => (
<Portal mount={mount()}>
Expand Down