fix(webui): recover model failures and align chat controls

This commit is contained in:
Xubin Ren committed 2026-10-21 02:34:09 +08:00
1 parent 688976bcb9
commit 28f6c26946
42 files changed
+646 -82

No files matched your search

+18 -1
View File
@@ -62,7 +62,7 @@ describe("RecoveryNotice", () => {
expect(notice).toHaveAttribute("data-recovery-status", "awaiting_user");
expect(notice).toHaveAttribute("aria-live", "assertive");
expect(notice).toHaveClass(
"max-w-[49.5rem]",
"thread-composer-notice",
"rounded-control",
"animate-in",
"fade-in-0",
@@ -136,4 +136,21 @@ describe("RecoveryNotice", () => {
expect(screen.queryByRole("button", { name: "Continue" })).not.toBeInTheDocument();
expect(screen.getByRole("button", { name: "Dismiss" })).toBeInTheDocument();
});
it("shows model authorization recovery after loading saved state", () => {
const onOpenSettings = vi.fn();
render(
<RecoveryNotice
state={{ ...INTERRUPTED, reason: "model_request_failed", failure_error_kind: "authentication" }}
onContinue={vi.fn().mockResolvedValue(undefined)}
onDismiss={vi.fn().mockResolvedValue(undefined)}
onOpenSettings={onOpenSettings}
/>,
);
expect(screen.getByRole("alert")).toHaveTextContent("Model provider authorization failed");
expect(screen.getByRole("alert")).not.toHaveTextContent("Task interrupted");
fireEvent.click(screen.getByRole("button", { name: "Open model settings" }));
expect(onOpenSettings).toHaveBeenCalledOnce();
expect(screen.getByRole("button", { name: "Continue" })).toBeEnabled();
});
});