mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
* fix(coding-agent): keep selector status markers visible - place status markers before labels - strike unavailable scoped models and update tests * fix(coding-agent): align scoped model toggle behavior - show checks for the all-enabled state - toggle individual models consistently and add coverage * docs(coding-agent): add changelog entry * fix(coding-agent): keep trust marker visible while browsing - move the saved marker before the trust option - update tests and changelog * fix(coding-agent): mark per-model thinking overrides - add the leading level marker - update tests and changelog
37 lines
1.3 KiB
TypeScript
37 lines
1.3 KiB
TypeScript
import { setKeybindings } from "@earendil-works/pi-tui";
|
|
import { beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
import { KeybindingsManager } from "../src/core/keybindings.ts";
|
|
import { ThinkingSelectorComponent } from "../src/modes/interactive/components/thinking-selector.ts";
|
|
import { initTheme } from "../src/modes/interactive/theme/theme.ts";
|
|
import { stripAnsi } from "../src/utils/ansi.ts";
|
|
|
|
describe("thinking selector", () => {
|
|
beforeAll(() => {
|
|
initTheme("dark");
|
|
});
|
|
|
|
beforeEach(() => {
|
|
setKeybindings(new KeybindingsManager());
|
|
});
|
|
|
|
it("keeps the current thinking level marked while browsing", () => {
|
|
const selector = new ThinkingSelectorComponent(
|
|
"medium",
|
|
["medium", "high"],
|
|
() => {},
|
|
() => {},
|
|
);
|
|
const getLevelRow = (level: string): string | undefined =>
|
|
selector
|
|
.getSelectList()
|
|
.render(80)
|
|
.map((line) => stripAnsi(line))
|
|
.find((line) => line.includes(level));
|
|
|
|
expect(selector.getSelectList().getSelectedItem()?.label).toBe("✓ medium");
|
|
expect(getLevelRow("medium")?.startsWith("→ ✓ medium")).toBe(true);
|
|
selector.handleInput("\x1b[B");
|
|
expect(getLevelRow("medium")?.startsWith(" ✓ medium")).toBe(true);
|
|
expect(getLevelRow("high")?.startsWith("→ high")).toBe(true);
|
|
});
|
|
});
|