Skip to content

Commit 6ad68a6

Browse files
authored
fix(desktop): align settings section headers (#1165)
Signed-off-by: Thomas Petersen <[email protected]>
1 parent 1011cea commit 6ad68a6

18 files changed

Lines changed: 160 additions & 128 deletions

‎deploy/compose/compose.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ services:
5050
- buzz-net
5151

5252
postgres:
53-
image: postgres:18-alpine
53+
image: postgres:17-alpine
5454
environment:
5555
POSTGRES_DB: ${POSTGRES_DB:-buzz}
5656
POSTGRES_USER: ${POSTGRES_USER:-buzz}
@@ -69,7 +69,7 @@ services:
6969
- buzz-net
7070

7171
redis:
72-
image: redis:8-alpine
72+
image: redis:7-alpine
7373
command: ["redis-server", "--appendonly", "yes", "--requirepass", "${REDIS_PASSWORD:?set REDIS_PASSWORD}"]
7474
environment:
7575
REDIS_PASSWORD: ${REDIS_PASSWORD:?set REDIS_PASSWORD}

‎desktop/scripts/check-px-text.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const rules = [
2323
// glyph is a fixed display size sized to its avatar box (not readable message
2424
// text), so it stays as the lone documented `text-[6rem]` literal.
2525
const overrides = new Set([
26-
"src/features/settings/ui/ProfileSettingsCard.tsx:573",
26+
"src/features/settings/ui/ProfileSettingsCard.tsx:572",
2727
"src/features/onboarding/ui/AvatarStep.tsx:89",
2828
]);
2929

‎desktop/src/features/custom-emoji/ui/CustomEmojiSettingsCard.tsx‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { rewriteRelayUrl } from "@/shared/lib/mediaUrl";
1717
import { Button } from "@/shared/ui/button";
1818
import { Input } from "@/shared/ui/input";
1919
import { SettingsOptionGroup } from "@/features/settings/ui/SettingsOptionGroup";
20+
import { SettingsSectionHeader } from "@/features/settings/ui/SettingsSectionHeader";
2021

2122
/**
2223
* Custom emoji management (NIP-30, kind:30030). Each member owns their own set:
@@ -124,13 +125,15 @@ export function CustomEmojiSettingsCard() {
124125

125126
return (
126127
<section className="min-w-0" data-testid="settings-custom-emoji">
127-
<div className="mb-12 space-y-1">
128-
<h2 className="text-2xl font-semibold tracking-tight">Custom Emoji</h2>
129-
<p className="text-base font-normal text-muted-foreground">
130-
Add your own custom emoji for everyone on this relay to use. Type{" "}
131-
<code>:name:</code> in messages and reactions.
132-
</p>
133-
</div>
128+
<SettingsSectionHeader
129+
title="Custom Emoji"
130+
description={
131+
<>
132+
Add your own custom emoji for everyone on this relay to use. Type{" "}
133+
<code>:name:</code> in messages and reactions.
134+
</>
135+
}
136+
/>
134137

135138
<div className="space-y-6">
136139
<form

‎desktop/src/features/mesh-compute/ui/MeshComputeSettingsCard.tsx‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
SettingsOptionGroup,
1616
SettingsOptionRow,
1717
} from "@/features/settings/ui/SettingsOptionGroup";
18+
import { SettingsSectionHeader } from "@/features/settings/ui/SettingsSectionHeader";
1819
import { classifyModelRef, modelRefHintLabel } from "../classifyModelRef";
1920
import { useMeshNodeStatus } from "../hooks/useMeshNodeStatus";
2021

@@ -135,13 +136,15 @@ export function MeshComputeSettingsCard() {
135136

136137
return (
137138
<section className="min-w-0" data-testid="settings-mesh-share-compute">
138-
<div className="mb-12 min-w-0">
139-
<h2 className="text-2xl font-semibold tracking-tight">Share compute</h2>
140-
<p className="text-base font-normal text-muted-foreground">
141-
Share this machine with your relay. When on, other members can run
142-
their agents here.
143-
</p>
144-
</div>
139+
<SettingsSectionHeader
140+
title="Share compute"
141+
description={
142+
<>
143+
Share this machine with your relay. When on, other members can run
144+
their agents here.
145+
</>
146+
}
147+
/>
145148

146149
{error ? (
147150
<p className="mb-3 rounded-lg bg-destructive/10 px-3 py-2 text-sm text-destructive">

‎desktop/src/features/relay-members/ui/RelayMembersSettingsCard.tsx‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import {
3636
DropdownMenuTrigger,
3737
} from "@/shared/ui/dropdown-menu";
3838
import { Input } from "@/shared/ui/input";
39+
import { SettingsSectionHeader } from "@/features/settings/ui/SettingsSectionHeader";
3940
import { VirtualizedList } from "@/shared/ui/VirtualizedList";
4041

4142
type AssignableRelayRole = Exclude<RelayMemberRole, "owner">;
@@ -353,13 +354,15 @@ export function RelayMembersSettingsCard({
353354

354355
return (
355356
<section className="min-w-0" data-testid="settings-relay-members">
356-
<div className="mb-12 space-y-1">
357-
<h2 className="text-2xl font-semibold tracking-tight">Relay Access</h2>
358-
<p className="text-base font-normal text-muted-foreground">
359-
Manage who can connect to this relay. Owners can invite admins or
360-
members; admins can invite members.
361-
</p>
362-
</div>
357+
<SettingsSectionHeader
358+
title="Relay Access"
359+
description={
360+
<>
361+
Manage who can connect to this relay. Owners can invite admins or
362+
members; admins can invite members.
363+
</>
364+
}
365+
/>
363366

364367
<div className="space-y-6">
365368
<form className="space-y-1.5" onSubmit={handleAddMember}>

‎desktop/src/features/settings/UpdateChecker.tsx‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,17 @@ import {
44
SettingsOptionGroup,
55
SettingsOptionRow,
66
} from "./ui/SettingsOptionGroup";
7+
import { SettingsSectionHeader } from "./ui/SettingsSectionHeader";
78

89
export function UpdateChecker() {
910
const { status, checkForUpdate, relaunch } = useUpdaterContext();
1011

1112
return (
12-
<section className="min-w-0">
13-
<div className="mb-12 min-w-0">
14-
<h2 className="text-2xl font-semibold tracking-tight">
15-
Software Updates
16-
</h2>
17-
<p className="text-base font-normal text-muted-foreground">
18-
Keep Buzz up to date with the latest features and fixes.
19-
</p>
20-
</div>
13+
<section className="min-w-0" data-testid="settings-updates">
14+
<SettingsSectionHeader
15+
title="Software Updates"
16+
description="Keep Buzz up to date with the latest features and fixes."
17+
/>
2118

2219
<SettingsOptionGroup>
2320
{status.state === "idle" && (

‎desktop/src/features/settings/ui/ChannelTemplatesSettingsCard.tsx‎

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import type {
3333
UpdateChannelTemplateInput,
3434
} from "@/shared/api/types";
3535
import { cn } from "@/shared/lib/cn";
36+
import { SettingsSectionHeader } from "./SettingsSectionHeader";
3637
import {
3738
AlertDialog,
3839
AlertDialogAction,
@@ -103,27 +104,26 @@ export function ChannelTemplatesSettingsCard() {
103104

104105
return (
105106
<section className="min-w-0" data-testid="settings-channel-templates">
106-
<div className="mb-12 flex min-w-0 items-start justify-between gap-4">
107-
<div className="min-w-0">
108-
<h2 className="text-2xl font-semibold tracking-tight">
109-
Channel Templates
110-
</h2>
111-
<p className="text-base font-normal text-muted-foreground">
107+
<SettingsSectionHeader
108+
title="Channel Templates"
109+
description={
110+
<>
112111
Save reusable channel configurations and apply them when creating
113112
new channels.
114-
</p>
115-
</div>
116-
<Button
117-
className="shrink-0"
118-
onClick={() => setIsCreateOpen(true)}
119-
size="sm"
120-
type="button"
121-
variant="outline"
122-
>
123-
<Plus className="mr-1.5 h-4 w-4" />
124-
Create
125-
</Button>
126-
</div>
113+
</>
114+
}
115+
action={
116+
<Button
117+
onClick={() => setIsCreateOpen(true)}
118+
size="sm"
119+
type="button"
120+
variant="outline"
121+
>
122+
<Plus className="mr-1.5 h-4 w-4" />
123+
Create
124+
</Button>
125+
}
126+
/>
127127

128128
{templatesQuery.isLoading ? (
129129
<p className="py-6 text-center text-sm text-muted-foreground">

‎desktop/src/features/settings/ui/DoctorSettingsPanel.tsx‎

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import type { AcpRuntimeCatalogEntry } from "@/shared/api/types";
1818
import { cn } from "@/shared/lib/cn";
1919
import { Button } from "@/shared/ui/button";
2020
import { SettingsOptionGroup } from "./SettingsOptionGroup";
21+
import { SettingsSectionHeader } from "./SettingsSectionHeader";
2122

2223
function StatusIcon({
2324
availability,
@@ -268,32 +269,28 @@ export function DoctorSettingsPanel() {
268269
}
269270

270271
return (
271-
<section data-testid="settings-doctor">
272-
<div className="mb-12 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
273-
<div className="min-w-0">
274-
<h2 className="text-2xl font-semibold tracking-tight">Doctor</h2>
275-
<p className="mt-1 text-base font-normal text-muted-foreground">
276-
Verify the ACP runtime commands available to the desktop app.
277-
</p>
278-
</div>
279-
280-
<Button
281-
className="shrink-0"
282-
disabled={isRefreshing}
283-
onClick={() => {
284-
setInstallResults({});
285-
void runtimesQuery.refetch();
286-
}}
287-
size="sm"
288-
type="button"
289-
variant="outline"
290-
>
291-
<RefreshCw
292-
className={cn("h-4 w-4", isRefreshing && "animate-spin")}
293-
/>
294-
Re-run
295-
</Button>
296-
</div>
272+
<section className="min-w-0" data-testid="settings-doctor">
273+
<SettingsSectionHeader
274+
title="Doctor"
275+
description="Verify the ACP runtime commands available to the desktop app."
276+
action={
277+
<Button
278+
disabled={isRefreshing}
279+
onClick={() => {
280+
setInstallResults({});
281+
void runtimesQuery.refetch();
282+
}}
283+
size="sm"
284+
type="button"
285+
variant="outline"
286+
>
287+
<RefreshCw
288+
className={cn("h-4 w-4", isRefreshing && "animate-spin")}
289+
/>
290+
Re-run
291+
</Button>
292+
}
293+
/>
297294

298295
<div className="space-y-5">
299296
<SettingsOptionGroup>

‎desktop/src/features/settings/ui/ExperimentalFeaturesCard.tsx‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { desktopFeatures, useFeatureToggle } from "@/shared/features";
22
import type { FeatureDefinition } from "@/shared/features";
33
import { Switch } from "@/shared/ui/switch";
4+
import { SettingsSectionHeader } from "./SettingsSectionHeader";
45

56
function FeatureRow({ feature }: { feature: FeatureDefinition }) {
67
const [enabled, toggle] = useFeatureToggle(feature.id);
@@ -31,13 +32,15 @@ export function ExperimentalFeaturesCard() {
3132

3233
return (
3334
<section className="min-w-0" data-testid="settings-experimental">
34-
<div className="mb-12 min-w-0">
35-
<h2 className="text-2xl font-semibold tracking-tight">Experiments</h2>
36-
<p className="text-base font-normal text-muted-foreground">
37-
These features are functional but still being refined. Enable them to
38-
try new capabilities early.
39-
</p>
40-
</div>
35+
<SettingsSectionHeader
36+
title="Experiments"
37+
description={
38+
<>
39+
These features are functional but still being refined. Enable them
40+
to try new capabilities early.
41+
</>
42+
}
43+
/>
4144

4245
<div className="flex flex-col gap-2">
4346
{previewFeatures.map((f) => (

‎desktop/src/features/settings/ui/KeyboardShortcutsCard.tsx‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
type KeyboardShortcut,
55
} from "@/shared/lib/keyboard-shortcuts";
66
import { SettingsOptionGroup, SettingsOptionRow } from "./SettingsOptionGroup";
7+
import { SettingsSectionHeader } from "./SettingsSectionHeader";
78

89
function KeyCombo({ shortcut }: { shortcut: KeyboardShortcut }) {
910
const keys = getPlatformKeys(shortcut);
@@ -32,14 +33,10 @@ export function KeyboardShortcutsCard() {
3233

3334
return (
3435
<section className="min-w-0" data-testid="settings-shortcuts">
35-
<div className="mb-12 min-w-0">
36-
<h2 className="text-2xl font-semibold tracking-tight">
37-
Keyboard Shortcuts
38-
</h2>
39-
<p className="mt-1 text-base font-normal text-muted-foreground">
40-
All available keyboard shortcuts. Shortcuts are read-only.
41-
</p>
42-
</div>
36+
<SettingsSectionHeader
37+
title="Keyboard Shortcuts"
38+
description="All available keyboard shortcuts. Shortcuts are read-only."
39+
/>
4340

4441
<div className="space-y-4">
4542
{[...categories.entries()].map(([category, shortcuts]) => (

0 commit comments

Comments
 (0)