feat(web): settings form polish — dialog layout, homepage button, no default rows, unified dropdown text (#39)

Co-authored-by: Alice <alice@prismshadow.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Yaowei Zheng
2026-07-23 01:07:45 +08:00
committed by GitHub
parent 6d56ce9ccc
commit d01d0faf7a
10 changed files with 363 additions and 183 deletions
+10 -6
View File
@@ -63,18 +63,22 @@ describe("thinkingLevelOptionsFor (agent-settings dropdown assembly)", () => {
["xhigh", "Extra-high tier."],
];
it("maps the dictionary in order; the '' row renders the default tag; no none row normally", () => {
it("filters the '' inherit row and keeps dictionary order; no none row normally", () => {
for (const stored of [undefined, "", "medium", "xhigh"]) {
const rows = thinkingLevelOptionsFor(OPTIONS, "(default)", "legacy none", stored);
expect(rows.map((r) => r.value)).toEqual(["", "low", "medium", "high", "xhigh"]);
expect(rows[0]).toMatchObject({ triggerLabel: "(default)", label: "(default)" });
const rows = thinkingLevelOptionsFor(OPTIONS, "legacy none", stored);
expect(rows.map((r) => r.value)).toEqual(["low", "medium", "high", "xhigh"]);
expect(rows.some((r) => r.value === "none")).toBe(false);
expect(rows[0]).toMatchObject({
triggerLabel: "low",
label: "low",
description: "Low tier.",
});
}
});
it("appends a display-only none row when the persisted config stores none (backward compat)", () => {
const rows = thinkingLevelOptionsFor(OPTIONS, "(default)", "legacy none", "none");
expect(rows.map((r) => r.value)).toEqual(["", "low", "medium", "high", "xhigh", "none"]);
const rows = thinkingLevelOptionsFor(OPTIONS, "legacy none", "none");
expect(rows.map((r) => r.value)).toEqual(["low", "medium", "high", "xhigh", "none"]);
expect(rows.at(-1)).toEqual({
value: "none",
triggerLabel: "none",