Compare commits

..
4 Commits
Author SHA1 Message Date
Andrew S Erwin e3d765e97b release 0.2.15: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 6m55s
release / smoke (push) Successful in 10m30s
release / publish (push) Failing after 9m49s
2026-11-17 11:08:33 -06:00
Andrew S Erwin 78231502f1 CHANGELOG: 0.2.15 grouped settings navigation entry 2026-11-17 11:08:33 -06:00
Andrew S Erwin 212d587f97 Settings: grouped vertical navigation replaces the overflowing flat tab strip
The 12 settings sat in a flat horizontal tab strip inside a narrow max-w-2xl
container, so roughly half (MCP, WebDAV, CalDAV, CardDAV, OIDC) hid behind a
horizontal scrollbar on desktop AND mobile, with no logical grouping.

Replaced with a grouped vertical settings nav:
- Account: Profile, Sign-in
- Connections: WebDAV, CalDAV, CardDAV, Contacts sync, IMAP
- AI & Automation: AI, MCP, Automations, Notifications
- Developer: API Keys

Desktop shows the nav beside the content pane (page widened to max-w-5xl);
below md it becomes a list -> detail flow with an "All settings" back button,
the same master-detail pattern as collections/tags/contacts. Built on Radix
Tabs with orientation="vertical" and controlled value, so role="tab"
locators, deep links and keyboard navigation are preserved; group headers
are non-focusable fragments inside the list.

Clarified two jargon labels: OIDC -> "Sign-in" (content header "Sign-in
(OIDC)") and Nextcloud -> "Contacts sync" (header "Contacts sync
(Nextcloud)"), distinguishing the legacy contact import from the CardDAV
collection connector. All 12 content panels preserved verbatim.

Verified: regressions 20/20 (incl. the three DAV settings walkthroughs and
the mobile settings test, now exercising the grouped nav), real-stack e2e
all pass, lint/SSR-lint/build 0 errors; before/after screenshots at 1280px
and 390px confirm the full grouped nav and the mobile master-detail flow.
2026-11-17 11:08:10 -06:00
Andrew S Erwin ceb4973359 Reset version scheme to 0.x (pre-beta); release 0.2.14
release gate / check (push) Failing after 6m46s
release / smoke (push) Successful in 10m40s
release / publish (push) Failing after 9m59s
Superbrain is not yet beta, so the release line moves from 1.2.x to 0.2.x.
0.2.14 is the same code as 1.2.14 (the Nextcloud DAV connection fix) under
the new number; future releases continue from 0.2.15. Existing 1.2.x tags
and images stay published and untouched; CHANGELOG keeps the 1.2.x entries
as history and notes the reset.

Bumps in lockstep: federated service VERSION, installer
SUPERBRAIN_IMAGE_VERSION, superbrain-mcp package version (pyproject +
__init__). Also fixes the outbound MCP client implementation string, which
still reported a stale hardcoded 1.2.7, to the release version. README
release examples updated to the new scheme.

The house upgrade flow compares version tags by string equality, so the
1.2.14 -> 0.2.14 transition deploys through the standard update.sh path
(no downgrade special-casing needed).
2026-11-16 21:51:02 -06:00
9 changed files with 184 additions and 111 deletions
+27 -1
View File
@@ -3,9 +3,35 @@
Versions correspond to git tags and to the published image set Versions correspond to git tags and to the published image set
(`federatedcomputer/superbrain-{app,web,migrate}` on Docker Hub); the (`federatedcomputer/superbrain-{app,web,migrate}` on Docker Hub); the
`superbrain-mcp` Python package and the federated suite files `superbrain-mcp` Python package and the federated suite files
(`service` VERSION, installer image version) move in lockstep from 1.2.0 on. (`service` VERSION, installer image version) move in lockstep from 1.2.0 on
(the line was reset to 0.2.x at 0.2.14 — Superbrain is pre-beta).
Dates are tag dates. Dates are tag dates.
## 0.2.15 — 2026-11-17
### Changed
- **Settings are now grouped and fully visible.** The flat tab strip (which
hid half the options behind a horizontal scrollbar, on desktop and mobile)
is replaced by a grouped navigation: **Account** (Profile, Sign-in),
**Connections** (WebDAV, CalDAV, CardDAV, Contacts sync, IMAP),
**AI & Automation** (AI, MCP, Automations, Notifications) and
**Developer** (API Keys). On desktop the menu sits beside the settings
panel; on phones it's a list that opens into the selected panel with a
back button. Two labels were clarified: "OIDC" is now **Sign-in**, and the
Nextcloud contact import is now **Contacts sync** (distinct from the
CardDAV connector).
## 0.2.14 — 2026-11-17
### Changed
- **Version scheme reset to 0.x**: Superbrain is not yet beta, so releases
move from the 1.2.x line to 0.2.x. This release is the same code as
1.2.14 (the Nextcloud DAV connection fix) under the new number; future
releases continue from 0.2.15. Existing 1.2.x tags and images stay
published and untouched, and the 1.2.x entries below are kept as history.
The outbound MCP client also now reports the real release version instead
of a stale hardcoded one.
## 1.2.14 — 2026-11-17 ## 1.2.14 — 2026-11-17
### Fixed ### Fixed
+6 -6
View File
@@ -359,7 +359,7 @@ sudo bash -c "$(docker run --rm --pull always federatedcomputer/superbrain-migra
No clone and nothing to copy: the installer and the suite integration files No clone and nothing to copy: the installer and the suite integration files
ship inside the migrate image at `/deploy`. Pin a release with ship inside the migrate image at `/deploy`. Pin a release with
`SUPERBRAIN_VERSION=1.2.3` (default `latest`), or use a local checkout's `SUPERBRAIN_VERSION=0.2.14` (default `latest`), or use a local checkout's
files instead with `SUPERBRAIN_SRC=/path/to/repo`. files instead with `SUPERBRAIN_SRC=/path/to/repo`.
The installer: The installer:
@@ -456,12 +456,12 @@ Then releasing is:
```bash ```bash
git checkout main && git pull git checkout main && git pull
git tag -a 1.2.3 -m "release 1.2.3" git tag -a 0.2.14 -m "release 0.2.14"
git push origin 1.2.3 git push origin 0.2.14
``` ```
Watch the run under the repo's Actions tab; verify with Watch the run under the repo's Actions tab; verify with
`docker manifest inspect federatedcomputer/superbrain-app:1.2.3`. `docker manifest inspect federatedcomputer/superbrain-app:0.2.14`.
### Option B — manual build & push (no runner required) ### Option B — manual build & push (no runner required)
@@ -469,7 +469,7 @@ From any Linux machine with Docker, buildx and login rights:
```bash ```bash
git clone https://gitea.federated.computer/Federated_Computer/brain.git git clone https://gitea.federated.computer/Federated_Computer/brain.git
cd brain && git checkout 1.2.3 # always build from the tag cd brain && git checkout 0.2.14 # always build from the tag
# One-time per machine: buildx builder + cross-arch emulation # One-time per machine: buildx builder + cross-arch emulation
docker buildx create --use --name multiarch docker buildx create --use --name multiarch
@@ -486,7 +486,7 @@ docker run --rm --link sb-smoke-pg -e DB_HOST=sb-smoke-pg -e PGPASSWORD=x sb-mig
docker rm -f sb-smoke-pg docker rm -f sb-smoke-pg
# Build + push all three (each command pushes <version> and latest): # Build + push all three (each command pushes <version> and latest):
V=1.2.3 V=0.2.14
docker buildx build --platform linux/amd64,linux/arm64 --push \ docker buildx build --platform linux/amd64,linux/arm64 --push \
-t federatedcomputer/superbrain-app:$V -t federatedcomputer/superbrain-app:latest . -t federatedcomputer/superbrain-app:$V -t federatedcomputer/superbrain-app:latest .
docker buildx build --platform linux/amd64,linux/arm64 --push \ docker buildx build --platform linux/amd64,linux/arm64 --push \
+1 -1
View File
@@ -48,7 +48,7 @@ SUPERBRAIN_APP_IP="192.168.0.94"
SUPERBRAIN_MIGRATE_IP="192.168.0.95" SUPERBRAIN_MIGRATE_IP="192.168.0.95"
# Release to install; the generic `upgrade` flow keeps .env in step with the # Release to install; the generic `upgrade` flow keeps .env in step with the
# service file's VERSION afterwards. # service file's VERSION afterwards.
SUPERBRAIN_IMAGE_VERSION="1.2.14" SUPERBRAIN_IMAGE_VERSION="0.2.15"
# render_superbrain_compose writes the app-dir compose file. Called by # render_superbrain_compose writes the app-dir compose file. Called by
# config_superbrain (install) and by deploy/federated/update.sh after a lib # config_superbrain (install) and by deploy/federated/update.sh after a lib
+1 -1
View File
@@ -2,7 +2,7 @@ NAME=superbrain
DESCRIPTION="Bookmark & Knowledge Base" DESCRIPTION="Bookmark & Knowledge Base"
DOCS=https://github.com/andrew/superbrain DOCS=https://github.com/andrew/superbrain
CONTAINER=federatedcomputer/superbrain-app CONTAINER=federatedcomputer/superbrain-app
VERSION=1.2.14 VERSION=0.2.15
INTERNAL_IP=192.168.0.93 INTERNAL_IP=192.168.0.93
DEPENDS="postgresql" DEPENDS="postgresql"
PORTS=3000 PORTS=3000
+1 -1
View File
@@ -91,7 +91,7 @@ func httpClient(conn Conn) *http.Client {
// ListTools connects, initializes and lists the server's tools, then closes // ListTools connects, initializes and lists the server's tools, then closes
// the session. The context bounds the whole exchange. // the session. The context bounds the whole exchange.
func ListTools(ctx context.Context, conn Conn) ([]Tool, error) { func ListTools(ctx context.Context, conn Conn) ([]Tool, error) {
client := mcpsdk.NewClient(&mcpsdk.Implementation{Name: "superbrain", Version: "1.2.7"}, nil) client := mcpsdk.NewClient(&mcpsdk.Implementation{Name: "superbrain", Version: "0.2.15"}, nil)
var transport mcpsdk.Transport var transport mcpsdk.Transport
hc := httpClient(conn) hc := httpClient(conn)
switch conn.Transport { switch conn.Transport {
+1 -1
View File
@@ -7,7 +7,7 @@ name = "superbrain-mcp"
# Versioned in lockstep with the Superbrain release it speaks to (house # Versioned in lockstep with the Superbrain release it speaks to (house
# tooling tracks one version per app); the federated mcpserver gateway # tooling tracks one version per app); the federated mcpserver gateway
# installs this package and spawns `superbrain-mcp` per linked instance. # installs this package and spawns `superbrain-mcp` per linked instance.
version = "1.2.14" version = "0.2.15"
description = "MCP server for Superbrain — bookmarks, tags and pages over the Superbrain REST API" description = "MCP server for Superbrain — bookmarks, tags and pages over the Superbrain REST API"
readme = "README.md" readme = "README.md"
requires-python = ">=3.10" requires-python = ">=3.10"
+1 -1
View File
@@ -1,3 +1,3 @@
"""Superbrain MCP server — bookmarks, tags and pages for AI tooling.""" """Superbrain MCP server — bookmarks, tags and pages for AI tooling."""
__version__ = "1.2.14" __version__ = "0.2.15"
+1 -1
View File
@@ -828,7 +828,7 @@ try {
await noOverflow(path) await noOverflow(path)
} }
await mobileContext.close() 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 // 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 // local sign-out still completes, but the UI must say so — local cookie
+145 -98
View File
@@ -1,11 +1,11 @@
'use client' 'use client'
import { useState, useEffect, useCallback } from 'react' import { useState, useEffect, useCallback, Fragment } from 'react'
import { useSession } from 'next-auth/react' import { useSession } from 'next-auth/react'
import { Button } from '@/components/ui/button' import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input' import { Input } from '@/components/ui/input'
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs' 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 { toast } from 'sonner'
import { invalidateReference } from '@/lib/reference-data' import { invalidateReference } from '@/lib/reference-data'
import { NotificationsSettings } from '@/components/notifications-settings' import { NotificationsSettings } from '@/components/notifications-settings'
@@ -17,6 +17,36 @@ import { WebdavSettings } from '@/components/webdav-settings'
import { CalDavSettings } from '@/components/caldav-settings' import { CalDavSettings } from '@/components/caldav-settings'
import { CardDavSettings } from '@/components/carddav-settings' import { CardDavSettings } from '@/components/carddav-settings'
import type { OidcStatus } from '@/lib/oidc-config' 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 }) { export function SettingsClient({ oidc, callbackUrl }: { oidc: OidcStatus; callbackUrl: string }) {
const { data: session } = useSession() const { data: session } = useSession()
@@ -25,6 +55,12 @@ export function SettingsClient({ oidc, callbackUrl }: { oidc: OidcStatus; callba
const [savingImap, setSavingImap] = useState(false) const [savingImap, setSavingImap] = useState(false)
const [testingImap, setTestingImap] = useState(false) const [testingImap, setTestingImap] = useState(false)
const [syncingContacts, setSyncingContacts] = 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(() => { useEffect(() => {
fetch('/api/settings/imap').then(r => r.json()).then(data => { fetch('/api/settings/imap').then(r => r.json()).then(data => {
@@ -92,29 +128,49 @@ export function SettingsClient({ oidc, callbackUrl }: { oidc: OidcStatus; callba
} }
return ( return (
<div className="max-w-2xl space-y-6"> <div className="max-w-5xl space-y-6">
<div> <div>
<h1 className="font-display text-2xl font-bold tracking-tight">Settings</h1> <h1 className="font-display text-2xl font-bold tracking-tight">Settings</h1>
<p className="text-sm text-muted-foreground mt-1">Configure your integrations and preferences</p> <p className="text-sm text-muted-foreground mt-1">Configure your integrations and preferences</p>
</div> </div>
<Tabs defaultValue="profile" className="w-full"> <Tabs
<TabsList className="w-full justify-start overflow-x-auto flex-nowrap"> value={section}
<TabsTrigger value="profile" className="gap-1.5"><User className="h-3.5 w-3.5" /> Profile</TabsTrigger> onValueChange={(v) => { setSection(v); if (isNarrow) setMobileDetail(true) }}
<TabsTrigger value="imap" className="gap-1.5"><Mail className="h-3.5 w-3.5" /> IMAP</TabsTrigger> orientation="vertical"
<TabsTrigger value="nextcloud" className="gap-1.5"><Cloud className="h-3.5 w-3.5" /> Nextcloud</TabsTrigger> className="w-full"
<TabsTrigger value="notifications" className="gap-1.5"><Bell className="h-3.5 w-3.5" /> Notifications</TabsTrigger> >
<TabsTrigger value="automations" className="gap-1.5"><Sparkles className="h-3.5 w-3.5" /> Automations</TabsTrigger> <div className="flex flex-col gap-6 md:flex-row md:gap-8">
<TabsTrigger value="ai" className="gap-1.5"><Bot className="h-3.5 w-3.5" /> AI</TabsTrigger> <TabsList
<TabsTrigger value="api-keys" className="gap-1.5"><KeyRound className="h-3.5 w-3.5" /> API Keys</TabsTrigger> aria-label="Settings sections"
<TabsTrigger value="mcp" className="gap-1.5"><PlugZap className="h-3.5 w-3.5" /> MCP</TabsTrigger> className={cn(
<TabsTrigger value="webdav" className="gap-1.5"><FolderSync className="h-3.5 w-3.5" /> WebDAV</TabsTrigger> 'flex h-auto w-full flex-col items-stretch justify-start gap-0.5 rounded-lg border bg-card/50 p-2 md:w-56 md:shrink-0',
<TabsTrigger value="caldav" className="gap-1.5"><CalendarDays className="h-3.5 w-3.5" /> CalDAV</TabsTrigger> isNarrow && mobileDetail && 'hidden'
<TabsTrigger value="carddav" className="gap-1.5"><BookUser className="h-3.5 w-3.5" /> CardDAV</TabsTrigger> )}
<TabsTrigger value="oidc" className="gap-1.5"><Shield className="h-3.5 w-3.5" /> OIDC</TabsTrigger> >
</TabsList> {NAV_GROUPS.map((g) => (
<Fragment key={g.label}>
<div className="px-3 pb-1 pt-3 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground first:pt-1">{g.label}</div>
{g.items.map((it) => (
<TabsTrigger
key={it.value}
value={it.value}
className="w-full justify-start gap-2 rounded-md px-3 py-2 data-[state=active]:bg-accent data-[state=active]:text-accent-foreground data-[state=active]:shadow-none"
>
<it.icon className="h-3.5 w-3.5 shrink-0" /> {it.label}
</TabsTrigger>
))}
</Fragment>
))}
</TabsList>
<TabsContent value="profile" className="space-y-4 mt-4"> <div className={cn('min-w-0 flex-1', isNarrow && !mobileDetail && 'hidden')}>
{isNarrow && mobileDetail && (
<Button variant="ghost" size="sm" className="mb-3 -ml-2 gap-1 text-muted-foreground" onClick={() => setMobileDetail(false)}>
<ArrowLeft className="h-4 w-4" /> All settings
</Button>
)}
<TabsContent value="profile" className="mt-0 space-y-4">
<div className="flex items-center gap-4"> <div className="flex items-center gap-4">
<div className="h-16 w-16 rounded-full bg-primary/20 flex items-center justify-center text-2xl font-bold text-primary"> <div className="h-16 w-16 rounded-full bg-primary/20 flex items-center justify-center text-2xl font-bold text-primary">
{(session?.user?.name ?? session?.user?.email ?? '?')[0]?.toUpperCase()} {(session?.user?.name ?? session?.user?.email ?? '?')[0]?.toUpperCase()}
@@ -125,8 +181,67 @@ export function SettingsClient({ oidc, callbackUrl }: { oidc: OidcStatus; callba
</div> </div>
</div> </div>
</TabsContent> </TabsContent>
<TabsContent value="oidc" className="mt-0 space-y-4">
<TabsContent value="imap" className="space-y-4 mt-4"> <div className="rounded-lg border p-4 space-y-3">
<h3 className="font-medium flex items-center gap-2"><Shield className="h-4 w-4" /> Sign-in (OIDC)</h3>
<p className="text-sm text-muted-foreground">Authelia single sign-on, configured via environment variables (read-only)</p>
<div className={`flex items-start gap-2 rounded-md p-3 text-sm ${oidc.enabled ? 'bg-green-500/10 text-green-700 dark:text-green-400' : 'bg-amber-500/10 text-amber-800 dark:text-amber-300'}`}>
{oidc.enabled ? <Check className="h-4 w-4 mt-0.5 shrink-0" /> : <AlertTriangle className="h-4 w-4 mt-0.5 shrink-0" />}
<span>
{oidc.enabled
? <>Configured for <span className="font-mono break-all">{oidc.issuer}</span>. Authelia sign-in is enabled.</>
: <>Not connected. Authelia sign-in is disabled until all three variables below hold real values. Users can sign in with email and password meanwhile. Setup guide: <span className="font-mono">docs/AUTHELIA.md</span></>}
</span>
</div>
<div className="space-y-2">
{([['OIDC_ISSUER', oidc.issuerSet], ['OIDC_CLIENT_ID', oidc.clientIdSet], ['OIDC_CLIENT_SECRET', oidc.clientSecretSet]] as const).map(([name, set]) => (
<div key={name} className="flex items-center gap-2">
<span className="text-xs font-mono bg-muted px-2 py-1 rounded">{name}</span>
<span className="text-sm text-muted-foreground">{set ? 'Set' : 'Not set'}</span>
{set ? <Check className="h-4 w-4 text-green-500" /> : <X className="h-4 w-4 text-muted-foreground" />}
</div>
))}
</div>
<div className="space-y-1 pt-2 border-t">
<p className="text-xs font-medium text-muted-foreground">Redirect URI to register in Authelia</p>
<p className="text-xs font-mono bg-muted px-2 py-1.5 rounded break-all" suppressHydrationWarning>{callbackUrl}</p>
</div>
</div>
</TabsContent>
<TabsContent value="webdav" className="mt-0 space-y-4">
<WebdavSettings />
</TabsContent>
<TabsContent value="caldav" className="mt-0 space-y-4">
<CalDavSettings />
</TabsContent>
<TabsContent value="carddav" className="mt-0 space-y-4">
<CardDavSettings />
</TabsContent>
<TabsContent value="nextcloud" className="mt-0 space-y-4">
<div className="rounded-lg border p-4 space-y-3">
<h3 className="font-medium flex items-center gap-2"><Cloud className="h-4 w-4" /> Contacts sync (Nextcloud)</h3>
<div className="grid grid-cols-2 gap-3">
<div className="col-span-2">
<label className="text-xs font-medium text-muted-foreground">Nextcloud URL</label>
<Input value={ncConfig.nextcloudUrl} onChange={(e: React.ChangeEvent<HTMLInputElement>) => setNcConfig(p => ({ ...p, nextcloudUrl: e.target.value }))} placeholder="https://nextcloud.example.com" />
</div>
<div className="col-span-2">
<label className="text-xs font-medium text-muted-foreground">CardDAV Path (optional)</label>
<Input value={ncConfig.cardDavPath} onChange={(e: React.ChangeEvent<HTMLInputElement>) => setNcConfig(p => ({ ...p, cardDavPath: e.target.value }))} placeholder="/remote.php/dav/addressbooks/users/USER/contacts/" />
</div>
<div>
<label className="text-xs font-medium text-muted-foreground">Username</label>
<Input value={ncConfig.username} onChange={(e: React.ChangeEvent<HTMLInputElement>) => setNcConfig(p => ({ ...p, username: e.target.value }))} />
</div>
<div>
<label className="text-xs font-medium text-muted-foreground">App Password</label>
<Input type="password" value={ncConfig.password} onChange={(e: React.ChangeEvent<HTMLInputElement>) => setNcConfig(p => ({ ...p, password: e.target.value }))} />
</div>
</div>
<Button onClick={syncContacts} loading={syncingContacts}>Sync Contacts Now</Button>
</div>
</TabsContent>
<TabsContent value="imap" className="mt-0 space-y-4">
<div className="rounded-lg border p-4 space-y-3"> <div className="rounded-lg border p-4 space-y-3">
<h3 className="font-medium flex items-center gap-2"><Server className="h-4 w-4" /> IMAP Configuration</h3> <h3 className="font-medium flex items-center gap-2"><Server className="h-4 w-4" /> IMAP Configuration</h3>
<div className="grid grid-cols-2 gap-3"> <div className="grid grid-cols-2 gap-3">
@@ -162,91 +277,23 @@ export function SettingsClient({ oidc, callbackUrl }: { oidc: OidcStatus; callba
</div> </div>
</div> </div>
</TabsContent> </TabsContent>
<TabsContent value="ai" className="mt-0 space-y-4">
<TabsContent value="nextcloud" className="space-y-4 mt-4">
<div className="rounded-lg border p-4 space-y-3">
<h3 className="font-medium flex items-center gap-2"><Cloud className="h-4 w-4" /> Nextcloud / CardDAV</h3>
<div className="grid grid-cols-2 gap-3">
<div className="col-span-2">
<label className="text-xs font-medium text-muted-foreground">Nextcloud URL</label>
<Input value={ncConfig.nextcloudUrl} onChange={(e: React.ChangeEvent<HTMLInputElement>) => setNcConfig(p => ({ ...p, nextcloudUrl: e.target.value }))} placeholder="https://nextcloud.example.com" />
</div>
<div className="col-span-2">
<label className="text-xs font-medium text-muted-foreground">CardDAV Path (optional)</label>
<Input value={ncConfig.cardDavPath} onChange={(e: React.ChangeEvent<HTMLInputElement>) => setNcConfig(p => ({ ...p, cardDavPath: e.target.value }))} placeholder="/remote.php/dav/addressbooks/users/USER/contacts/" />
</div>
<div>
<label className="text-xs font-medium text-muted-foreground">Username</label>
<Input value={ncConfig.username} onChange={(e: React.ChangeEvent<HTMLInputElement>) => setNcConfig(p => ({ ...p, username: e.target.value }))} />
</div>
<div>
<label className="text-xs font-medium text-muted-foreground">App Password</label>
<Input type="password" value={ncConfig.password} onChange={(e: React.ChangeEvent<HTMLInputElement>) => setNcConfig(p => ({ ...p, password: e.target.value }))} />
</div>
</div>
<Button onClick={syncContacts} loading={syncingContacts}>Sync Contacts Now</Button>
</div>
</TabsContent>
<TabsContent value="notifications" className="space-y-4 mt-4">
<NotificationsSettings />
</TabsContent>
<TabsContent value="automations" className="space-y-4 mt-4">
<AutomationsSettings />
</TabsContent>
<TabsContent value="ai" className="space-y-4 mt-4">
<AiSettings /> <AiSettings />
</TabsContent> </TabsContent>
<TabsContent value="mcp" className="mt-0 space-y-4">
<TabsContent value="api-keys" className="space-y-4 mt-4">
<ApiKeysSettings />
</TabsContent>
<TabsContent value="mcp" className="space-y-4 mt-4">
<McpSettings /> <McpSettings />
</TabsContent> </TabsContent>
<TabsContent value="automations" className="mt-0 space-y-4">
<TabsContent value="webdav" className="space-y-4 mt-4"> <AutomationsSettings />
<WebdavSettings />
</TabsContent> </TabsContent>
<TabsContent value="notifications" className="mt-0 space-y-4">
<TabsContent value="caldav" className="space-y-4 mt-4"> <NotificationsSettings />
<CalDavSettings />
</TabsContent> </TabsContent>
<TabsContent value="api-keys" className="mt-0 space-y-4">
<TabsContent value="carddav" className="space-y-4 mt-4"> <ApiKeysSettings />
<CardDavSettings />
</TabsContent> </TabsContent>
<TabsContent value="oidc" className="space-y-4 mt-4">
<div className="rounded-lg border p-4 space-y-3">
<h3 className="font-medium flex items-center gap-2"><Shield className="h-4 w-4" /> OIDC Configuration</h3>
<p className="text-sm text-muted-foreground">Authelia single sign-on, configured via environment variables (read-only)</p>
<div className={`flex items-start gap-2 rounded-md p-3 text-sm ${oidc.enabled ? 'bg-green-500/10 text-green-700 dark:text-green-400' : 'bg-amber-500/10 text-amber-800 dark:text-amber-300'}`}>
{oidc.enabled ? <Check className="h-4 w-4 mt-0.5 shrink-0" /> : <AlertTriangle className="h-4 w-4 mt-0.5 shrink-0" />}
<span>
{oidc.enabled
? <>Configured for <span className="font-mono break-all">{oidc.issuer}</span>. Authelia sign-in is enabled.</>
: <>Not connected. Authelia sign-in is disabled until all three variables below hold real values. Users can sign in with email and password meanwhile. Setup guide: <span className="font-mono">docs/AUTHELIA.md</span></>}
</span>
</div>
<div className="space-y-2">
{([['OIDC_ISSUER', oidc.issuerSet], ['OIDC_CLIENT_ID', oidc.clientIdSet], ['OIDC_CLIENT_SECRET', oidc.clientSecretSet]] as const).map(([name, set]) => (
<div key={name} className="flex items-center gap-2">
<span className="text-xs font-mono bg-muted px-2 py-1 rounded">{name}</span>
<span className="text-sm text-muted-foreground">{set ? 'Set' : 'Not set'}</span>
{set ? <Check className="h-4 w-4 text-green-500" /> : <X className="h-4 w-4 text-muted-foreground" />}
</div>
))}
</div>
<div className="space-y-1 pt-2 border-t">
<p className="text-xs font-medium text-muted-foreground">Redirect URI to register in Authelia</p>
<p className="text-xs font-mono bg-muted px-2 py-1.5 rounded break-all" suppressHydrationWarning>{callbackUrl}</p>
</div>
</div> </div>
</TabsContent> </div>
</Tabs> </Tabs>
</div> </div>
) )