Skip to content

Commit 3fad1fc

Browse files
fix(web): database notice no longer nests a second settings card
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent d8a5c73 commit 3fad1fc

1 file changed

Lines changed: 30 additions & 33 deletions

File tree

‎apps/web/src/components/settings/DatabaseStorageNotice.tsx‎

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { useCopyToClipboard } from "../../hooks/useCopyToClipboard";
66
import { useLocalStorage } from "../../hooks/useLocalStorage";
77
import { serverEnvironment } from "../../state/server";
88
import { Button } from "../ui/button";
9-
import { SettingsGroup } from "./SettingsGroup";
109
import { SettingsRow, SettingsSection } from "./settingsLayout";
1110

1211
const DismissedEnvironmentIds = Schema.Array(Schema.String);
@@ -34,40 +33,38 @@ export function DatabaseStorageNotice({
3433
if (visible.length === 0) return null;
3534
return (
3635
<SettingsSection id="storage-database" title="Database">
37-
<SettingsGroup>
36+
<SettingsRow
37+
title="Reclaim freed database space"
38+
description="Old history is cleaned up automatically, but these databases still hold the freed space. Run the command on each machine to return it to disk; it pauses and restarts the background service. Quit the desktop app first if it hosts the environment."
39+
/>
40+
{visible.map(({ environmentId, status }) => (
3841
<SettingsRow
39-
title="Reclaim freed database space"
40-
description="Old history is cleaned up automatically, but these databases still hold the freed space. Run the command on each machine to return it to disk; it pauses and restarts the background service. Quit the desktop app first if it hosts the environment."
42+
key={environmentId}
43+
title={`${(status.reclaimableBytes / 1024 ** 3).toFixed(1)} GiB on ${
44+
environments.find((environment) => environment.environmentId === environmentId)
45+
?.label ?? environmentId
46+
}`}
47+
description={<code className="select-text break-all">{status.compactCommand}</code>}
48+
control={
49+
<div className="flex flex-wrap items-center gap-1.5">
50+
<Button
51+
variant="outline"
52+
size="xs"
53+
onClick={() => copyToClipboard(status.compactCommand, undefined)}
54+
>
55+
Copy command
56+
</Button>
57+
<Button
58+
variant="ghost"
59+
size="xs"
60+
onClick={() => setDismissed((current) => [...current, environmentId])}
61+
>
62+
Dismiss
63+
</Button>
64+
</div>
65+
}
4166
/>
42-
{visible.map(({ environmentId, status }) => (
43-
<SettingsRow
44-
key={environmentId}
45-
title={`${(status.reclaimableBytes / 1024 ** 3).toFixed(1)} GiB on ${
46-
environments.find((environment) => environment.environmentId === environmentId)
47-
?.label ?? environmentId
48-
}`}
49-
description={<code className="select-text break-all">{status.compactCommand}</code>}
50-
control={
51-
<div className="flex flex-wrap items-center gap-1.5">
52-
<Button
53-
variant="outline"
54-
size="xs"
55-
onClick={() => copyToClipboard(status.compactCommand, undefined)}
56-
>
57-
Copy command
58-
</Button>
59-
<Button
60-
variant="ghost"
61-
size="xs"
62-
onClick={() => setDismissed((current) => [...current, environmentId])}
63-
>
64-
Dismiss
65-
</Button>
66-
</div>
67-
}
68-
/>
69-
))}
70-
</SettingsGroup>
67+
))}
7168
</SettingsSection>
7269
);
7370
}

0 commit comments

Comments
 (0)