feat(webui): redesign settings and BYOK configuration

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Xubin Ren
2026-05-08 23:48:01 +08:00
committed by Xubin Ren
co-authored by Cursor
parent 451d740849
commit 2cc32ca07c
25 changed files with 1679 additions and 216 deletions
+16
View File
@@ -5,6 +5,7 @@ import {
fetchSessionMessages,
listSessions,
listSlashCommands,
updateProviderSettings,
updateSettings,
} from "@/lib/api";
@@ -55,6 +56,21 @@ describe("webui API helpers", () => {
);
});
it("serializes provider settings updates without returning secrets", async () => {
await updateProviderSettings("tok", {
provider: "openrouter",
apiKey: "sk-or-test",
apiBase: "https://openrouter.ai/api/v1",
});
expect(fetch).toHaveBeenCalledWith(
"/api/settings/provider/update?provider=openrouter&api_key=sk-or-test&api_base=https%3A%2F%2Fopenrouter.ai%2Fapi%2Fv1",
expect.objectContaining({
headers: { Authorization: "Bearer tok" },
}),
);
});
it("maps generated session titles from the sessions list", async () => {
vi.mocked(fetch).mockResolvedValueOnce({
ok: true,