Skip to content

Commit 2e32b07

Browse files
authored
Merge branch 'sst:dev' into dev
2 parents 5d3e0dc + 5b02a30 commit 2e32b07

File tree

39 files changed

+1069
-367
lines changed

39 files changed

+1069
-367
lines changed

.opencode/agent/docs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
description: ALWAYS use this when writing docs
3+
color: "#38A3EE"
34
---
45

56
You are an expert technical documentation writer

.opencode/agent/triage.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
mode: primary
33
hidden: true
44
model: opencode/claude-haiku-4-5
5+
color: "#44BA81"
56
tools:
67
"*": false
78
"github-triage": true

STATS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,4 @@
184184
| 2025-12-26 | 1,352,411 (+19,379) | 1,227,615 (+10,332) | 2,580,026 (+29,711) |
185185
| 2025-12-27 | 1,371,771 (+19,360) | 1,238,236 (+10,621) | 2,610,007 (+29,981) |
186186
| 2025-12-28 | 1,390,388 (+18,617) | 1,245,690 (+7,454) | 2,636,078 (+26,071) |
187+
| 2025-12-29 | 1,415,560 (+25,172) | 1,257,101 (+11,411) | 2,672,661 (+36,583) |

bun.lock

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opencode-ai/app",
3-
"version": "1.0.206",
3+
"version": "1.0.207",
44
"description": "",
55
"type": "module",
66
"exports": {

packages/app/src/components/session-context-usage.tsx

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Tooltip } from "@opencode-ai/ui/tooltip"
33
import { ProgressCircle } from "@opencode-ai/ui/progress-circle"
44
import { useSync } from "@/context/sync"
55
import { useParams } from "@solidjs/router"
6-
import { AssistantMessage } from "@opencode-ai/sdk/v2"
6+
import { AssistantMessage } from "@opencode-ai/sdk/v2/client"
77

88
export function SessionContextUsage() {
99
const sync = useSync()
@@ -35,19 +35,13 @@ export function SessionContextUsage() {
3535
{(ctx) => (
3636
<Tooltip
3737
value={
38-
<div class="flex flex-col gap-1">
39-
<div class="flex gap-3">
40-
<span class="opacity-70 text-right flex-1">Tokens</span>
41-
<span class="text-left flex-1">{ctx().tokens}</span>
42-
</div>
43-
<div class="flex gap-3">
44-
<span class="opacity-70 text-right flex-1">Usage</span>
45-
<span class="text-left flex-1">{ctx().percentage ?? 0}%</span>
46-
</div>
47-
<div class="flex gap-3">
48-
<span class="opacity-70 text-right flex-1">Cost</span>
49-
<span class="text-left flex-1">{cost()}</span>
50-
</div>
38+
<div class="grid grid-cols-2 gap-x-3 gap-y-1">
39+
<span class="opacity-70 text-right">Tokens</span>
40+
<span class="text-left">{ctx().tokens}</span>
41+
<span class="opacity-70 text-right">Usage</span>
42+
<span class="text-left">{ctx().percentage ?? 0}%</span>
43+
<span class="opacity-70 text-right">Cost</span>
44+
<span class="text-left">{cost()}</span>
5145
</div>
5246
}
5347
placement="top"

packages/app/src/context/command.tsx

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export interface CommandOption {
2626
suggested?: boolean
2727
disabled?: boolean
2828
onSelect?: (source?: "palette" | "keybind" | "slash") => void
29+
onHighlight?: () => (() => void) | void
2930
}
3031

3132
export function parseKeybind(config: string): Keybind[] {
@@ -115,6 +116,28 @@ export function formatKeybind(config: string): string {
115116

116117
function DialogCommand(props: { options: CommandOption[] }) {
117118
const dialog = useDialog()
119+
let cleanup: (() => void) | void
120+
let committed = false
121+
122+
const handleMove = (option: CommandOption | undefined) => {
123+
cleanup?.()
124+
cleanup = option?.onHighlight?.()
125+
}
126+
127+
const handleSelect = (option: CommandOption | undefined) => {
128+
if (option) {
129+
committed = true
130+
cleanup = undefined
131+
dialog.close()
132+
option.onSelect?.("palette")
133+
}
134+
}
135+
136+
onCleanup(() => {
137+
if (!committed) {
138+
cleanup?.()
139+
}
140+
})
118141

119142
return (
120143
<Dialog title="Commands">
@@ -125,12 +148,8 @@ function DialogCommand(props: { options: CommandOption[] }) {
125148
key={(x) => x?.id}
126149
filterKeys={["title", "description", "category"]}
127150
groupBy={(x) => x.category ?? ""}
128-
onSelect={(option) => {
129-
if (option) {
130-
dialog.close()
131-
option.onSelect?.("palette")
132-
}
133-
}}
151+
onMove={handleMove}
152+
onSelect={handleSelect}
134153
>
135154
{(option) => (
136155
<div class="w-full flex items-center justify-between gap-4">

packages/app/src/context/global-sync.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,15 @@ function createGlobalSync() {
361361
)
362362
break
363363
}
364+
case "lsp.updated": {
365+
const sdk = createOpencodeClient({
366+
baseUrl: globalSDK.url,
367+
directory,
368+
throwOnError: true,
369+
})
370+
sdk.lsp.status().then((x) => setStore("lsp", x.data ?? []))
371+
break
372+
}
364373
}
365374
})
366375

packages/app/src/pages/layout.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import { Header } from "@/components/header"
4949
import { useDialog } from "@opencode-ai/ui/context/dialog"
5050
import { useTheme, type ColorScheme } from "@opencode-ai/ui/theme"
5151
import { DialogSelectProvider } from "@/components/dialog-select-provider"
52-
import { useCommand } from "@/context/command"
52+
import { useCommand, type CommandOption } from "@/context/command"
5353
import { ConstrainDragXAxis } from "@/utils/solid-dnd"
5454

5555
export default function Layout(props: ParentProps) {
@@ -323,7 +323,7 @@ export default function Layout(props: ParentProps) {
323323
}
324324

325325
command.register(() => {
326-
const commands = [
326+
const commands: CommandOption[] = [
327327
{
328328
id: "sidebar.toggle",
329329
title: "Toggle sidebar",
@@ -387,7 +387,11 @@ export default function Layout(props: ParentProps) {
387387
id: `theme.set.${id}`,
388388
title: `Use theme: ${definition.name ?? id}`,
389389
category: "Theme",
390-
onSelect: () => theme.setTheme(id),
390+
onSelect: () => theme.commitPreview(),
391+
onHighlight: () => {
392+
theme.previewTheme(id)
393+
return () => theme.cancelPreview()
394+
},
391395
})
392396
}
393397

@@ -404,7 +408,11 @@ export default function Layout(props: ParentProps) {
404408
id: `theme.scheme.${scheme}`,
405409
title: `Use color scheme: ${colorSchemeLabel[scheme]}`,
406410
category: "Theme",
407-
onSelect: () => theme.setColorScheme(scheme),
411+
onSelect: () => theme.commitPreview(),
412+
onHighlight: () => {
413+
theme.previewColorScheme(scheme)
414+
return () => theme.cancelPreview()
415+
},
408416
})
409417
}
410418

packages/app/src/pages/session.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,18 @@ export default function Page() {
9191
})
9292
const lastUserMessage = createMemo(() => visibleUserMessages()?.at(-1))
9393

94+
createEffect(
95+
on(
96+
() => lastUserMessage()?.id,
97+
() => {
98+
const msg = lastUserMessage()
99+
if (!msg) return
100+
if (msg.agent) local.agent.set(msg.agent)
101+
if (msg.model) local.model.set(msg.model)
102+
},
103+
),
104+
)
105+
94106
const [store, setStore] = createStore({
95107
clickTimer: undefined as number | undefined,
96108
activeDraggable: undefined as string | undefined,

0 commit comments

Comments
 (0)