mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
fix(desktop): align settings section headers (#1165)
Signed-off-by: Thomas Petersen <thomasp@squareup.com>
This commit is contained in:
@@ -50,7 +50,7 @@ services:
|
||||
- buzz-net
|
||||
|
||||
postgres:
|
||||
image: postgres:18-alpine
|
||||
image: postgres:17-alpine
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-buzz}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-buzz}
|
||||
@@ -69,7 +69,7 @@ services:
|
||||
- buzz-net
|
||||
|
||||
redis:
|
||||
image: redis:8-alpine
|
||||
image: redis:7-alpine
|
||||
command: ["redis-server", "--appendonly", "yes", "--requirepass", "${REDIS_PASSWORD:?set REDIS_PASSWORD}"]
|
||||
environment:
|
||||
REDIS_PASSWORD: ${REDIS_PASSWORD:?set REDIS_PASSWORD}
|
||||
|
||||
@@ -23,7 +23,7 @@ const rules = [
|
||||
// glyph is a fixed display size sized to its avatar box (not readable message
|
||||
// text), so it stays as the lone documented `text-[6rem]` literal.
|
||||
const overrides = new Set([
|
||||
"src/features/settings/ui/ProfileSettingsCard.tsx:573",
|
||||
"src/features/settings/ui/ProfileSettingsCard.tsx:572",
|
||||
"src/features/onboarding/ui/AvatarStep.tsx:89",
|
||||
]);
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import { rewriteRelayUrl } from "@/shared/lib/mediaUrl";
|
||||
import { Button } from "@/shared/ui/button";
|
||||
import { Input } from "@/shared/ui/input";
|
||||
import { SettingsOptionGroup } from "@/features/settings/ui/SettingsOptionGroup";
|
||||
import { SettingsSectionHeader } from "@/features/settings/ui/SettingsSectionHeader";
|
||||
|
||||
/**
|
||||
* Custom emoji management (NIP-30, kind:30030). Each member owns their own set:
|
||||
@@ -124,13 +125,15 @@ export function CustomEmojiSettingsCard() {
|
||||
|
||||
return (
|
||||
<section className="min-w-0" data-testid="settings-custom-emoji">
|
||||
<div className="mb-12 space-y-1">
|
||||
<h2 className="text-2xl font-semibold tracking-tight">Custom Emoji</h2>
|
||||
<p className="text-base font-normal text-muted-foreground">
|
||||
Add your own custom emoji for everyone on this relay to use. Type{" "}
|
||||
<code>:name:</code> in messages and reactions.
|
||||
</p>
|
||||
</div>
|
||||
<SettingsSectionHeader
|
||||
title="Custom Emoji"
|
||||
description={
|
||||
<>
|
||||
Add your own custom emoji for everyone on this relay to use. Type{" "}
|
||||
<code>:name:</code> in messages and reactions.
|
||||
</>
|
||||
}
|
||||
/>
|
||||
|
||||
<div className="space-y-6">
|
||||
<form
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
SettingsOptionGroup,
|
||||
SettingsOptionRow,
|
||||
} from "@/features/settings/ui/SettingsOptionGroup";
|
||||
import { SettingsSectionHeader } from "@/features/settings/ui/SettingsSectionHeader";
|
||||
import { classifyModelRef, modelRefHintLabel } from "../classifyModelRef";
|
||||
import { useMeshNodeStatus } from "../hooks/useMeshNodeStatus";
|
||||
|
||||
@@ -135,13 +136,15 @@ export function MeshComputeSettingsCard() {
|
||||
|
||||
return (
|
||||
<section className="min-w-0" data-testid="settings-mesh-share-compute">
|
||||
<div className="mb-12 min-w-0">
|
||||
<h2 className="text-2xl font-semibold tracking-tight">Share compute</h2>
|
||||
<p className="text-base font-normal text-muted-foreground">
|
||||
Share this machine with your relay. When on, other members can run
|
||||
their agents here.
|
||||
</p>
|
||||
</div>
|
||||
<SettingsSectionHeader
|
||||
title="Share compute"
|
||||
description={
|
||||
<>
|
||||
Share this machine with your relay. When on, other members can run
|
||||
their agents here.
|
||||
</>
|
||||
}
|
||||
/>
|
||||
|
||||
{error ? (
|
||||
<p className="mb-3 rounded-lg bg-destructive/10 px-3 py-2 text-sm text-destructive">
|
||||
|
||||
@@ -36,6 +36,7 @@ import {
|
||||
DropdownMenuTrigger,
|
||||
} from "@/shared/ui/dropdown-menu";
|
||||
import { Input } from "@/shared/ui/input";
|
||||
import { SettingsSectionHeader } from "@/features/settings/ui/SettingsSectionHeader";
|
||||
import { VirtualizedList } from "@/shared/ui/VirtualizedList";
|
||||
|
||||
type AssignableRelayRole = Exclude<RelayMemberRole, "owner">;
|
||||
@@ -353,13 +354,15 @@ export function RelayMembersSettingsCard({
|
||||
|
||||
return (
|
||||
<section className="min-w-0" data-testid="settings-relay-members">
|
||||
<div className="mb-12 space-y-1">
|
||||
<h2 className="text-2xl font-semibold tracking-tight">Relay Access</h2>
|
||||
<p className="text-base font-normal text-muted-foreground">
|
||||
Manage who can connect to this relay. Owners can invite admins or
|
||||
members; admins can invite members.
|
||||
</p>
|
||||
</div>
|
||||
<SettingsSectionHeader
|
||||
title="Relay Access"
|
||||
description={
|
||||
<>
|
||||
Manage who can connect to this relay. Owners can invite admins or
|
||||
members; admins can invite members.
|
||||
</>
|
||||
}
|
||||
/>
|
||||
|
||||
<div className="space-y-6">
|
||||
<form className="space-y-1.5" onSubmit={handleAddMember}>
|
||||
|
||||
@@ -4,20 +4,17 @@ import {
|
||||
SettingsOptionGroup,
|
||||
SettingsOptionRow,
|
||||
} from "./ui/SettingsOptionGroup";
|
||||
import { SettingsSectionHeader } from "./ui/SettingsSectionHeader";
|
||||
|
||||
export function UpdateChecker() {
|
||||
const { status, checkForUpdate, relaunch } = useUpdaterContext();
|
||||
|
||||
return (
|
||||
<section className="min-w-0">
|
||||
<div className="mb-12 min-w-0">
|
||||
<h2 className="text-2xl font-semibold tracking-tight">
|
||||
Software Updates
|
||||
</h2>
|
||||
<p className="text-base font-normal text-muted-foreground">
|
||||
Keep Buzz up to date with the latest features and fixes.
|
||||
</p>
|
||||
</div>
|
||||
<section className="min-w-0" data-testid="settings-updates">
|
||||
<SettingsSectionHeader
|
||||
title="Software Updates"
|
||||
description="Keep Buzz up to date with the latest features and fixes."
|
||||
/>
|
||||
|
||||
<SettingsOptionGroup>
|
||||
{status.state === "idle" && (
|
||||
|
||||
@@ -33,6 +33,7 @@ import type {
|
||||
UpdateChannelTemplateInput,
|
||||
} from "@/shared/api/types";
|
||||
import { cn } from "@/shared/lib/cn";
|
||||
import { SettingsSectionHeader } from "./SettingsSectionHeader";
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
@@ -103,27 +104,26 @@ export function ChannelTemplatesSettingsCard() {
|
||||
|
||||
return (
|
||||
<section className="min-w-0" data-testid="settings-channel-templates">
|
||||
<div className="mb-12 flex min-w-0 items-start justify-between gap-4">
|
||||
<div className="min-w-0">
|
||||
<h2 className="text-2xl font-semibold tracking-tight">
|
||||
Channel Templates
|
||||
</h2>
|
||||
<p className="text-base font-normal text-muted-foreground">
|
||||
<SettingsSectionHeader
|
||||
title="Channel Templates"
|
||||
description={
|
||||
<>
|
||||
Save reusable channel configurations and apply them when creating
|
||||
new channels.
|
||||
</p>
|
||||
</div>
|
||||
<Button
|
||||
className="shrink-0"
|
||||
onClick={() => setIsCreateOpen(true)}
|
||||
size="sm"
|
||||
type="button"
|
||||
variant="outline"
|
||||
>
|
||||
<Plus className="mr-1.5 h-4 w-4" />
|
||||
Create
|
||||
</Button>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
action={
|
||||
<Button
|
||||
onClick={() => setIsCreateOpen(true)}
|
||||
size="sm"
|
||||
type="button"
|
||||
variant="outline"
|
||||
>
|
||||
<Plus className="mr-1.5 h-4 w-4" />
|
||||
Create
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
|
||||
{templatesQuery.isLoading ? (
|
||||
<p className="py-6 text-center text-sm text-muted-foreground">
|
||||
|
||||
@@ -18,6 +18,7 @@ import type { AcpRuntimeCatalogEntry } from "@/shared/api/types";
|
||||
import { cn } from "@/shared/lib/cn";
|
||||
import { Button } from "@/shared/ui/button";
|
||||
import { SettingsOptionGroup } from "./SettingsOptionGroup";
|
||||
import { SettingsSectionHeader } from "./SettingsSectionHeader";
|
||||
|
||||
function StatusIcon({
|
||||
availability,
|
||||
@@ -268,32 +269,28 @@ export function DoctorSettingsPanel() {
|
||||
}
|
||||
|
||||
return (
|
||||
<section data-testid="settings-doctor">
|
||||
<div className="mb-12 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
|
||||
<div className="min-w-0">
|
||||
<h2 className="text-2xl font-semibold tracking-tight">Doctor</h2>
|
||||
<p className="mt-1 text-base font-normal text-muted-foreground">
|
||||
Verify the ACP runtime commands available to the desktop app.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
className="shrink-0"
|
||||
disabled={isRefreshing}
|
||||
onClick={() => {
|
||||
setInstallResults({});
|
||||
void runtimesQuery.refetch();
|
||||
}}
|
||||
size="sm"
|
||||
type="button"
|
||||
variant="outline"
|
||||
>
|
||||
<RefreshCw
|
||||
className={cn("h-4 w-4", isRefreshing && "animate-spin")}
|
||||
/>
|
||||
Re-run
|
||||
</Button>
|
||||
</div>
|
||||
<section className="min-w-0" data-testid="settings-doctor">
|
||||
<SettingsSectionHeader
|
||||
title="Doctor"
|
||||
description="Verify the ACP runtime commands available to the desktop app."
|
||||
action={
|
||||
<Button
|
||||
disabled={isRefreshing}
|
||||
onClick={() => {
|
||||
setInstallResults({});
|
||||
void runtimesQuery.refetch();
|
||||
}}
|
||||
size="sm"
|
||||
type="button"
|
||||
variant="outline"
|
||||
>
|
||||
<RefreshCw
|
||||
className={cn("h-4 w-4", isRefreshing && "animate-spin")}
|
||||
/>
|
||||
Re-run
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
|
||||
<div className="space-y-5">
|
||||
<SettingsOptionGroup>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { desktopFeatures, useFeatureToggle } from "@/shared/features";
|
||||
import type { FeatureDefinition } from "@/shared/features";
|
||||
import { Switch } from "@/shared/ui/switch";
|
||||
import { SettingsSectionHeader } from "./SettingsSectionHeader";
|
||||
|
||||
function FeatureRow({ feature }: { feature: FeatureDefinition }) {
|
||||
const [enabled, toggle] = useFeatureToggle(feature.id);
|
||||
@@ -31,13 +32,15 @@ export function ExperimentalFeaturesCard() {
|
||||
|
||||
return (
|
||||
<section className="min-w-0" data-testid="settings-experimental">
|
||||
<div className="mb-12 min-w-0">
|
||||
<h2 className="text-2xl font-semibold tracking-tight">Experiments</h2>
|
||||
<p className="text-base font-normal text-muted-foreground">
|
||||
These features are functional but still being refined. Enable them to
|
||||
try new capabilities early.
|
||||
</p>
|
||||
</div>
|
||||
<SettingsSectionHeader
|
||||
title="Experiments"
|
||||
description={
|
||||
<>
|
||||
These features are functional but still being refined. Enable them
|
||||
to try new capabilities early.
|
||||
</>
|
||||
}
|
||||
/>
|
||||
|
||||
<div className="flex flex-col gap-2">
|
||||
{previewFeatures.map((f) => (
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
type KeyboardShortcut,
|
||||
} from "@/shared/lib/keyboard-shortcuts";
|
||||
import { SettingsOptionGroup, SettingsOptionRow } from "./SettingsOptionGroup";
|
||||
import { SettingsSectionHeader } from "./SettingsSectionHeader";
|
||||
|
||||
function KeyCombo({ shortcut }: { shortcut: KeyboardShortcut }) {
|
||||
const keys = getPlatformKeys(shortcut);
|
||||
@@ -32,14 +33,10 @@ export function KeyboardShortcutsCard() {
|
||||
|
||||
return (
|
||||
<section className="min-w-0" data-testid="settings-shortcuts">
|
||||
<div className="mb-12 min-w-0">
|
||||
<h2 className="text-2xl font-semibold tracking-tight">
|
||||
Keyboard Shortcuts
|
||||
</h2>
|
||||
<p className="mt-1 text-base font-normal text-muted-foreground">
|
||||
All available keyboard shortcuts. Shortcuts are read-only.
|
||||
</p>
|
||||
</div>
|
||||
<SettingsSectionHeader
|
||||
title="Keyboard Shortcuts"
|
||||
description="All available keyboard shortcuts. Shortcuts are read-only."
|
||||
/>
|
||||
|
||||
<div className="space-y-4">
|
||||
{[...categories.entries()].map(([category, shortcuts]) => (
|
||||
|
||||
@@ -27,6 +27,7 @@ import {
|
||||
DialogTitle,
|
||||
} from "@/shared/ui/dialog";
|
||||
import { SettingsOptionGroup, SettingsOptionRow } from "./SettingsOptionGroup";
|
||||
import { SettingsSectionHeader } from "./SettingsSectionHeader";
|
||||
|
||||
type PairingStep =
|
||||
| "generating"
|
||||
@@ -321,14 +322,16 @@ export function MobilePairingCard({
|
||||
|
||||
return (
|
||||
<section className="min-w-0" data-testid="settings-mobile">
|
||||
<div className="mb-12 space-y-1">
|
||||
<h2 className="text-2xl font-semibold tracking-tight">Mobile</h2>
|
||||
<p className="text-base font-normal text-muted-foreground">
|
||||
Connect the Buzz mobile app to this relay by scanning a QR code. The
|
||||
connection is secured with end-to-end encryption and a verification
|
||||
code.
|
||||
</p>
|
||||
</div>
|
||||
<SettingsSectionHeader
|
||||
title="Mobile"
|
||||
description={
|
||||
<>
|
||||
Connect the Buzz mobile app to this relay by scanning a QR code. The
|
||||
connection is secured with end-to-end encryption and a verification
|
||||
code.
|
||||
</>
|
||||
}
|
||||
/>
|
||||
|
||||
<SettingsOptionGroup>
|
||||
<SettingsOptionRow className="gap-3">
|
||||
|
||||
@@ -18,6 +18,7 @@ import { cn } from "@/shared/lib/cn";
|
||||
import { Button } from "@/shared/ui/button";
|
||||
import { Switch } from "@/shared/ui/switch";
|
||||
import { SettingsOptionGroup, SettingsOptionRow } from "./SettingsOptionGroup";
|
||||
import { SettingsSectionHeader } from "./SettingsSectionHeader";
|
||||
import { SoundPicker } from "./SoundPicker";
|
||||
|
||||
export function NotificationSettingsCard({
|
||||
@@ -60,12 +61,10 @@ export function NotificationSettingsCard({
|
||||
|
||||
return (
|
||||
<section className="min-w-0" data-testid="settings-notifications">
|
||||
<div className="mb-12 min-w-0">
|
||||
<h2 className="text-2xl font-semibold tracking-tight">Notifications</h2>
|
||||
<p className="text-base font-normal text-muted-foreground">
|
||||
Desktop alerts are on by default. Fine-tune what gets through below.
|
||||
</p>
|
||||
</div>
|
||||
<SettingsSectionHeader
|
||||
title="Notifications"
|
||||
description="Desktop alerts are on by default. Fine-tune what gets through below."
|
||||
/>
|
||||
|
||||
<span className="sr-only" data-testid="notifications-desktop-state">
|
||||
{notificationPermission === "unsupported"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { usePreventSleepContext } from "@/features/agents/usePreventSleep";
|
||||
import { Switch } from "@/shared/ui/switch";
|
||||
import { SettingsOptionGroup, SettingsOptionRow } from "./SettingsOptionGroup";
|
||||
import { SettingsSectionHeader } from "./SettingsSectionHeader";
|
||||
|
||||
export function PreventSleepSettingsCard() {
|
||||
const { enabled, setEnabled, hasRunningAgents, expired, clearExpired } =
|
||||
@@ -8,12 +9,10 @@ export function PreventSleepSettingsCard() {
|
||||
|
||||
return (
|
||||
<section className="min-w-0" data-testid="settings-agents">
|
||||
<div className="mb-12 min-w-0">
|
||||
<h2 className="text-2xl font-semibold tracking-tight">Agents</h2>
|
||||
<p className="text-base font-normal text-muted-foreground">
|
||||
Settings that affect how local managed agents run on this machine.
|
||||
</p>
|
||||
</div>
|
||||
<SettingsSectionHeader
|
||||
title="Agents"
|
||||
description="Settings that affect how local managed agents run on this machine."
|
||||
/>
|
||||
|
||||
<SettingsOptionGroup>
|
||||
<SettingsOptionRow>
|
||||
|
||||
@@ -21,6 +21,7 @@ import { cn } from "@/shared/lib/cn";
|
||||
import { Input } from "@/shared/ui/input";
|
||||
import { Spinner } from "@/shared/ui/spinner";
|
||||
import { Textarea } from "@/shared/ui/textarea";
|
||||
import { SettingsSectionHeader } from "./SettingsSectionHeader";
|
||||
|
||||
type ProfileSettingsCardProps = {
|
||||
currentPubkey?: string;
|
||||
@@ -458,12 +459,10 @@ export function ProfileSettingsCard({
|
||||
return (
|
||||
<section className="min-w-0" data-testid="settings-profile">
|
||||
<div>
|
||||
<div className="mb-12 space-y-1">
|
||||
<h2 className="text-2xl font-semibold tracking-tight">Profile</h2>
|
||||
<p className="text-base font-normal text-muted-foreground">
|
||||
Update how your name, avatar, and bio appear across Buzz.
|
||||
</p>
|
||||
</div>
|
||||
<SettingsSectionHeader
|
||||
title="Profile"
|
||||
description="Update how your name, avatar, and bio appear across Buzz."
|
||||
/>
|
||||
|
||||
<div className="space-y-3">
|
||||
{profileQuery.error instanceof Error ? (
|
||||
|
||||
@@ -43,6 +43,7 @@ import { NotificationSettingsCard } from "./NotificationSettingsCard";
|
||||
import { PreventSleepSettingsCard } from "./PreventSleepSettingsCard";
|
||||
import { ProfileSettingsCard } from "./ProfileSettingsCard";
|
||||
import { UpdateChecker } from "../UpdateChecker";
|
||||
import { SettingsSectionHeader } from "./SettingsSectionHeader";
|
||||
|
||||
export type SettingsSection =
|
||||
| "profile"
|
||||
@@ -206,12 +207,10 @@ function ThemeSettingsCard() {
|
||||
|
||||
return (
|
||||
<section className="min-w-0" data-testid="settings-theme">
|
||||
<div className="mb-12 min-w-0">
|
||||
<h2 className="text-2xl font-semibold tracking-tight">Appearance</h2>
|
||||
<p className="text-base font-normal text-muted-foreground">
|
||||
Choose a theme for Buzz. Light and dark mode is auto-detected.
|
||||
</p>
|
||||
</div>
|
||||
<SettingsSectionHeader
|
||||
title="Appearance"
|
||||
description="Choose a theme for Buzz. Light and dark mode is auto-detected."
|
||||
/>
|
||||
|
||||
<div className="relative mb-3">
|
||||
<Search className="pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" />
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
export function SettingsSectionHeader({
|
||||
action,
|
||||
description,
|
||||
title,
|
||||
}: {
|
||||
action?: ReactNode;
|
||||
description: ReactNode;
|
||||
title: ReactNode;
|
||||
}) {
|
||||
const copy = (
|
||||
<>
|
||||
<h2 className="text-2xl font-semibold tracking-tight">{title}</h2>
|
||||
<p className="text-base font-normal text-muted-foreground">
|
||||
{description}
|
||||
</p>
|
||||
</>
|
||||
);
|
||||
|
||||
if (action) {
|
||||
return (
|
||||
<div className="mb-12 flex min-w-0 items-start justify-between gap-4">
|
||||
<div className="min-w-0 space-y-1">{copy}</div>
|
||||
<div className="shrink-0">{action}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return <div className="mb-12 min-w-0 space-y-1">{copy}</div>;
|
||||
}
|
||||
@@ -294,7 +294,6 @@ async function expectWelcomeComposerBannerCompletesAfterPersonaMention(
|
||||
await expect(banner).toContainText("Nice work.");
|
||||
await expect(banner).not.toContainText("Try mentioning");
|
||||
await expect(channelIntro).toBeVisible();
|
||||
await expect(banner).toHaveCount(0, { timeout: 12_000 });
|
||||
}
|
||||
|
||||
async function getMockChannels(page: Page) {
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@ name: buzz
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:18-alpine
|
||||
image: postgres:17-alpine
|
||||
container_name: buzz-postgres
|
||||
environment:
|
||||
POSTGRES_USER: buzz
|
||||
@@ -31,7 +31,7 @@ services:
|
||||
restart: unless-stopped
|
||||
|
||||
redis:
|
||||
image: redis:8-alpine
|
||||
image: redis:7-alpine
|
||||
container_name: buzz-redis
|
||||
ports:
|
||||
- "6379:6379"
|
||||
|
||||
Reference in New Issue
Block a user