mini: add replay settings to cli config (#38487)

This commit is contained in:
Simon Klee 2026-07-23 12:12:25 +02:00 committed by GitHub
commit 52c98a4eeb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 28 additions and 6 deletions

View file

@ -142,6 +142,12 @@ export const Info = Schema.Struct({
mono: Schema.optional(Schema.Boolean).annotate({
description: "Use monochrome ASCII output",
}),
replay: Schema.optional(Schema.Boolean).annotate({
description: "Restore session history on resume and terminal resize",
}),
replay_limit: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))).annotate({
description: "Maximum number of newest messages restored during replay",
}),
}),
).annotate({ description: "Mini transcript presentation settings" }),
hints: Schema.optional(

View file

@ -1,13 +1,25 @@
/** @jsxImportSource @opentui/solid */
import { testRender } from "@opentui/solid"
import { expect, test } from "bun:test"
import { Schema } from "effect"
import {
resolve,
ConfigProvider,
Info,
useConfig,
type Interface,
} from "../src/config"
test("validates mini replay settings", () => {
const decode = Schema.decodeUnknownSync(Info)
expect(decode({ mini: { replay: false, replay_limit: 50 } })).toEqual({
mini: { replay: false, replay_limit: 50 },
})
expect(() => decode({ mini: { replay_limit: 0 } })).toThrow()
expect(() => decode({ mini: { replay_limit: 1.5 } })).toThrow()
})
test("resolves nested config and keybind defaults", () => {
const config = resolve(
{