Skip to content

Commit 42e0218

Browse files
shivamhwpclaude
andcommitted
fix(web): the settings recovery screen uses the redesign's empty state
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent f074d6b commit 42e0218

2 files changed

Lines changed: 44 additions & 29 deletions

File tree

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,49 @@
1-
import { OctagonAlertIcon } from "lucide-react";
1+
import { Settings2Icon } from "lucide-react";
22
import type { ReactNode } from "react";
33

44
import {
55
ensureClientSettingsHydrated,
66
useClientSettingsHydrationStatus,
77
} from "../hooks/useSettings";
88
import { Button } from "./ui/button";
9+
import {
10+
Empty,
11+
EmptyContent,
12+
EmptyDescription,
13+
EmptyHeader,
14+
EmptyMedia,
15+
EmptyTitle,
16+
} from "./ui/empty";
917
import { RefreshIcon } from "./ui/refresh-icon";
10-
import { StandalonePage, StandalonePageIcon } from "./ui/standalone-page";
18+
import { StandalonePage } from "./ui/standalone-page";
1119

1220
/** Edits made on defaults after a failed read are never saved, so the app waits for a good read. */
1321
export function ClientSettingsRecoveryGate({ children }: { readonly children: ReactNode }) {
1422
const status = useClientSettingsHydrationStatus();
1523
if (status !== "failed" && status !== "retrying") return children;
1624
const retrying = status === "retrying";
1725
return (
18-
<StandalonePage size="card">
19-
<div className="flex items-center gap-3">
20-
<StandalonePageIcon tone="error">
21-
<OctagonAlertIcon />
22-
</StandalonePageIcon>
23-
<h1 className="min-w-0 flex-1 text-label text-strong-foreground">
24-
Couldn't load your settings
25-
</h1>
26-
<Button
27-
size="standard"
28-
variant="secondary"
29-
disabled={retrying}
30-
onClick={() => void ensureClientSettingsHydrated().catch(() => undefined)}
31-
>
32-
<RefreshIcon refreshing={retrying} />
33-
Retry
34-
</Button>
35-
</div>
26+
<StandalonePage size="bare">
27+
<Empty size="compact">
28+
<EmptyMedia variant="icon">
29+
<Settings2Icon />
30+
</EmptyMedia>
31+
<EmptyHeader>
32+
<EmptyTitle>Couldn't load your settings</EmptyTitle>
33+
<EmptyDescription>Your saved settings are unchanged.</EmptyDescription>
34+
</EmptyHeader>
35+
<EmptyContent>
36+
<Button
37+
size="standard"
38+
disabled={retrying}
39+
aria-busy={retrying}
40+
onClick={() => void ensureClientSettingsHydrated().catch(() => undefined)}
41+
>
42+
<RefreshIcon refreshing={retrying} />
43+
{retrying ? "Retrying…" : "Retry"}
44+
</Button>
45+
</EmptyContent>
46+
</Empty>
3647
</StandalonePage>
3748
);
3849
}

‎apps/web/src/components/ui/standalone-page.tsx‎

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ export function StandalonePage({
1515
children,
1616
}: {
1717
readonly tone?: keyof typeof backdropClassNames;
18-
/** "card" is the compact auth card: 420px wide, 24px inset, 16px between blocks. */
19-
readonly size?: "page" | "card";
18+
/** "card" is the compact auth card: 420px wide, 24px inset, 16px between blocks. "bare" draws no card. */
19+
readonly size?: "page" | "card" | "bare";
2020
readonly children: ReactNode;
2121
}) {
2222
return (
@@ -36,13 +36,17 @@ export function StandalonePage({
3636
</div>
3737
)}
3838

39-
<section
40-
className={`relative w-full shrink-0 rounded-[16px] surface-popover ${size === "card" ? "max-w-[420px]" : "max-w-xl"}`}
41-
>
42-
<div className={size === "card" ? "flex flex-col gap-4 p-6" : "p-6 sm:p-8"}>
43-
{children}
44-
</div>
45-
</section>
39+
{size === "bare" ? (
40+
children
41+
) : (
42+
<section
43+
className={`relative w-full shrink-0 rounded-[16px] surface-popover ${size === "card" ? "max-w-[420px]" : "max-w-xl"}`}
44+
>
45+
<div className={size === "card" ? "flex flex-col gap-4 p-6" : "p-6 sm:p-8"}>
46+
{children}
47+
</div>
48+
</section>
49+
)}
4650
</div>
4751
</div>
4852
);

0 commit comments

Comments
 (0)