Skip to content

Commit 390032b

Browse files
committed
sync
1 parent 63fbff5 commit 390032b

File tree

3 files changed

+83
-17
lines changed

3 files changed

+83
-17
lines changed

CHANGES.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# OpenCode 1.0
2+
3+
OpenCode 1.0 is a rewrite of the TUI
4+
5+
We went from the go+bubbletea based TUI which suffered from both performance and capability issues to an in-house
6+
framework (OpenTUI) written in zig+solidjs.
7+
8+
The new TUI mostly works like the old one as it's connecting to the same
9+
opencode server.
10+
11+
There are some notable UX changes:
12+
13+
1. The session history is more compressed, only showing the full details of the edit
14+
and bash tool.
15+
16+
2. We've added a command bar which almost everything flows through. Can press
17+
ctrl+p to bring it up in any context and see everything you can do.
18+
19+
3. Added a session sidebar (can be toggled) with some useful information.
20+
21+
We've also stripped out some functionality that we were not sure if anyone
22+
actually used - if something important is missing please open an issue and we'll add it back
23+
quickly.
24+
25+
### Breaking Changes
26+
27+
## Keybinds
28+
29+
### Renamed
30+
31+
- messages_revert -> messages_undo
32+
- switch_agent -> agent_cycle
33+
- switch_agent_reverse -> agent_cycle_reverse
34+
- switch_mode -> agent_cycle
35+
- switch_mode_reverse -> agent_cycle_reverse
36+
37+
### Removed
38+
39+
- messages_layout_toggle
40+
- messages_next
41+
- messages_previous
42+
- file_diff_toggle
43+
- file_search
44+
- file_close
45+
- file_list
46+
- app_help
47+
- project_init
48+
- tool_details
49+
- thinking_blocks
50+
- session_child_cycle
51+
- session_child_cycle_reverse
52+
- model_cycle_recent
53+
- model_cycle_recent_reverse

packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -598,21 +598,23 @@ export function Prompt(props: PromptProps) {
598598
// trim ' from the beginning and end of the pasted content. just
599599
// ' and nothing else
600600
const filepath = pastedContent.replace(/^'+|'+$/g, "")
601-
const file = Bun.file(filepath)
602-
if (file.type.startsWith("image/")) {
603-
const content = await file
604-
.arrayBuffer()
605-
.then((buffer) => Buffer.from(buffer).toString("base64"))
606-
.catch(() => {})
607-
if (content) {
608-
await pasteImage({
609-
filename: file.name,
610-
mime: file.type,
611-
content,
612-
})
613-
return
601+
try {
602+
const file = Bun.file(filepath)
603+
if (file.type.startsWith("image/")) {
604+
const content = await file
605+
.arrayBuffer()
606+
.then((buffer) => Buffer.from(buffer).toString("base64"))
607+
.catch(() => {})
608+
if (content) {
609+
await pasteImage({
610+
filename: file.name,
611+
mime: file.type,
612+
content,
613+
})
614+
return
615+
}
614616
}
615-
}
617+
} catch {}
616618

617619
const lineCount = (pastedContent.match(/\n/g)?.length ?? 0) + 1
618620
if (lineCount >= 5) {

packages/opencode/src/cli/cmd/tui/routes/home.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ export function Home() {
2525
</Match>
2626
<Match when={true}>
2727
<span style={{ fg: Theme.success }}></span>{" "}
28-
{Locale.pluralize(Object.values(sync.data.mcp).length, "{} mcp server", "{} mcp servers")}
28+
{Locale.pluralize(
29+
Object.values(sync.data.mcp).length,
30+
"{} mcp server",
31+
"{} mcp servers",
32+
)}
2933
</Match>
3034
</Switch>
3135
</text>
@@ -34,7 +38,14 @@ export function Home() {
3438
)
3539

3640
return (
37-
<box flexGrow={1} justifyContent="center" alignItems="center" paddingLeft={2} paddingRight={2} gap={1}>
41+
<box
42+
flexGrow={1}
43+
justifyContent="center"
44+
alignItems="center"
45+
paddingLeft={2}
46+
paddingRight={2}
47+
gap={1}
48+
>
3849
<Logo />
3950
<box width={39}>
4051
<HelpRow keybind="command_list">Commands</HelpRow>
@@ -43,7 +54,7 @@ export function Home() {
4354
<HelpRow keybind="agent_cycle">Switch agent</HelpRow>
4455
</box>
4556
<box width="100%" maxWidth={75} zIndex={1000} paddingTop={1}>
46-
<Prompt hint={Hint} showPlaceholder={true} />
57+
<Prompt hint={Hint} />
4758
</box>
4859
<Toast />
4960
</box>

0 commit comments

Comments
 (0)