Skip to content
Closed
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "opencode-dev",
"image": "oven/bun:1",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {}
},
"postCreateCommand": "apt-get update && apt-get install -y python3 make g++ && bun install"
}
10 changes: 10 additions & 0 deletions packages/tui/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import { DialogStatus } from "./component/dialog-status"
import { DialogDebug } from "./component/dialog-debug"
import { DialogThemeList } from "./component/dialog-theme-list"
import { DialogHelp } from "./ui/dialog-help"
import { DialogScotty } from "./ui/dialog-scotty"
import { DialogAgent } from "./component/dialog-agent"
import { DialogSessionList } from "./component/dialog-session-list"
import { DialogWorkspaceList } from "./component/dialog-workspace-list"
Expand Down Expand Up @@ -815,6 +816,15 @@ function App(props: { onSnapshot?: () => Promise<string[]>; pluginHost: TuiPlugi
},
category: "System",
},
{
name: "opencode.scotty",
title: "Show Scotty",
slashName: "scotty",
run: () => {
dialog.replace(() => <DialogScotty />)
},
category: "System",
},
{
name: "docs.open",
title: "Open docs",
Expand Down
53 changes: 53 additions & 0 deletions packages/tui/src/ui/dialog-scotty.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { For } from "solid-js"
import { TextAttributes } from "@opentui/core"
import { useTheme } from "../context/theme"
import { useDialog } from "./dialog"
import { useBindings } from "../keymap"

// String.raw keeps the backslashes in the art literal.
const SCOTTY = String.raw`
/| ___
/ | / \
/ |___________/ o \
| |
| \__|
| |
|______________________|
| | | |
|__| |__|
`

// Drop the blank first and last rows the template literal adds.
const LINES = SCOTTY.split("\n").slice(1, -1)

export function DialogScotty() {
const dialog = useDialog()
const { theme } = useTheme()

useBindings(() => ({
bindings: [
{
key: "return",
desc: "Close Scotty",
group: "Dialog",
cmd: () => dialog.clear(),
},
],
}))

return (
<box paddingLeft={2} paddingRight={2} gap={1}>
<box flexDirection="row" justifyContent="space-between">
<text attributes={TextAttributes.BOLD} fg={theme.text}>
Scotty the Scottish Terrier
</text>
<text fg={theme.textMuted} onMouseUp={() => dialog.clear()}>
esc
</text>
</box>
<box paddingBottom={1}>
<For each={LINES}>{(line) => <text fg={theme.primary}>{line}</text>}</For>
</box>
</box>
)
}
Loading