This commit is contained in:
Dax Raad 2025-10-29 11:25:44 -04:00
parent 63fbff523f
commit 390032b7a0
3 changed files with 83 additions and 17 deletions

53
CHANGES.md Normal file
View file

@ -0,0 +1,53 @@
# OpenCode 1.0
OpenCode 1.0 is a rewrite of the TUI
We went from the go+bubbletea based TUI which suffered from both performance and capability issues to an in-house
framework (OpenTUI) written in zig+solidjs.
The new TUI mostly works like the old one as it's connecting to the same
opencode server.
There are some notable UX changes:
1. The session history is more compressed, only showing the full details of the edit
and bash tool.
2. We've added a command bar which almost everything flows through. Can press
ctrl+p to bring it up in any context and see everything you can do.
3. Added a session sidebar (can be toggled) with some useful information.
We've also stripped out some functionality that we were not sure if anyone
actually used - if something important is missing please open an issue and we'll add it back
quickly.
### Breaking Changes
## Keybinds
### Renamed
- messages_revert -> messages_undo
- switch_agent -> agent_cycle
- switch_agent_reverse -> agent_cycle_reverse
- switch_mode -> agent_cycle
- switch_mode_reverse -> agent_cycle_reverse
### Removed
- messages_layout_toggle
- messages_next
- messages_previous
- file_diff_toggle
- file_search
- file_close
- file_list
- app_help
- project_init
- tool_details
- thinking_blocks
- session_child_cycle
- session_child_cycle_reverse
- model_cycle_recent
- model_cycle_recent_reverse

View file

@ -598,21 +598,23 @@ export function Prompt(props: PromptProps) {
// trim ' from the beginning and end of the pasted content. just
// ' and nothing else
const filepath = pastedContent.replace(/^'+|'+$/g, "")
const file = Bun.file(filepath)
if (file.type.startsWith("image/")) {
const content = await file
.arrayBuffer()
.then((buffer) => Buffer.from(buffer).toString("base64"))
.catch(() => {})
if (content) {
await pasteImage({
filename: file.name,
mime: file.type,
content,
})
return
try {
const file = Bun.file(filepath)
if (file.type.startsWith("image/")) {
const content = await file
.arrayBuffer()
.then((buffer) => Buffer.from(buffer).toString("base64"))
.catch(() => {})
if (content) {
await pasteImage({
filename: file.name,
mime: file.type,
content,
})
return
}
}
}
} catch {}
const lineCount = (pastedContent.match(/\n/g)?.length ?? 0) + 1
if (lineCount >= 5) {

View file

@ -25,7 +25,11 @@ export function Home() {
</Match>
<Match when={true}>
<span style={{ fg: Theme.success }}></span>{" "}
{Locale.pluralize(Object.values(sync.data.mcp).length, "{} mcp server", "{} mcp servers")}
{Locale.pluralize(
Object.values(sync.data.mcp).length,
"{} mcp server",
"{} mcp servers",
)}
</Match>
</Switch>
</text>
@ -34,7 +38,14 @@ export function Home() {
)
return (
<box flexGrow={1} justifyContent="center" alignItems="center" paddingLeft={2} paddingRight={2} gap={1}>
<box
flexGrow={1}
justifyContent="center"
alignItems="center"
paddingLeft={2}
paddingRight={2}
gap={1}
>
<Logo />
<box width={39}>
<HelpRow keybind="command_list">Commands</HelpRow>
@ -43,7 +54,7 @@ export function Home() {
<HelpRow keybind="agent_cycle">Switch agent</HelpRow>
</box>
<box width="100%" maxWidth={75} zIndex={1000} paddingTop={1}>
<Prompt hint={Hint} showPlaceholder={true} />
<Prompt hint={Hint} />
</box>
<Toast />
</box>