mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-19 00:10:00 +00:00
Settings › Agents › Chat › Conversation gets an opt-in toggle (agents.fitWindowWidth, off by default). When on, the conversation stream, composer, question card, user message bubbles and the New Task page drop their max-width caps and follow the pane width; when off, the readable 900 px column stays. Co-authored-by: dengliu <5108773+dengliu@users.noreply.github.com>
56 lines
1.7 KiB
TypeScript
56 lines
1.7 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { validateSettings } from "../model/schema";
|
|
|
|
describe("agent chat settings", () => {
|
|
it("defaults every meter but the cost to on and keeps stored values", () => {
|
|
expect(validateSettings({}).agents).toEqual({
|
|
showContextUsage: true,
|
|
showWorkTime: true,
|
|
showUsageLimits: true,
|
|
showCost: false,
|
|
foldTurns: true,
|
|
smoothText: true,
|
|
fitWindowWidth: false,
|
|
thinking: "auto",
|
|
toolCalls: "grouped",
|
|
expandToolOutput: false,
|
|
sendWith: "enter",
|
|
whileRunning: "queue",
|
|
newTaskApprovals: "bypass",
|
|
defaults: {},
|
|
mcpServers: {},
|
|
});
|
|
const stored = validateSettings({
|
|
agents: { showUsageLimits: false, showCost: true, showWorkTime: "no", fitWindowWidth: true },
|
|
}).agents;
|
|
expect(stored).toMatchObject({
|
|
showContextUsage: true,
|
|
showWorkTime: true,
|
|
showUsageLimits: false,
|
|
showCost: true,
|
|
fitWindowWidth: true,
|
|
});
|
|
expect(validateSettings({ agents: { fitWindowWidth: "yes" } }).agents.fitWindowWidth).toBe(false);
|
|
});
|
|
|
|
it("keeps valid chat choices and per-agent defaults", () => {
|
|
const stored = validateSettings({
|
|
agents: {
|
|
thinking: "collapsed",
|
|
toolCalls: "nope",
|
|
sendWith: "modEnter",
|
|
newTaskApprovals: "ask",
|
|
defaults: { claude: { model: "opus", effort: 3 }, codex: "x" },
|
|
},
|
|
}).agents;
|
|
expect(stored).toMatchObject({
|
|
thinking: "collapsed",
|
|
toolCalls: "grouped",
|
|
sendWith: "modEnter",
|
|
newTaskApprovals: "ask",
|
|
defaults: { claude: { model: "opus" }, codex: {} },
|
|
});
|
|
expect(validateSettings({ agents: { newTaskApprovals: "never" } }).agents.newTaskApprovals).toBe("bypass");
|
|
});
|
|
});
|