This commit is contained in:
Aiden Cline 2025-12-22 17:35:38 -06:00
commit 56baca0be1
3 changed files with 48 additions and 13 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View file

@ -2,9 +2,10 @@ import { type Accessor, createMemo, Match, Show, Switch } from "solid-js"
import { useRouteData } from "@tui/context/route" import { useRouteData } from "@tui/context/route"
import { useSync } from "@tui/context/sync" import { useSync } from "@tui/context/sync"
import { useTheme } from "@tui/context/theme" import { useTheme } from "@tui/context/theme"
import { EmptyBorder, SplitBorder } from "@tui/component/border" import { EmptyBorder } from "@tui/component/border"
import type { Session } from "@opencode-ai/sdk/v2" import type { Session } from "@opencode-ai/sdk/v2"
import { useKeybind } from "../../context/keybind" import { useKeybind } from "../../context/keybind"
import { useTerminalDimensions } from "@opentui/solid"
const Title = (props: { session: Accessor<Session> }) => { const Title = (props: { session: Accessor<Session> }) => {
const { theme } = useTheme() const { theme } = useTheme()
@ -24,29 +25,63 @@ export function Header() {
const { theme } = useTheme() const { theme } = useTheme()
const keybind = useKeybind() const keybind = useKeybind()
const dimensions = useTerminalDimensions()
const tall = createMemo(() => dimensions().height > 40)
return ( return (
<box flexShrink={0}> <box flexShrink={0}>
{/*<box
height={1}
border={["top"]}
borderColor={theme.backgroundPanel}
customBorderChars={{
...EmptyBorder,
horizontal: "▄",
}}
/>*/}
{/*<box
height={1}
border={["left"]}
borderColor={theme.border}
customBorderChars={{
...EmptyBorder,
vertical: theme.backgroundPanel.a !== 0 ? "╹" : " ",
}}
>
<box
height={1}
border={["top"]}
borderColor={theme.backgroundPanel}
customBorderChars={
theme.backgroundPanel.a !== 0
? {
...EmptyBorder,
horizontal: "▀",
}
: {
...EmptyBorder,
horizontal: " ",
}
}
/>
</box>*/}
<box <box
border={["left"]} border={["left"]}
borderColor={theme.border} borderColor={theme.border}
customBorderChars={{ customBorderChars={{
...EmptyBorder, ...EmptyBorder,
vertical: "┃", vertical: "┃",
bottomLeft: "╹",
}} }}
// backgroundColor={theme.backgroundPanel}
> >
<box <box
// paddingTop={1} paddingTop={tall() ? 1 : 0}
// paddingBottom={1} paddingBottom={tall() ? 1 : 0}
paddingLeft={2} paddingLeft={2}
paddingRight={1} paddingRight={1}
// {...SplitBorder}
// border={["left"]}
// borderColor={theme.border}
flexShrink={0} flexShrink={0}
flexGrow={1} flexGrow={1}
backgroundColor={theme.backgroundElement} backgroundColor={theme.backgroundPanel}
> >
<Switch> <Switch>
<Match when={session()?.parentID}> <Match when={session()?.parentID}>
@ -63,7 +98,7 @@ export function Header() {
<box flexGrow={1} flexShrink={1} /> <box flexGrow={1} flexShrink={1} />
<Show when={showShare()}> <Show when={showShare()}>
<text fg={theme.textMuted} wrapMode="none" flexShrink={0}> <text fg={theme.textMuted} wrapMode="none" flexShrink={0}>
/share{" "} /share
</text> </text>
</Show> </Show>
</box> </box>
@ -73,7 +108,7 @@ export function Header() {
<Title session={session} /> <Title session={session} />
<Show when={showShare()}> <Show when={showShare()}>
<text fg={theme.textMuted} wrapMode="none" flexShrink={0}> <text fg={theme.textMuted} wrapMode="none" flexShrink={0}>
/share{" "} /share
</text> </text>
</Show> </Show>
</box> </box>
@ -87,15 +122,15 @@ export function Header() {
borderColor={theme.border} borderColor={theme.border}
customBorderChars={{ customBorderChars={{
...EmptyBorder, ...EmptyBorder,
vertical: theme.backgroundElement.a !== 0 ? "╹" : " ", vertical: theme.backgroundPanel.a !== 0 ? "╹" : " ",
}} }}
> >
<box <box
height={1} height={1}
border={["bottom"]} border={["bottom"]}
borderColor={theme.backgroundElement} borderColor={theme.backgroundPanel}
customBorderChars={ customBorderChars={
theme.backgroundElement.a !== 0 theme.backgroundPanel.a !== 0
? { ? {
...EmptyBorder, ...EmptyBorder,
horizontal: "▀", horizontal: "▀",