feat(tui): add automatic tabs mode (#50456)

This commit is contained in:
opencode-agent[bot]
2026-09-22 01:00:26 +00:00
committed by GitHub
Unverified
parent 1814dd9799
commit 5b9dc35eec
17 changed files with 111 additions and 46 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ import { produce, type Draft } from "immer"
import { applyEdits, modify, parse, type ParseError } from "jsonc-parser"
import path from "path"
import { ConfigMigration } from "./migrate"
import { Info, SchemaURL } from "./schema"
import { Info, normalizeLegacyTabs, SchemaURL } from "./schema"
export * from "./schema"
@@ -119,7 +119,7 @@ function merge(...values: readonly (Info | undefined)[]) {
return Option.getOrElse(
decode(
values.reduce<Record<string, unknown>>(
(result, value) => mergeRecords(result, value ?? {}),
(result, value) => mergeRecords(result, normalizeLegacyTabs(value) ?? {}),
{},
),
),
+8
View File
@@ -8,3 +8,11 @@ export const Info = Schema.Struct({
...Config.Info.fields,
})
export type Info = Schema.Schema.Type<typeof Info>
export function normalizeLegacyTabs(info: Info | undefined) {
if (info?.tabs?.enabled === undefined) return info
const tabs = { ...info.tabs }
tabs.mode ??= tabs.enabled ? "on" : "off"
delete tabs.enabled
return { ...info, tabs }
}