diff --git a/scripts/regressions.mjs b/scripts/regressions.mjs index 7ad9d6b..bd1c478 100644 --- a/scripts/regressions.mjs +++ b/scripts/regressions.mjs @@ -828,7 +828,7 @@ try { await noOverflow(path) } await mobileContext.close() - console.log('PASS: mobile shell — drawer nav, bookmark cards, master-detail rails, scrollable settings tabs, no horizontal overflow on any screen') + console.log('PASS: mobile shell — drawer nav, bookmark cards, master-detail rails, grouped settings nav, no horizontal overflow on any screen') // Revocation failure path (review CR-02): when Go's revocation fails, the // local sign-out still completes, but the UI must say so — local cookie diff --git a/web/app/(app)/settings/client.tsx b/web/app/(app)/settings/client.tsx index 1e26981..9b66cb2 100644 --- a/web/app/(app)/settings/client.tsx +++ b/web/app/(app)/settings/client.tsx @@ -1,11 +1,11 @@ 'use client' -import { useState, useEffect, useCallback } from 'react' +import { useState, useEffect, useCallback, Fragment } from 'react' import { useSession } from 'next-auth/react' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs' -import { User, Mail, Server, Cloud, Shield, Bell, Sparkles, Bot, KeyRound, PlugZap, FolderSync, CalendarDays, BookUser, Check, X, AlertTriangle } from 'lucide-react' +import { User, Mail, Server, Cloud, Shield, Bell, Sparkles, Bot, KeyRound, PlugZap, FolderSync, CalendarDays, BookUser, ArrowLeft, Check, X, AlertTriangle } from 'lucide-react' import { toast } from 'sonner' import { invalidateReference } from '@/lib/reference-data' import { NotificationsSettings } from '@/components/notifications-settings' @@ -17,6 +17,36 @@ import { WebdavSettings } from '@/components/webdav-settings' import { CalDavSettings } from '@/components/caldav-settings' import { CardDavSettings } from '@/components/carddav-settings' import type { OidcStatus } from '@/lib/oidc-config' +import { cn } from '@/lib/utils' +import { useMediaQuery } from '@/lib/use-media-query' + + +// Settings are grouped by purpose, not a flat strip: account, the external +// services that feed your data, the assistant/automation surface, and +// machine/developer access. Each item keeps its Radix tab value so deep +// links and the browser suites' role="tab" locators are unchanged. +const NAV_GROUPS = [ + { label: 'Account', items: [ + { value: 'profile', label: 'Profile', icon: User }, + { value: 'oidc', label: 'Sign-in', icon: Shield }, + ] }, + { label: 'Connections', items: [ + { value: 'webdav', label: 'WebDAV', icon: FolderSync }, + { value: 'caldav', label: 'CalDAV', icon: CalendarDays }, + { value: 'carddav', label: 'CardDAV', icon: BookUser }, + { value: 'nextcloud', label: 'Contacts sync', icon: Cloud }, + { value: 'imap', label: 'IMAP', icon: Mail }, + ] }, + { label: 'AI & Automation', items: [ + { value: 'ai', label: 'AI', icon: Bot }, + { value: 'mcp', label: 'MCP', icon: PlugZap }, + { value: 'automations', label: 'Automations', icon: Sparkles }, + { value: 'notifications', label: 'Notifications', icon: Bell }, + ] }, + { label: 'Developer', items: [ + { value: 'api-keys', label: 'API Keys', icon: KeyRound }, + ] }, +] export function SettingsClient({ oidc, callbackUrl }: { oidc: OidcStatus; callbackUrl: string }) { const { data: session } = useSession() @@ -25,6 +55,12 @@ export function SettingsClient({ oidc, callbackUrl }: { oidc: OidcStatus; callba const [savingImap, setSavingImap] = useState(false) const [testingImap, setTestingImap] = useState(false) const [syncingContacts, setSyncingContacts] = useState(false) + const [section, setSection] = useState('profile') + // Below md the grouped nav becomes a list -> detail flow (same + // master-detail pattern as collections/tags/contacts); at md+ the + // nav and the selected panel sit side by side. + const isNarrow = useMediaQuery('(max-width: 767px)') + const [mobileDetail, setMobileDetail] = useState(false) useEffect(() => { fetch('/api/settings/imap').then(r => r.json()).then(data => { @@ -92,29 +128,49 @@ export function SettingsClient({ oidc, callbackUrl }: { oidc: OidcStatus; callba } return ( -
Configure your integrations and preferences
Authelia single sign-on, configured via environment variables (read-only)
+Redirect URI to register in Authelia
+{callbackUrl}
+Authelia single sign-on, configured via environment variables (read-only)
-Redirect URI to register in Authelia
-{callbackUrl}
-