Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
5608a92
feat: move diff_style from config to kv.json and add toggle menu
ariane-emory Jan 26, 2026
52089e5
Merge dev into feat/kv-diff-style-clean - resolved conflicts
ariane-emory Jan 27, 2026
2edf93b
Merge branch 'dev' into feat/kv-diff-style-clean
ariane-emory Jan 29, 2026
664b588
Merge branch 'dev' into feat/kv-diff-style-clean
ariane-emory Jan 29, 2026
fcd02ab
Merge branch 'dev' into feat/kv-diff-style-clean
ariane-emory Jan 30, 2026
01ff58c
Merge branch 'feat/kv-diff-style-clean' of github.com:ariane-emory/op…
ariane-emory Jan 30, 2026
16231cb
Merge branch 'dev' into feat/kv-diff-style-clean
ariane-emory Feb 2, 2026
d6b03b4
Merge branch 'dev' into feat/kv-diff-style-clean
ariane-emory Feb 2, 2026
68ca611
Merge branch 'feat/kv-diff-style-clean' of github.com:ariane-emory/op…
ariane-emory Feb 2, 2026
b3e685a
Merge branch 'dev' into feat/kv-diff-style-clean
ariane-emory Feb 3, 2026
e403bd7
Merge branch 'dev' into feat/kv-diff-style-clean
ariane-emory Feb 4, 2026
a277f5e
Merge branch 'dev' into feat/kv-diff-style-clean
ariane-emory Feb 4, 2026
f2e7f8a
Merge branch 'dev' into feat/kv-diff-style-clean
ariane-emory Feb 6, 2026
50882e4
Merge branch 'dev' into feat/kv-diff-style-clean
ariane-emory Feb 6, 2026
520b252
Merge branch 'dev' into feat/kv-diff-style-clean
ariane-emory Feb 6, 2026
bb4db69
Merge branch 'dev' into feat/kv-diff-style-clean
ariane-emory Feb 7, 2026
0066d89
Merge branch 'dev' into feat/kv-diff-style-clean
ariane-emory Feb 10, 2026
21ccf76
Merge branch 'dev' into feat/kv-diff-style-clean
ariane-emory Feb 11, 2026
a21a854
Merge branch 'dev' into feat/kv-diff-style-clean
ariane-emory Feb 12, 2026
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
10 changes: 10 additions & 0 deletions packages/opencode/src/cli/cmd/tui/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,16 @@ function App() {
dialog.clear()
},
},
{
title: kv.get("diff_style", "auto") === "auto" ? "Use unified diff style" : "Use automatic diff style",
value: "tui.diff_style.toggle",
category: "System",
onSelect: (dialog) => {
const current = kv.get("diff_style", "auto")
kv.set("diff_style", current === "auto" ? "unified" : "auto")
dialog.clear()
},
},
{
title: kv.get("diff_wrap_mode", "word") === "word" ? "Disable diff wrapping" : "Enable diff wrapping",
value: "app.toggle.diffwrap",
Expand Down
10 changes: 6 additions & 4 deletions packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1909,11 +1909,12 @@ function Task(props: ToolProps<typeof TaskTool>) {

function Edit(props: ToolProps<typeof EditTool>) {
const ctx = use()
const kv = useKV()
const { theme, syntax } = useTheme()

const view = createMemo(() => {
const diffStyle = ctx.sync.data.config.tui?.diff_style
if (diffStyle === "stacked") return "unified"
const diffStyle = kv.get("diff_style", "auto")
if (diffStyle === "unified") return "unified"
// Default to "auto" behavior
return ctx.width > 120 ? "split" : "unified"
})
Expand Down Expand Up @@ -1978,13 +1979,14 @@ function Edit(props: ToolProps<typeof EditTool>) {

function ApplyPatch(props: ToolProps<typeof ApplyPatchTool>) {
const ctx = use()
const kv = useKV()
const { theme, syntax } = useTheme()

const files = createMemo(() => props.metadata.files ?? [])

const view = createMemo(() => {
const diffStyle = ctx.sync.data.config.tui?.diff_style
if (diffStyle === "stacked") return "unified"
const diffStyle = kv.get("diff_style", "auto")
if (diffStyle === "unified") return "unified"
return ctx.width > 120 ? "split" : "unified"
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type { PermissionRequest } from "@opencode-ai/sdk/v2"
import { useSDK } from "../../context/sdk"
import { SplitBorder } from "../../component/border"
import { useSync } from "../../context/sync"
import { useKV } from "../../context/kv"
import { useTextareaKeybindings } from "../../component/textarea-keybindings"
import path from "path"
import { LANGUAGE_EXTENSIONS } from "@/lsp/language"
Expand Down Expand Up @@ -48,15 +49,15 @@ function EditBody(props: { request: PermissionRequest }) {
const themeState = useTheme()
const theme = themeState.theme
const syntax = themeState.syntax
const sync = useSync()
const kv = useKV()
const dimensions = useTerminalDimensions()

const filepath = createMemo(() => (props.request.metadata?.filepath as string) ?? "")
const diff = createMemo(() => (props.request.metadata?.diff as string) ?? "")

const view = createMemo(() => {
const diffStyle = sync.data.config.tui?.diff_style
if (diffStyle === "stacked") return "unified"
const diffStyle = kv.get("diff_style", "auto")
if (diffStyle === "unified") return "unified"
return dimensions().width > 120 ? "split" : "unified"
})

Expand Down
4 changes: 0 additions & 4 deletions packages/opencode/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -924,10 +924,6 @@ export namespace Config {
})
.optional()
.describe("Scroll acceleration settings"),
diff_style: z
.enum(["auto", "stacked"])
.optional()
.describe("Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column"),
})

export const Server = z
Expand Down
Loading