almost
This commit is contained in:
parent
ef6edd9f0a
commit
56baca0be1
3 changed files with 48 additions and 13 deletions
BIN
packages/opencode/border.png
Normal file
BIN
packages/opencode/border.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
BIN
packages/opencode/cutoff.png
Normal file
BIN
packages/opencode/cutoff.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
|
|
@ -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: "▀",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue