Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
feat(settings): simplify cloud sync setup
vastsa172c445bf155
diff --git a/apps/desktop/src/components/settings/ConfigSyncConnectionFields.tsx b/apps/desktop/src/components/settings/ConfigSyncConnectionFields.tsxindex 4620c9124..67c9d101b 100644--- a/apps/desktop/src/components/settings/ConfigSyncConnectionFields.tsx+++ b/apps/desktop/src/components/settings/ConfigSyncConnectionFields.tsx@@ -1,6 +1,8 @@import { useTranslation } from "react-i18next";import type { ConfigSyncForm } from "../../features/settings/config-sync-form";-import { Checkbox, Field, Input, PasswordInput } from "../ui";+import { SettingsRow } from "../../features/settings/primitives";+import { Checkbox, Field, Input, PasswordInput, SettingsToggle } from "../ui";+import { SettingsDisclosure } from "./SettingsDisclosure";import { SettingsMenuSelect } from "./SettingsMenuSelect";type Props = {@@ -13,70 +15,76 @@ type Props = {export function ConfigSyncConnectionFields({ form, configured, locked, disabled, onChange }: Props) {const { t } = useTranslation();+ const textField = (key: "endpoint" | "bucket" | "accessKeyId" | "region" | "prefix" | "deviceLabel") => (+ <Field key={key} label={t(`settings.configSync.${key}`)}>+ <Input value={form[key]} onChange={(event) => onChange(key, event.target.value)}+ placeholder={key === "endpoint" ? t("settings.configSync.endpointPlaceholder") : key === "deviceLabel" ? t("settings.configSync.defaultDevice") : undefined}+ aria-label={t(`settings.configSync.${key}`)}+ autoComplete={key === "endpoint" ? "url" : "off"} disabled={disabled} />+ </Field>+ );return (- <div className="settings-config-sync-form">- <Field label={t("settings.configSync.mode")} hint={t("settings.configSync.modeHint")}>- <SettingsMenuSelect- fullWidth label={t("settings.configSync.mode")} value={form.mode} disabled={disabled}+ <>+ <SettingsRow title={t("settings.configSync.mode")} description={t("settings.configSync.modeHint")}>+ <SettingsMenuSelect label={t("settings.configSync.mode")} value={form.mode} disabled={disabled}options={[{ id: "sync", label: t("settings.configSync.modeSync") },{ id: "backup", label: t("settings.configSync.modeBackup") },]}- onChange={(value) => { if (value === "sync" || value === "backup") onChange("mode", value); }}- />- </Field>- <Field label={t("settings.configSync.endpoint")}>- <Input value={form.endpoint} onChange={(event) => onChange("endpoint", event.target.value)}- placeholder={t("settings.configSync.endpointPlaceholder")} aria-label={t("settings.configSync.endpoint")}- autoComplete="url" disabled={disabled} />- </Field>- {(["region", "bucket", "prefix", "accessKeyId"] as const).map((key) => (- <Field key={key} label={t(`settings.configSync.${key}`)}>- <Input value={form[key]} onChange={(event) => onChange(key, event.target.value)}- aria-label={t(`settings.configSync.${key}`)} autoComplete="off" disabled={disabled} />+ onChange={(value) => { if (value === "sync" || value === "backup") onChange("mode", value); }} />+ </SettingsRow>+ <div className="settings-config-sync-form">+ {textField("endpoint")}+ {textField("bucket")}+ {textField("accessKeyId")}+ <Field label={t("settings.configSync.secretAccessKey")}+ hint={configured ? t("settings.configSync.secretSavedHint") : undefined}>+ <PasswordInput value={form.secretAccessKey}+ onChange={(event) => onChange("secretAccessKey", event.target.value)}+ aria-label={t("settings.configSync.secretAccessKey")} autoComplete="new-password"+ showLabel={t("settings.configSync.showPassword")} hideLabel={t("settings.configSync.hidePassword")}+ disabled={disabled} /></Field>- ))}- <Field label={t("settings.configSync.addressing")} hint={t("settings.configSync.addressingHint")}>- <SettingsMenuSelect fullWidth label={t("settings.configSync.addressing")}- value={form.pathStyle ? "path" : "virtual"} disabled={disabled}- options={[- { id: "path", label: t("settings.configSync.pathStyle") },- { id: "virtual", label: t("settings.configSync.virtualHosted") },- ]}- onChange={(value) => onChange("pathStyle", value === "path")} />- </Field>- <Field label={t("settings.configSync.secretAccessKey")}- hint={configured ? t("settings.configSync.secretSavedHint") : undefined}>- <PasswordInput value={form.secretAccessKey}- onChange={(event) => onChange("secretAccessKey", event.target.value)}- aria-label={t("settings.configSync.secretAccessKey")} autoComplete="new-password"- showLabel={t("settings.configSync.showPassword")} hideLabel={t("settings.configSync.hidePassword")}- disabled={disabled} />- </Field>- <Field label={t("settings.configSync.sessionToken")} hint={t("settings.configSync.sessionTokenHint")}>- <PasswordInput value={form.sessionToken}- onChange={(event) => onChange("sessionToken", event.target.value)}- aria-label={t("settings.configSync.sessionToken")} autoComplete="new-password"- showLabel={t("settings.configSync.showPassword")} hideLabel={t("settings.configSync.hidePassword")}- disabled={disabled || form.clearSessionToken} />- {configured ? <Checkbox checked={form.clearSessionToken}- onChange={(event) => onChange("clearSessionToken", event.target.checked)}- label={t("settings.configSync.clearSessionToken")} disabled={disabled} /> : null}- </Field>- <Field label={t("settings.configSync.deviceLabel")}>- <Input value={form.deviceLabel} onChange={(event) => onChange("deviceLabel", event.target.value)}- placeholder={t("settings.configSync.defaultDevice")} aria-label={t("settings.configSync.deviceLabel")}- autoComplete="off" disabled={disabled} />- </Field>- <Field label={configured ? t("settings.configSync.backupPasswordUnlock") : t("settings.configSync.backupPassword")}- hint={configured && !locked ? t("settings.configSync.backupPasswordOptional") : t("settings.configSync.backupPasswordHint")}>- <PasswordInput value={form.backupPassword} onChange={(event) => onChange("backupPassword", event.target.value)}- aria-label={t("settings.configSync.backupPassword")} autoComplete="new-password"- showLabel={t("settings.configSync.showPassword")} hideLabel={t("settings.configSync.hidePassword")}- disabled={disabled} />- </Field>- <Checkbox checked={form.automaticSync} onChange={(event) => onChange("automaticSync", event.target.checked)}- label={t("settings.configSync.automaticSync")} disabled={disabled} />- </div>+ {!locked ? (+ <Field label={configured ? t("settings.configSync.backupPasswordUnlock") : t("settings.configSync.backupPassword")}+ hint={configured ? t("settings.configSync.backupPasswordOptional") : t("settings.configSync.backupPasswordHint")}>+ <PasswordInput value={form.backupPassword} onChange={(event) => onChange("backupPassword", event.target.value)}+ aria-label={t("settings.configSync.backupPassword")} autoComplete="new-password"+ showLabel={t("settings.configSync.showPassword")} hideLabel={t("settings.configSync.hidePassword")}+ disabled={disabled} />+ </Field>+ ) : null}+ </div>+ <SettingsRow title={t("settings.configSync.automaticSync")}>+ <SettingsToggle checked={form.automaticSync} onChange={() => onChange("automaticSync", !form.automaticSync)}+ label={t("settings.configSync.automaticSync")} disabled={disabled} />+ </SettingsRow>+ <SettingsDisclosure title={t("settings.configSync.advancedTitle")}>+ <div className="settings-config-sync-form">+ {textField("region")}+ {textField("prefix")}+ {textField("deviceLabel")}+ <Field label={t("settings.configSync.addressing")} hint={t("settings.configSync.addressingHint")}>+ <SettingsMenuSelect fullWidth label={t("settings.configSync.addressing")}+ value={form.pathStyle ? "path" : "virtual"} disabled={disabled}+ options={[+ { id: "path", label: t("settings.configSync.pathStyle") },+ { id: "virtual", label: t("settings.configSync.virtualHosted") },+ ]}+ onChange={(value) => onChange("pathStyle", value === "path")} />+ </Field>+ <Field label={t("settings.configSync.sessionToken")} hint={t("settings.configSync.sessionTokenHint")}>+ <PasswordInput value={form.sessionToken}+ onChange={(event) => onChange("sessionToken", event.target.value)}+ aria-label={t("settings.configSync.sessionToken")} autoComplete="new-password"+ showLabel={t("settings.configSync.showPassword")} hideLabel={t("settings.configSync.hidePassword")}+ disabled={disabled || form.clearSessionToken} />+ {configured ? <Checkbox checked={form.clearSessionToken}+ onChange={(event) => onChange("clearSessionToken", event.target.checked)}+ label={t("settings.configSync.clearSessionToken")} disabled={disabled} /> : null}+ </Field>+ </div>+ </SettingsDisclosure>+ </>);}diff --git a/apps/desktop/src/components/settings/ConfigSyncPage.tsx b/apps/desktop/src/components/settings/ConfigSyncPage.tsxindex 054a639ee..acff548ac 100644--- a/apps/desktop/src/components/settings/ConfigSyncPage.tsx+++ b/apps/desktop/src/components/settings/ConfigSyncPage.tsx@@ -1,7 +1,6 @@import { useCallback, useEffect, useMemo, useRef, useState } from "react";import { useTranslation } from "react-i18next";import type {- ConfigSyncCategory,ConfigSyncCategorySelection,ConfigSyncHistoryEntry,ConfigSyncPendingApproval,@@ -9,8 +8,8 @@ import type {ConfigSyncState,} from "@pi-desktop/shared";import { api } from "../../lib/api";-import { Badge, Button, Checkbox, PasswordInput, SettingsToggle } from "../ui";-import { IconCloudDown, IconRefresh, IconShield, IconTrash } from "../icons";+import { Badge, Button, PasswordInput, SettingsToggle } from "../ui";+import { IconCloudDown, IconRefresh, IconShield } from "../icons";import { SettingsCard, SettingsRow } from "../../features/settings/primitives";import { configSyncProgressView } from "../../features/settings/config-sync-progress";import { useAppStore } from "../../stores/app-store";@@ -26,6 +25,9 @@ import {} from "../../features/settings/config-sync-preferences";import { ConfigSyncError } from "./ConfigSyncError";import { ConfigSyncConnectionFields } from "./ConfigSyncConnectionFields";+import { ConfigSyncScopeFields } from "./ConfigSyncScopeFields";+import { ConfigSyncVaultSettings } from "./ConfigSyncVaultSettings";+import { SettingsDisclosure } from "./SettingsDisclosure";import {type ConfigSyncForm,clearConfigSyncFormSecrets,@@ -42,22 +44,6 @@ function formatStamp(value: string): string {return Number.isNaN(date.getTime()) ? value : date.toLocaleString();}-const CATEGORIES: Array<{- id: Exclude<ConfigSyncCategory, "credentials" | "memory">;- label: string;-}> = [- { id: "application", label: "settings.configSync.categoryApplication" },- { id: "providers", label: "settings.configSync.categoryProviders" },- { id: "mcp", label: "settings.configSync.categoryMcp" },- { id: "skills", label: "settings.configSync.categorySkills" },- { id: "subagents", label: "settings.configSync.categorySubagents" },- { id: "instructions", label: "settings.configSync.categoryInstructions" },- { id: "projects", label: "settings.configSync.categoryProjects" },- { id: "plugins", label: "settings.configSync.categoryPlugins" },- { id: "automation", label: "settings.configSync.categoryAutomation" },-];--function statusTone(status: ConfigSyncState["status"],): "neutral" | "success" | "error" | "warning" {@@ -425,7 +411,6 @@ export function ConfigSyncPage() {const configured = state?.configured === true;const locked = state?.locked === true;const stateReady = state !== null;- const categories = selection;const connectionReady = Boolean(form.endpoint.trim() && form.region.trim() && form.bucket.trim() && form.accessKeyId.trim());const vaultPasswordReady =form.backupPassword.length === 0@@ -444,6 +429,7 @@ export function ConfigSyncPage() {className="settings-stack settings-config-sync"aria-busy={loading || undefined}>+ <p className="settings-config-sync-intro">{t("settings.configSync.connectionDescription")}</p>{loading && !state ? (<div className="settings-config-sync-refresh" role="status"><IconRefresh size={14} />@@ -453,46 +439,51 @@ export function ConfigSyncPage() {{error || state?.lastError ? (<ConfigSyncError message={error ?? state?.lastError ?? ""} />) : null}- <SettingsCard- title={t("settings.configSync.connectionTitle")}- description={t("settings.configSync.connectionDescription")}- >- <ConfigSyncConnectionFields form={form} configured={configured} locked={locked}- disabled={busy !== null} onChange={updateForm} />- <div className="settings-config-sync-actions">- <Button- variant="secondary"- onClick={() => void run("test")}- disabled={busy !== null || loading || !stateReady || !connectionReady}- >- <IconRefresh size={14} />- {t("settings.configSync.test")}- </Button>- <Button- variant="primary"- onClick={() => void run("configure")}- disabled={- busy !== null || loading || !stateReady || !connectionReady || !vaultPasswordReady- }- >- <IconCloudDown size={14} />- {configured ? t("settings.configSync.save") : t("settings.configSync.enable")}- </Button>- {configured && !locked ? (- <Button- variant="secondary"- onClick={() => void run("sync")}- disabled={busy !== null || state?.paused}- >- {t(state?.mode === "backup" ? "settings.configSync.backupNow" : "settings.configSync.syncNow")}- </Button>- ) : null}- </div>- </SettingsCard>+ {state?.configured && (+ <SettingsCard title={t("settings.configSync.statusTitle")}>+ <SettingsRow title={t("settings.configSync.statusLabel")}+ detail={<>+ <span>{state.bucket}</span>+ {state.lastSuccessAt ? <span>{" · "}{t("settings.configSync.lastSuccess", { date: formatStamp(state.lastSuccessAt) })}</span> : null}+ </>}>+ <div className="settings-config-sync-actions">+ <Badge tone={statusTone(state.status)}>{statusLabel}</Badge>+ {!locked ? (+ <Button variant="primary" onClick={() => void run("sync")}+ disabled={busy !== null || state.paused}>+ <IconCloudDown size={14} />+ {t(state.mode === "backup" ? "settings.configSync.backupNow" : "settings.configSync.syncNow")}+ </Button>+ ) : null}+ </div>+ </SettingsRow>+ {locked ? (+ <SettingsRow title={t("settings.configSync.unlockTitle")}+ description={t("settings.configSync.unlockDescription")}>+ <div className="settings-config-sync-password-actions">+ <PasswordInput value={form.backupPassword}+ onChange={(event) => updateForm("backupPassword", event.target.value)}+ aria-label={t("settings.configSync.backupPassword")} autoComplete="current-password"+ showLabel={t("settings.configSync.showPassword")} hideLabel={t("settings.configSync.hidePassword")}+ disabled={busy !== null} />+ <Button variant="primary" onClick={() => void run("unlock")}+ disabled={busy !== null || !form.backupPassword}>+ <IconShield size={14} />+ {t("settings.configSync.unlock")}+ </Button>+ </div>+ </SettingsRow>+ ) : (+ <SettingsRow title={t("settings.configSync.pauseTitle")}+ description={t("settings.configSync.pauseDescription")}>+ <SettingsToggle checked={state.paused} label={t("settings.configSync.pauseTitle")}+ disabled={busy !== null} onChange={() => void togglePause()} />+ </SettingsRow>+ )}+ </SettingsCard>+ )}- {/* A sync this page started reports itself here, above the cards: the- first enable is the slowest sync of all, and it runs while the status- card below has nothing to show yet. */}+ {/* Progress is independent of setup, including the first configuration. */}{syncProgress ? (<div className="settings-config-sync-progress"><div className="settings-config-sync-progress-head">@@ -539,136 +530,29 @@ export function ConfigSyncPage() {</div>) : null}+ <SettingsCard>+ <SettingsDisclosure title={t("settings.configSync.connectionTitle")}+ open={!configured || initialDraft.saved === false}>+ <ConfigSyncConnectionFields form={form} configured={configured} locked={locked}+ disabled={busy !== null} onChange={updateForm} />+ <ConfigSyncScopeFields selection={selection} disabled={busy !== null} onChange={updateSelection} />+ <div className="settings-config-sync-actions settings-config-sync-form-actions">+ <Button variant="secondary" onClick={() => void run("test")}+ disabled={busy !== null || loading || !stateReady || !connectionReady}>+ <IconRefresh size={14} />+ {t("settings.configSync.test")}+ </Button>+ <Button variant="primary" onClick={() => void run("configure")}+ disabled={busy !== null || loading || !stateReady || !connectionReady || !vaultPasswordReady}>+ <IconCloudDown size={14} />+ {configured ? t("settings.configSync.save") : t("settings.configSync.enable")}+ </Button>+ </div>+ </SettingsDisclosure>+ </SettingsCard>+{configured ? (<>- <SettingsCard title={t("settings.configSync.statusTitle")}>- <SettingsRow- title={t("settings.configSync.statusLabel")}- detail={- state?.lastSuccessAt- ? t("settings.configSync.lastSuccess", {- date: formatStamp(state.lastSuccessAt),- })- : undefined- }- >- <Badge tone={statusTone(state.status)}>{statusLabel}</Badge>- </SettingsRow>-- {locked ? (- <SettingsRow- title={t("settings.configSync.unlockTitle")}- description={t("settings.configSync.unlockDescription")}- >- <Button- variant="primary"- onClick={() => void run("unlock")}- disabled={busy !== null || !form.backupPassword}- >- <IconShield size={14} />- {t("settings.configSync.unlock")}- </Button>- </SettingsRow>- ) : (- <SettingsRow- title={t("settings.configSync.pauseTitle")}- description={t("settings.configSync.pauseDescription")}- >- <SettingsToggle- checked={state?.paused === true}- label={t("settings.configSync.pauseTitle")}- onChange={() => void togglePause()}- />- </SettingsRow>- )}- {!locked ? (- <SettingsRow- title={t("settings.configSync.changePasswordTitle")}- description={t("settings.configSync.changePasswordDescription")}- >- <div className="settings-config-sync-password-actions">- <PasswordInput- value={form.currentBackupPassword}- onChange={(event) =>- updateForm("currentBackupPassword", event.target.value)- }- aria-label={t("settings.configSync.currentBackupPassword")}- placeholder={t("settings.configSync.currentBackupPassword")}- autoComplete="current-password"- showLabel={t("settings.configSync.showPassword")}- hideLabel={t("settings.configSync.hidePassword")}- disabled={busy !== null}- />- <PasswordInput- value={form.newBackupPassword}- onChange={(event) =>- updateForm("newBackupPassword", event.target.value)- }- aria-label={t("settings.configSync.newBackupPassword")}- placeholder={t("settings.configSync.newBackupPassword")}- autoComplete="new-password"- showLabel={t("settings.configSync.showPassword")}- hideLabel={t("settings.configSync.hidePassword")}- disabled={busy !== null}- />- <Button- variant="secondary"- onClick={() => void changePassword()}- disabled={- busy !== null ||- !form.currentBackupPassword ||- !form.newBackupPassword- }- >- {t("settings.configSync.changePassword")}- </Button>- </div>- </SettingsRow>- ) : null}- </SettingsCard>-- <SettingsCard- title={t("settings.configSync.categoriesTitle")}- description={t("settings.configSync.categoriesDescription")}- >- <div className="settings-config-sync-categories">- {CATEGORIES.map((category) => (- <Checkbox- key={category.id}- className="settings-config-sync-category"- checked={categories[category.id] !== false}- disabled={busy !== null}- onChange={(event) =>- updateSelection(category.id, event.target.checked)- }- label={t(category.label)}- />- ))}- <Checkbox- className="settings-config-sync-category"- checked={selection.memory}- disabled={busy !== null}- onChange={(event) =>- updateSelection("memory", event.target.checked)- }- label={t("settings.configSync.categoryMemory")}- />- <Checkbox- className="settings-config-sync-category settings-config-sync-sensitive"- checked={selection.credentials}- disabled={busy !== null}- onChange={(event) =>- updateSelection("credentials", event.target.checked)- }- label={t("settings.configSync.categoryCredentials")}- />- </div>- {selection.credentials ? (- <div className="settings-config-sync-warning">- {t("settings.configSync.credentialsWarning")}- </div>- ) : null}- </SettingsCard>{state?.pendingApprovals.length ? (<SettingsCard@@ -721,7 +605,8 @@ export function ConfigSyncPage() {) : null}{state?.preview ? (- <SettingsCard title={t("settings.configSync.previewTitle")}>+ <SettingsCard>+ <SettingsDisclosure title={t("settings.configSync.previewTitle")}><div className="settings-config-sync-preview"><span>{t("settings.configSync.previewSupported", {@@ -754,14 +639,14 @@ export function ConfigSyncPage() {})}</span></div>+ </SettingsDisclosure></SettingsCard>) : null}{state?.mappings.length ? (- <SettingsCard- title={t("settings.configSync.mappingsTitle")}- description={t("settings.configSync.mappingsDescription")}- >+ <SettingsCard>+ <SettingsDisclosure title={t("settings.configSync.mappingsTitle")}>+ <p className="settings-config-sync-note">{t("settings.configSync.mappingsDescription")}</p><div className="settings-config-sync-mappings">{state.mappings.map((mapping) => (<div key={mapping.logicalId} className="settings-config-sync-mapping">@@ -776,13 +661,13 @@ export function ConfigSyncPage() {</div>))}</div>+ </SettingsDisclosure></SettingsCard>) : null}- <SettingsCard- title={t("settings.configSync.historyTitle")}- description={t("settings.configSync.historyDescription")}- >+ <SettingsCard>+ <SettingsDisclosure title={t("settings.configSync.historyTitle")}>+ <p className="settings-config-sync-note">{t("settings.configSync.historyDescription")}</p><div className="settings-config-sync-history-actions"><Buttonvariant="secondary"@@ -826,27 +711,12 @@ export function ConfigSyncPage() {: t("settings.configSync.historyEmpty")}</div>)}+ </SettingsDisclosure></SettingsCard>- <SettingsCard>- <SettingsRow- title={t("settings.configSync.disconnectTitle")}- description={t("settings.configSync.disconnectDescription")}- >- <Button- variant="secondary"- onClick={() => {- if (window.confirm(t("settings.configSync.disconnectConfirm"))) {- void run("disconnect");- }- }}- disabled={busy !== null}- >- <IconTrash size={14} />- {t("settings.configSync.disconnect")}- </Button>- </SettingsRow>- </SettingsCard>+ <ConfigSyncVaultSettings form={form} locked={locked} disabled={busy !== null}+ onChange={updateForm} onChangePassword={() => void changePassword()}+ onDisconnect={() => void run("disconnect")} /></>) : null}</div>diff --git a/apps/desktop/src/components/settings/ConfigSyncScopeFields.tsx b/apps/desktop/src/components/settings/ConfigSyncScopeFields.tsxnew file mode 100644index 000000000..9c0f1961f--- /dev/null+++ b/apps/desktop/src/components/settings/ConfigSyncScopeFields.tsx@@ -0,0 +1,44 @@+import { useTranslation } from "react-i18next";+import type { ConfigSyncCategorySelection } from "@pi-desktop/shared";+import { Checkbox } from "../ui";+import { SettingsDisclosure } from "./SettingsDisclosure";++const CATEGORIES = [+ ["application", "categoryApplication"],+ ["providers", "categoryProviders"],+ ["mcp", "categoryMcp"],+ ["skills", "categorySkills"],+ ["subagents", "categorySubagents"],+ ["instructions", "categoryInstructions"],+ ["projects", "categoryProjects"],+ ["plugins", "categoryPlugins"],+ ["automation", "categoryAutomation"],+ ["memory", "categoryMemory"],+ ["credentials", "categoryCredentials"],+] as const;++export function ConfigSyncScopeFields({ selection, disabled, onChange }: {+ selection: ConfigSyncCategorySelection;+ disabled: boolean;+ onChange: (key: keyof ConfigSyncCategorySelection, value: boolean) => void;+}) {+ const { t } = useTranslation();+ return (+ <SettingsDisclosure title={t("settings.configSync.categoriesTitle")}>+ <p className="settings-config-sync-note">{t("settings.configSync.categoriesDescription")}</p>+ <div className="settings-config-sync-categories">+ {CATEGORIES.map(([key, label]) => (+ <Checkbox key={key} className="settings-config-sync-category"+ checked={selection[key]} disabled={disabled}+ onChange={(event) => onChange(key, event.target.checked)}+ label={t(`settings.configSync.${label}`)} />+ ))}+ </div>+ {selection.credentials ? (+ <div className="settings-config-sync-warning" role="note">+ {t("settings.configSync.credentialsWarning")}+ </div>+ ) : null}+ </SettingsDisclosure>+ );+}diff --git a/apps/desktop/src/components/settings/ConfigSyncVaultSettings.tsx b/apps/desktop/src/components/settings/ConfigSyncVaultSettings.tsxnew file mode 100644index 000000000..4e51ed7ed--- /dev/null+++ b/apps/desktop/src/components/settings/ConfigSyncVaultSettings.tsx@@ -0,0 +1,54 @@+import { useTranslation } from "react-i18next";+import type { ConfigSyncForm } from "../../features/settings/config-sync-form";+import { SettingsCard, SettingsRow } from "../../features/settings/primitives";+import { Button, Field, PasswordInput } from "../ui";+import { IconTrash } from "../icons";+import { SettingsDisclosure } from "./SettingsDisclosure";++export function ConfigSyncVaultSettings({ form, locked, disabled, onChange, onChangePassword, onDisconnect }: {+ form: ConfigSyncForm;+ locked: boolean;+ disabled: boolean;+ onChange: <K extends keyof ConfigSyncForm>(key: K, value: ConfigSyncForm[K]) => void;+ onChangePassword: () => void;+ onDisconnect: () => void;+}) {+ const { t } = useTranslation();+ return (+ <SettingsCard>+ <SettingsDisclosure title={t("settings.configSync.maintenanceTitle")}>+ {!locked ? (+ <>+ <p className="settings-config-sync-note">{t("settings.configSync.changePasswordDescription")}</p>+ <div className="settings-config-sync-form">+ {(["currentBackupPassword", "newBackupPassword"] as const).map((key) => (+ <Field key={key} label={t(`settings.configSync.${key}`)}>+ <PasswordInput value={form[key]} onChange={(event) => onChange(key, event.target.value)}+ aria-label={t(`settings.configSync.${key}`)}+ autoComplete={key === "currentBackupPassword" ? "current-password" : "new-password"}+ showLabel={t("settings.configSync.showPassword")} hideLabel={t("settings.configSync.hidePassword")}+ disabled={disabled} />+ </Field>+ ))}+ </div>+ <div className="settings-config-sync-form-actions">+ <Button variant="secondary" onClick={onChangePassword}+ disabled={disabled || !form.currentBackupPassword || !form.newBackupPassword}>+ {t("settings.configSync.changePassword")}+ </Button>+ </div>+ </>+ ) : null}+ <SettingsRow title={t("settings.configSync.disconnectTitle")}+ description={t("settings.configSync.disconnectDescription")}>+ <Button variant="secondary" onClick={() => {+ if (window.confirm(t("settings.configSync.disconnectConfirm"))) onDisconnect();+ }} disabled={disabled}>+ <IconTrash size={14} />+ {t("settings.configSync.disconnect")}+ </Button>+ </SettingsRow>+ </SettingsDisclosure>+ </SettingsCard>+ );+}diff --git a/apps/desktop/src/components/settings/SettingsDisclosure.tsx b/apps/desktop/src/components/settings/SettingsDisclosure.tsxnew file mode 100644index 000000000..252ca9967--- /dev/null+++ b/apps/desktop/src/components/settings/SettingsDisclosure.tsx@@ -0,0 +1,24 @@+import type { DetailsHTMLAttributes, ReactNode } from "react";+import { cx } from "../ui";+import { IconChevronDown } from "../icons";++/** Native disclosure: keyboard semantics and hidden-content focus stay browser-owned. */+export function SettingsDisclosure({+ title,+ className,+ children,+ ...props+}: Omit<DetailsHTMLAttributes<HTMLDetailsElement>, "title"> & {+ title: string;+ children: ReactNode;+}) {+ return (+ <details className={cx("settings-disclosure", className)} {...props}>+ <summary>+ <span>{title}</span>+ <IconChevronDown size={16} aria-hidden="true" />+ </summary>+ <div className="settings-disclosure-body">{children}</div>+ </details>+ );+}diff --git a/apps/desktop/src/components/ui.tsx b/apps/desktop/src/components/ui.tsxindex b6c36931a..cc23d1487 100644--- a/apps/desktop/src/components/ui.tsx+++ b/apps/desktop/src/components/ui.tsx@@ -754,6 +754,7 @@ export function Checkbox({ref={(node) => {if (node) node.indeterminate = indeterminate;}}+ className="ds-checkbox"{...props}/><span>{label}</span>diff --git a/apps/desktop/src/styles/settings.css b/apps/desktop/src/styles/settings.cssindex 8453914d4..5f24e673d 100644--- a/apps/desktop/src/styles/settings.css+++ b/apps/desktop/src/styles/settings.css@@ -481,6 +481,82 @@padding: 12px 14px 14px;}+.settings-disclosure > summary {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 12px;+ min-height: 44px;+ padding: 12px 16px;+ list-style: none;+ border-radius: var(--radius-sm);+ color: var(--ds-text-secondary);+ font-size: var(--text-sm-plus);+ font-weight: var(--font-weight-medium);+ cursor: pointer;+}++.settings-disclosure > summary::-webkit-details-marker {+ display: none;+}++.settings-disclosure > summary:hover {+ background: var(--ds-tile-hover);+}++.settings-disclosure > summary:focus-visible {+ outline: 2px solid var(--ds-focus);+ outline-offset: -4px;+}++.settings-disclosure > summary svg {+ flex: 0 0 auto;+ transition: transform var(--motion-duration-fast) var(--motion-ease-out);+}++.settings-disclosure[open] > summary {+ color: var(--ds-text-primary);+}++.settings-disclosure[open] > summary svg {+ transform: rotate(180deg);+}++.settings-disclosure-body > .settings-disclosure {+ margin: 0 16px;+}++.settings-disclosure-body > .settings-disclosure > summary {+ padding-inline: 0;+}++.settings-config-sync {+ container-type: inline-size;+ container-name: config-sync;+ gap: 16px;+}++.settings-config-sync > .settings-card-block {+ margin-bottom: 0;+}++.settings-config-sync-intro,+.settings-config-sync-note {+ margin: 0;+ color: var(--ds-text-secondary);+ font-size: var(--text-sm);+ line-height: var(--leading-body);+ overflow-wrap: anywhere;+}++.settings-config-sync-note {+ padding: 0 16px 8px;+}++.settings-config-sync .settings-disclosure-body > .settings-row {+ background: transparent;+}+.settings-config-sync-form {display: grid;grid-template-columns: repeat(2, minmax(0, 1fr));@@ -493,18 +569,12 @@width: 100%;}-.settings-config-sync-http-option {- display: grid;- grid-column: 1 / -1;+.settings-config-sync-form-actions {+ display: flex;+ justify-content: flex-end;+ flex-wrap: wrap;gap: 8px;- padding: 10px 12px;- border: 1px solid color-mix(in srgb, var(--ds-warning) 32%, transparent);- border-radius: var(--radius-md);- background: color-mix(in srgb, var(--ds-warning) 7%, transparent);-}--.settings-config-sync-http-option .settings-config-sync-warning {- margin: 0;+ padding: 12px 16px 16px;}.settings-config-sync-actions {@@ -514,10 +584,6 @@gap: 8px;}-.settings-config-sync > .settings-card-block:first-child .settings-config-sync-actions,-.settings-config-sync > .settings-card-block:first-of-type .settings-config-sync-actions {- padding: 0 16px 14px;-}/* A failed sync is a state, not a stray paragraph: the notice wears the errorink on its frame and glyph, keeps the copy legible on both themes, and hides@@ -659,14 +725,7 @@font-size: var(--text-sm);}-/*- * A manual sync reports itself while its request is still open: the phase it- * is in, a bar once it announced a total, and the figures it has moved so far.- * It sits between the cards rather than inside one, because the first enable —- * the slowest sync of all — runs before the status card exists. The page stack- * spaces the cards around it, so only the inset that lines it up with their- * content is left here.- */+/* Manual progress stays above setup and never hides behind a disclosure. */.settings-config-sync-progress {display: grid;gap: 8px;@@ -731,13 +790,6 @@font-size: var(--text-sm);}-.settings-config-sync-category input {- accent-color: var(--ds-accent);-}--.settings-config-sync-sensitive {- color: var(--ds-warning);-}.settings-config-sync-warning {margin: 0 16px 14px;@@ -847,7 +899,7 @@font-size: var(--text-sm);}-@media (max-width: 700px) {+@container config-sync (max-width: 560px) {.settings-config-sync-form,.settings-config-sync-categories {grid-template-columns: minmax(0, 1fr);diff --git a/apps/desktop/src/styles/ui-kit.css b/apps/desktop/src/styles/ui-kit.cssindex ed2899906..9dadbf076 100644--- a/apps/desktop/src/styles/ui-kit.css+++ b/apps/desktop/src/styles/ui-kit.css@@ -339,12 +339,35 @@background: var(--ds-border-subtle);}-/* ---- Checkbox: high-contrast custom draw (dark + light) ---- */+/* Shared labeled selections keep native input semantics, not platform paint. */+.ui-checkbox {+ display: inline-flex;+ align-items: center;+ gap: 8px;+ min-height: 28px;+ max-width: 100%;+ color: var(--ds-text-secondary);+ font-size: var(--text-sm);+ line-height: var(--leading-body);+ cursor: pointer;+}++.ui-checkbox > span {+ min-width: 0;+ overflow-wrap: anywhere;+}++.ui-checkbox:has(> input:disabled) {+ opacity: 0.45;+ cursor: not-allowed;+}+.ds-checkbox {appearance: none;-webkit-appearance: none;- width: 16px;- height: 16px;+ width: 18px;+ height: 18px;+ margin: 0;flex: 0 0 auto;border-radius: var(--radius-3xs);border: 1.5px solid var(--ds-text-secondary);@@ -356,7 +379,12 @@border-color var(--motion-duration-fast) var(--motion-ease-out);}-.ds-checkbox:checked {+.ds-checkbox:hover:not(:disabled) {+ border-color: var(--ds-accent);+}++.ds-checkbox:checked,+.ds-checkbox:indeterminate {background: var(--ds-accent);border-color: var(--ds-accent);}@@ -366,14 +394,44 @@position: absolute;top: 2px;left: 5px;- width: 4px;- height: 8px;- border: solid var(--ds-bg, #000);- border-width: 0 1.5px 1.5px 0;+ width: 5px;+ height: 9px;+ border: solid var(--ds-bg);+ border-width: 0 2px 2px 0;transform: rotate(45deg);}+.ds-checkbox:indeterminate::after {+ content: "";+ position: absolute;+ top: 6px;+ left: 3px;+ width: 9px;+ height: 2px;+ background: var(--ds-bg);+ border: 0;+ transform: none;+}++.ds-checkbox:focus-visible {+ outline: 2px solid var(--ds-focus);+ outline-offset: 3px;+}+.ds-checkbox:disabled {- opacity: 0.4;cursor: not-allowed;}++.ds-checkbox:disabled:not(.ui-checkbox > input) {+ opacity: 0.45;+}++@media (forced-colors: active) {+ .ds-checkbox {+ appearance: auto;+ }++ .ds-checkbox::after {+ display: none;+ }+}diff --git a/apps/desktop/test/config-sync-user-path.test.mjs b/apps/desktop/test/config-sync-user-path.test.mjsindex 41599deaf..f880b9c3f 100644--- a/apps/desktop/test/config-sync-user-path.test.mjs+++ b/apps/desktop/test/config-sync-user-path.test.mjs@@ -6,6 +6,7 @@ import { tmpdir } from "node:os";import { join } from "node:path";import test from "node:test";import { repositoryRoot, resolveElectronBinary } from "../../../scripts/e2e/boot.mjs";+import { loadStyles } from "./helpers/styles.mjs";const root = repositoryRoot();const { build } = createRequire(join(root, "packages/agent-runtime/package.json"))("esbuild");@@ -18,6 +19,7 @@ import { initReactI18next } from "react-i18next";import { catalogs, flattenCatalog } from "@pi-desktop/i18n";import { IPC } from "@pi-desktop/shared";import { ConfigSyncPage } from "../../apps/desktop/src/components/settings/ConfigSyncPage";+import { Checkbox } from "../../apps/desktop/src/components/ui";import { selectionFromDraft } from "../../apps/desktop/src/features/settings/config-sync-form";import { CONFIG_SYNC_DRAFT_STORAGE_KEY } from "../../apps/desktop/src/features/settings/config-sync-preferences";@@ -67,6 +69,9 @@ window.piDesktop = { platform: "darwin", channels: IPC,}data = captured;} else if (channel === IPC.invoke.configSyncRestore) data = state;+ else if (channel === IPC.invoke.configSyncPause) data = state = { ...state, paused: input.paused };+ else if (channel === IPC.invoke.configSyncUnlock) data = state = { ...state, locked: false, status: "upToDate" };+ else if (channel === IPC.invoke.configSyncChangePassword) data = state;else if (channel === IPC.invoke.configSyncDisconnect) data = state = initial;else throw new Error("Unexpected IPC: " + channel);return { ok: true, data };@@ -93,9 +98,16 @@ const fill = async (key, value) => {await frame();};const toggle = async (key) => {- const container = [...document.querySelectorAll("label")].find((node) => node.textContent.trim() === label(key));- check(container?.querySelector("input"), "missing checkbox " + key);- flushSync(() => container.querySelector("input").click()); await frame();+ const control = [...document.querySelectorAll('input[type="checkbox"], button[role="switch"]')].find((node) =>+ node.getAttribute("aria-label") === label(key) || node.closest("label")?.textContent.trim() === label(key));+ check(control, "missing boolean control " + key);+ flushSync(() => control.click()); await frame();+};+const disclosure = (key) => [...document.querySelectorAll("details")].find((node) =>+ node.querySelector(":scope > summary")?.textContent.trim() === label(key));+const expand = async (key) => {+ const element = disclosure(key); check(element, "missing disclosure " + key);+ if (!element.open) { element.querySelector("summary").click(); await frame(); }};const choose = async (key, value) => {const trigger = [...document.querySelectorAll("button")].find((node) => node.getAttribute("aria-label") === label(key));@@ -113,6 +125,32 @@ mount();window.configSyncProbe = async () => {await until(() => button("enable"), "initial page missing");check(input("endpoint").value === "", "legacy draft reused as S3");+ check(disclosure("connectionTitle")?.open, "setup must show connection fields");+ check(disclosure("advancedTitle") && !disclosure("advancedTitle").open, "advanced fields must start collapsed");+ check(!input("region").checkVisibility(), "advanced region leaked into setup");+ check(input("region").value === "us-east-1" && input("prefix").value === "pi-desktop/config", "advanced defaults changed");+ const page = document.querySelector(".settings-config-sync");+ for (const theme of ["light", "dark"]) {+ document.documentElement.dataset.theme = theme;+ for (const width of [380, 900]) {+ page.style.width = width + "px"; await frame();+ check(page.scrollWidth <= page.clientWidth, "settings overflow at " + width + " in " + theme);+ const columns = getComputedStyle(document.querySelector(".settings-config-sync-form")).gridTemplateColumns.split(" ");+ check(columns.length === (width < 560 ? 1 : 2), "form columns do not follow available width");+ }+ }+ page.style.removeProperty("width");+ await expand("advancedTitle");+ await fill("region", "test-region");+ disclosure("advancedTitle").querySelector("summary").click(); await frame();+ check(input("region").value === "test-region", "collapsing advanced settings lost values");+ await expand("advancedTitle");+ await expand("categoriesTitle");+ await toggle("categoryProviders");+ check(![...document.querySelectorAll('input[type="checkbox"]')].find((node) => node.closest("label")?.textContent.trim() === label("categoryCredentials")).checked, "credentials opted in by default");+ await toggle("categoryCredentials");+ check(document.querySelector(".settings-config-sync-warning")?.checkVisibility(), "credential opt-in warning hidden");+ await toggle("categoryCredentials");for (const [key, value] of Object.entries({ endpoint: "https://s3.example.com", bucket: "private-config",accessKeyId: "test-access", secretAccessKey: "test-secret", sessionToken: "test-token" })) await fill(key, value);await fill("backupPassword", "short1");@@ -132,6 +170,7 @@ window.configSyncProbe = async () => {await until(() => !button("test").disabled, "probe did not settle");const probe = last("configSyncTest");check(probe.mode === "backup" && probe.pathStyle === false && probe.automaticSync === false, "probe lost choices");+ check(probe.region === "test-region" && probe.categories.providers === false && probe.includeSecrets === false, "hidden advanced values or scope lost");check(probe.secretAccessKey === "test-secret" && probe.sessionToken === "test-token" && !('backupPassword' in probe), "probe credential contract");await click("enable");await until(() => releaseSync, "first run did not start");@@ -141,6 +180,15 @@ window.configSyncProbe = async () => {await until(() => document.body.textContent.includes("older-pi-desktop/config"), "history missing");flushSync(() => view.unmount()); mount(); await ready();check(input("bucket").value === "private-config", "saved connection not hydrated");+ check(!disclosure("connectionTitle").open, "saved connection must start collapsed");+ check(button("backupNow")?.checkVisibility(), "manual run must stay visible above settings");+ await toggle("pauseTitle"); await ready();+ check(button("backupNow").disabled, "paused device still permits manual run");+ await toggle("pauseTitle"); await ready();+ check(!button("backupNow").disabled, "resume did not restore manual run");+ await expand("connectionTitle");+ await expand("advancedTitle");+ await expand("historyTitle");check(input("secretAccessKey").value === "", "secret returned on reopen");await toggle("clearSessionToken"); await click("save"); await ready();check(last("configSyncConfigure").sessionToken === "" && !('secretAccessKey' in last("configSyncConfigure")), "explicit token clear or key reuse lost");@@ -162,6 +210,20 @@ window.configSyncProbe = async () => {await until(() => document.body.textContent.includes("older-other-prefix"), "new connection history not loaded");releaseHistory(); await ready();check(!document.body.textContent.includes("older-pi-desktop/config"), "stale history overwrote new connection");+ await expand("maintenanceTitle");+ await fill("currentBackupPassword", "test-password");+ await fill("newBackupPassword", "test-password-new");+ await click("changePassword"); await ready();+ check(last("configSyncChangePassword").newPassword === "test-password-new", "password action lost its input");+ check(input("currentBackupPassword").value === "" && input("newBackupPassword").value === "", "password fields not cleared");+ disclosure("connectionTitle").open = false;+ state = { ...state, locked: true, status: "locked" };+ flushSync(() => { for (const callback of listeners.get(IPC.event.configSyncChanged) ?? []) callback(state); });+ await until(() => button("unlock"), "inline unlock missing");+ check(input("backupPassword").checkVisibility() && document.querySelectorAll('input[aria-label="' + label("backupPassword") + '"]').length === 1, "unlock password is hidden or duplicated");+ await fill("backupPassword", "test-password-new"); await click("unlock"); await ready();+ check(last("configSyncUnlock").backupPassword === "test-password-new", "unlock contract changed");+ verifyNoSecrets();await click("disconnect");await until(() => button("enable") && input("endpoint").value === "", "disconnect did not clear form");check(localStorage.getItem(CONFIG_SYNC_DRAFT_STORAGE_KEY) === null, "disconnect retained draft");@@ -170,6 +232,37 @@ window.configSyncProbe = async () => {check(listeners.get(IPC.event.configSyncChanged)?.size === 0 && listeners.get(IPC.event.configSyncProgress)?.size === 0, "subscriptions leaked");return { passed: true };};+window.checkboxProbe = async () => {+ let checked = false;+ const node = document.createElement("div"); document.body.append(node);+ const checkboxView = createRoot(node);+ const render = () => flushSync(() => checkboxView.render(<>+ <Checkbox label="Probe selection" checked={checked} onChange={(event) => { checked = event.target.checked; render(); }} />+ <Checkbox label="Probe mixed" indeterminate onChange={() => {}} />+ <Checkbox label="Probe disabled" disabled defaultChecked />+ </>));+ render();+ const controls = node.querySelectorAll("input");+ for (const theme of ["light", "dark"]) {+ document.documentElement.dataset.theme = theme;+ const style = getComputedStyle(controls[0]);+ check(style.appearance === "none" && style.width === "18px", "checkbox is still platform drawn in " + theme);+ check(getComputedStyle(controls[0].parentElement).gap === "8px", "checkbox label lacks spacing");+ controls[0].parentElement.click(); await frame();+ check(checked, "label click did not check input");+ await until(() => getComputedStyle(controls[0]).backgroundColor !== "rgba(0, 0, 0, 0)", "checked fill missing");+ controls[0].parentElement.click(); await frame();+ check(!checked, "label click did not uncheck input");+ check(controls[1].indeterminate && getComputedStyle(controls[1], "::after").content !== "none", "mixed indicator missing");+ controls[2].parentElement.click(); check(controls[2].checked, "disabled selection changed");+ }+ controls[0].focus();+ window.checkboxKeyboardResult = async () => {+ await until(() => checked, "Space did not toggle checkbox");+ check(parseFloat(getComputedStyle(controls[0]).outlineWidth) >= 2, "keyboard focus ring missing");+ checkboxView.unmount(); node.remove(); return { passed: true };+ };+};`;test("S3 settings user path preserves credentials, modes, history and legacy data", {@@ -191,7 +284,8 @@ test("S3 settings user path preserves credentials, modes, history and legacy dat},nodePaths: [join(root, "apps/desktop/node_modules")],});- await writeFile(join(temp, "index.html"), '<!doctype html><meta charset="utf-8"><meta http-equiv="Content-Security-Policy" content="default-src \'self\'; style-src \'self\' \'unsafe-inline\'"><div id="root"></div><script type="module" src="renderer.js"></script>');+ await writeFile(join(temp, "styles.css"), (await loadStyles()).replace(/@theme(?: inline)?\s*\{/g, ":root {"));+ await writeFile(join(temp, "index.html"), '<!doctype html><meta charset="utf-8"><meta http-equiv="Content-Security-Policy" content="default-src \'self\'; style-src \'self\' \'unsafe-inline\'"><link rel="stylesheet" href="styles.css"><div id="root"></div><script type="module" src="renderer.js"></script>');await writeFile(join(temp, "main.cjs"), `const { app, BrowserWindow, session } = require("electron");const path = require("node:path");@@ -203,6 +297,10 @@ app.whenReady().then(async () => {try {await win.loadFile(path.join(__dirname, "index.html"));console.log("S3_SETTINGS_PROBE " + JSON.stringify(await win.webContents.executeJavaScript("window.configSyncProbe()")));+ await win.webContents.executeJavaScript("window.checkboxProbe()");+ win.webContents.sendInputEvent({ type: "keyDown", keyCode: "Space" });+ win.webContents.sendInputEvent({ type: "keyUp", keyCode: "Space" });+ console.log("CHECKBOX_PROBE " + JSON.stringify(await win.webContents.executeJavaScript("window.checkboxKeyboardResult()")));app.exit(0);} catch (error) { console.error(error?.stack ?? error); app.exit(1); }});`);@@ -219,5 +317,6 @@ app.whenReady().then(async () => {finally { clearTimeout(timer); }assert.equal(code, 0, output.slice(-6000));assert.match(output, /S3_SETTINGS_PROBE \{"passed":true\}/);+ assert.match(output, /CHECKBOX_PROBE \{"passed":true\}/);} finally { await rm(temp, { recursive: true, force: true }); }});diff --git a/docs/spec/03-runtime/22-config-sync.md b/docs/spec/03-runtime/22-config-sync.mdindex a7e4a1db7..e50127783 100644--- a/docs/spec/03-runtime/22-config-sync.md+++ b/docs/spec/03-runtime/22-config-sync.md@@ -193,6 +193,17 @@ history/restore, password rewrap, and disconnect. The renderer displaysand `error` as distinct states. Disconnect keeps local data and does not deleteremote data.+The page prioritizes status, last success, manual run, pause and inline unlock+above connection editing. Setup shows endpoint, bucket, access key ID, secret+key and vault password; region, prefix, addressing, device label and temporary+token live in a closed Advanced disclosure without changing their defaults.+Saved connections reopen collapsed; unfinished drafts reopen for editing.+Automatic runs use the shared switch. Category choices are available before+the first save inside connection settings, with credentials and memory still+opt-in. History, preview, mappings and security/connection maintenance expand+on demand; errors, manual progress and pending approvals stay visible.+Collapsing content does not reset form values or issue a Host request.+Reopening the page paints cached redacted state/history and a validated,non-sensitive draft, then refreshes in the background. The S3 draft key is`pi.desktop.configSyncS3Draft.v1`; old WebDAV drafts are ignored, not deleted.diff --git a/docs/spec/04-ux/06-settings-ia.md b/docs/spec/04-ux/06-settings-ia.mdindex 68c75c5d3..1f2e730ba 100644--- a/docs/spec/04-ux/06-settings-ia.md+++ b/docs/spec/04-ux/06-settings-ia.md@@ -204,15 +204,25 @@ Settings is a **full-window page** that replaces the app sidebar + main chrome (### Cloud sync-- **Connection**: S3 endpoint, region, private bucket, object prefix, access key- ID, secret access key, optional session token, addressing style, device label,- and separate backup/vault password. Choose two-way sync or backup-only mode- and whether runs are automatic. Connection testing uses random temporary- objects and requires reliable conditional writes; there is no fallback.-- **Portable configuration**: supported categories are selected by default;- credentials and project memory are explicit opt-ins. The preview reports- supported, excluded, secret-bearing, mapping-required, and pending-approval- counts.+- **Status first**: saved devices show current state, destination, last success+ and manual run above settings. Pause and inline password unlock remain+ reachable without expanding connection settings; errors, manual progress and+ pending activation are never hidden behind a disclosure.+- **Connection**: initial setup exposes endpoint, private bucket, access key+ ID, secret key and vault password. Mode uses the shared settings picker;+ automatic runs use `SettingsToggle`. Advanced settings (region, object+ prefix, addressing, device label and optional session token) start collapsed+ with unchanged defaults. Saved connections reopen collapsed, while unfinished+ drafts reopen for editing. Test and Save remain together at the form footer.+ Connection testing requires reliable conditional writes; no fallback exists.+- **Portable configuration**: a disclosure inside the same connection form+ allows category selection before initial setup and later edits. Supported+ categories are selected by default; credentials and memory remain explicit+ opt-ins, with the credential warning shown when selected. All checkboxes use+ the styled shared `Checkbox`, including disabled and mixed states.+- **Secondary tools**: history/restore, preview, mappings and security/connection+ maintenance start collapsed. Expanding does not perform a sync, save, or reset+ entered values. The preview retains its complete counts.- **Safety**: exported secrets and vault keys are never returned to the page.Connection secrets exist only in transient password controls. Importedexecutable/security-sensitive content keeps local approval and mapping.diff --git a/docs/spec/04-ux/07-ui-design-system.md b/docs/spec/04-ux/07-ui-design-system.mdindex 750abbcd7..a536995c5 100644--- a/docs/spec/04-ux/07-ui-design-system.md+++ b/docs/spec/04-ux/07-ui-design-system.md@@ -1289,13 +1289,27 @@ Implementation: `components/ui.tsx → Checkbox`.| Property | Value ||---|---|-| CSS class | `.ui-checkbox` |+| CSS classes | `.ui-checkbox` (label), `.ds-checkbox` (native input) || Anatomy | `<label> → <input type="checkbox"> + <span>{label}</span>` |-| Props | Extends `InputHTMLAttributes` (minus `type`) + `label: ReactNode` |+| Props | Extends `InputHTMLAttributes` (minus `type` and `ref`) + `label: ReactNode`, `indeterminate?: boolean` |+| Paint | 18px rounded square, 8px label gap, token-based checked fill and checkmark; mixed state uses a dash |+| Interaction | Native label activation and Space toggling, visible keyboard focus, whole-label disabled treatment; native paint in forced-colors mode |Every standalone labeled checkbox **must** use `Checkbox`. Inline`<label><input type="checkbox"/>…</label>` is prohibited.+### 11.11a SettingsDisclosure++Implementation: `components/settings/SettingsDisclosure.tsx`.++Use native `<details>` / `<summary>` for low-frequency settings, with one+localized title and a decorative chevron. It accepts native details attributes,+children and `className`; `open` can seed or update the native state. Collapsed+content stays mounted to retain drafts but is not keyboard-reachable. The+shared summary has a minimum 44px row, token-based hover/focus treatment and+reduced-motion-compatible chevron feedback. Errors, progress and approvals+must remain outside optional disclosures.+### 11.11b CheckboxGroupImplementation: `components/ui.tsx → CheckboxGroup<T>`.diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.mdindex 738fb3e94..a38799e83 100644--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@ -9516,9 +9516,12 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.1. Confirm Cloud sync remains development-build-only and has no Experimentalbadge. Open Settings and confirm only the new S3 setup is offered;old formats are not detected, migrated or deleted.- 2. Enter endpoint, region, private bucket, prefix, access key, secret key,- optional session token and addressing style. Test conditional creation,- readback, matching update, stale-write rejection and probe cleanup.+ 2. Confirm initial setup shows only required connection/password fields and+ automatic runs use the shared switch. Expand Advanced to edit region,+ prefix, addressing, device label and optional token; collapse/reopen it+ without losing values. Select categories before the first save, keeping+ credentials/memory opt-in. Test conditional creation, readback, matching+ update, stale-write rejection and probe cleanup.Reject ignored preconditions, weak ETags, redirects, public HTTP and 403;never interpret 502 as a missing object. LAN HTTP follows network policy.3. Configure two sync devices. Publish a provider and mapped packaged skill,@@ -9541,6 +9544,12 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.replacement. Invalidate history on destination/mode changes and ignoreoutstanding responses from the old connection. Unsaved mode changes mustnot alter restore confirmation or propagation flags.+ Saved connections reopen collapsed while status, manual run and inline+ unlock remain visible above them. Open History and Security/connection+ to restore, change password or disconnect. Pending approvals and errors+ remain visible. At narrow content widths the form becomes one column+ without horizontal overflow. In light/dark themes, activate shared+ checkboxes by label and Space; verify focus, disabled and mixed states.7. Restart an isolated Host and verify persisted state, then disconnect withoutdeleting unrelated data. Inspect remote object bytes for known fixtureplaintext and verify there is no automatic immutable-object GC.@@ -9560,7 +9569,8 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.- **Automation:** `pnpm test:e2e:config-sync` is the multi-Host harness.Rust `config_sync::` and `user_skills::` suites cover transport, merge,application and resource safety. `config-sync-user-path.test.mjs` runs the- real settings page with a mocked external IPC boundary and no network;+ real settings page and shared checkbox with a mocked external IPC boundary,+ actual styles and isolated Electron input, without network access;`config-sync-ipc.test.mjs` covers Main notification shape. Visibility remainscovered by `settings-developer-only-destinations.test.mjs`.- **Specs:** `03-runtime/22-config-sync.md`, `04-ux/06-settings-ia.md`,diff --git a/docs/zh-CN/spec/04-ux/07-ui-design-system.md b/docs/zh-CN/spec/04-ux/07-ui-design-system.mdindex a7916732b..f50b378d4 100644--- a/docs/zh-CN/spec/04-ux/07-ui-design-system.md+++ b/docs/zh-CN/spec/04-ux/07-ui-design-system.md@@ -1114,13 +1114,27 @@ Linux 保留淡入淡出和滑动退出。| 属性 | 值 ||---|---|-| CSS 类 | `.ui-checkbox` |-| 结构 | `<label> → <input type="checkbox"> + <span>{label}</span>` |-| 属性 | 扩展 `InputHTMLAttributes`(排除 `type`),并提供 `label: ReactNode` |+| CSS classes | `.ui-checkbox` (label), `.ds-checkbox` (native input) |+| Anatomy | `<label> → <input type="checkbox"> + <span>{label}</span>` |+| Props | Extends `InputHTMLAttributes` (minus `type` and `ref`) + `label: ReactNode`, `indeterminate?: boolean` |+| Paint | 18px rounded square, 8px label gap, token-based checked fill and checkmark; mixed state uses a dash |+| Interaction | Native label activation and Space toggling, visible keyboard focus, whole-label disabled treatment; native paint in forced-colors mode |独立的带标签复选框必须使用 `Checkbox`;不得手写`<label><input type="checkbox"/>…</label>`。+### 11.11a SettingsDisclosure++Implementation: `components/settings/SettingsDisclosure.tsx`.++Use native `<details>` / `<summary>` for low-frequency settings, with one+localized title and a decorative chevron. It accepts native details attributes,+children and `className`; `open` can seed or update the native state. Collapsed+content stays mounted to retain drafts but is not keyboard-reachable. The+shared summary has a minimum 44px row, token-based hover/focus treatment and+reduced-motion-compatible chevron feedback. Errors, progress and approvals+must remain outside optional disclosures.+### 11.11b CheckboxGroup实现:`components/ui.tsx → CheckboxGroup<T>`。diff --git a/packages/i18n/src/locales/de/index.ts b/packages/i18n/src/locales/de/index.tsindex 2807b4cef..378496249 100644--- a/packages/i18n/src/locales/de/index.ts+++ b/packages/i18n/src/locales/de/index.ts@@ -803,8 +803,10 @@ sklm: {},"configSync": {title: "Cloud sync",- connectionTitle: "S3-Konfigurationssicherung und Synchronisierung",- connectionDescription: "Portable Konfiguration verschlüsselt in einem privaten S3-Bucket speichern. Chats, Quelldateien und Laufzeitdaten bleiben lokal.",+ connectionTitle: "Verbindungseinstellungen",+ connectionDescription: "App-Einstellungen zwischen Geräten synchronisieren oder im privaten S3-Speicher sichern. Chats und Projektdateien bleiben lokal.",+ advancedTitle: "Erweiterte Einstellungen",+ maintenanceTitle: "Sicherheit und Verbindung",errorTitle: "Sync needs attention",errorDetails: "Technical details",backupPasswordOptional: "Leave this blank to keep the current vault password.",diff --git a/packages/i18n/src/locales/en/index.ts b/packages/i18n/src/locales/en/index.tsindex c5460166c..5018f9e52 100644--- a/packages/i18n/src/locales/en/index.ts+++ b/packages/i18n/src/locales/en/index.ts@@ -1085,8 +1085,10 @@ sklm: {},configSync: {title: "Cloud sync",- connectionTitle: "S3 configuration backup and sync",- connectionDescription: "Encrypt portable configuration in a private S3-compatible bucket. Chats, source files, and runtime state are excluded.",+ connectionTitle: "Connection settings",+ connectionDescription: "Sync app settings across devices or back them up to your private S3 storage. Chats and project files stay local.",+ advancedTitle: "Advanced settings",+ maintenanceTitle: "Security and connection",errorTitle: "Sync needs attention",errorDetails: "Technical details",backupPasswordOptional: "Leave this blank to keep the current vault password.",diff --git a/packages/i18n/src/locales/es/index.ts b/packages/i18n/src/locales/es/index.tsindex 6616e6740..f0a4bdc7f 100644--- a/packages/i18n/src/locales/es/index.ts+++ b/packages/i18n/src/locales/es/index.ts@@ -803,8 +803,10 @@ sklm: {},"configSync": {title: "Cloud sync",- connectionTitle: "Copia de configuración y sincronización S3",- connectionDescription: "Cifra la configuración portátil en un bucket S3 privado. No incluye conversaciones, archivos fuente ni estado de ejecución.",+ connectionTitle: "Configuración de conexión",+ connectionDescription: "Sincroniza los ajustes entre dispositivos o guárdalos en tu almacenamiento S3 privado. Los chats y archivos del proyecto permanecen locales.",+ advancedTitle: "Configuración avanzada",+ maintenanceTitle: "Seguridad y conexión",errorTitle: "Sync needs attention",errorDetails: "Technical details",backupPasswordOptional: "Leave this blank to keep the current vault password.",diff --git a/packages/i18n/src/locales/fr/index.ts b/packages/i18n/src/locales/fr/index.tsindex 5e038aa97..d7f63a606 100644--- a/packages/i18n/src/locales/fr/index.ts+++ b/packages/i18n/src/locales/fr/index.ts@@ -803,8 +803,10 @@ sklm: {},"configSync": {title: "Cloud sync",- connectionTitle: "Sauvegarde et synchronisation S3",- connectionDescription: "Chiffrez la configuration portable dans un compartiment S3 privé. Conversations, fichiers sources et état d’exécution sont exclus.",+ connectionTitle: "Paramètres de connexion",+ connectionDescription: "Synchronisez les paramètres entre appareils ou sauvegardez-les dans votre stockage S3 privé. Les conversations et fichiers de projet restent locaux.",+ advancedTitle: "Paramètres avancés",+ maintenanceTitle: "Sécurité et connexion",errorTitle: "Sync needs attention",errorDetails: "Technical details",backupPasswordOptional: "Leave this blank to keep the current vault password.",diff --git a/packages/i18n/src/locales/ko/index.ts b/packages/i18n/src/locales/ko/index.tsindex 79f369e9e..1052616a6 100644--- a/packages/i18n/src/locales/ko/index.ts+++ b/packages/i18n/src/locales/ko/index.ts@@ -811,8 +811,10 @@ sklm: {},configSync: {title: "Cloud sync",- connectionTitle: "S3 설정 백업 및 동기화",- connectionDescription: "이식 가능한 설정을 비공개 S3 버킷에 암호화하여 저장합니다. 대화, 소스 파일, 런타임 상태는 제외됩니다.",+ connectionTitle: "연결 설정",+ connectionDescription: "기기 간 앱 설정을 동기화하거나 비공개 S3 저장소에 백업합니다. 대화와 프로젝트 파일은 로컬에 유지됩니다.",+ advancedTitle: "고급 설정",+ maintenanceTitle: "보안 및 연결",errorTitle: "Sync needs attention",errorDetails: "Technical details",backupPasswordOptional: "Leave this blank to keep the current vault password.",diff --git a/packages/i18n/src/locales/pt-BR/index.ts b/packages/i18n/src/locales/pt-BR/index.tsindex a81092512..adc21d75b 100644--- a/packages/i18n/src/locales/pt-BR/index.ts+++ b/packages/i18n/src/locales/pt-BR/index.ts@@ -1053,8 +1053,10 @@ export const ptBR = {},configSync: {title: "Sincronização na nuvem",- connectionTitle: "Backup e sincronização de configurações via S3",- connectionDescription: "Criptografe configurações portáteis em um bucket S3 privado. Conversas, arquivos-fonte e estado de execução são excluídos.",+ connectionTitle: "Configurações de conexão",+ connectionDescription: "Sincronize as configurações entre dispositivos ou faça backup no seu armazenamento S3 privado. Conversas e arquivos do projeto ficam locais.",+ advancedTitle: "Configurações avançadas",+ maintenanceTitle: "Segurança e conexão",errorTitle: "A sincronização requer atenção",errorDetails: "Detalhes técnicos",backupPasswordOptional: "Deixe em branco para manter a senha atual do cofre.",diff --git a/packages/i18n/src/locales/tr/index.ts b/packages/i18n/src/locales/tr/index.tsindex 51c3681f3..b2c6ac92a 100644--- a/packages/i18n/src/locales/tr/index.ts+++ b/packages/i18n/src/locales/tr/index.ts@@ -811,8 +811,10 @@ sklm: {},configSync: {title: "Bulut senkronizasyonu",- connectionTitle: "S3 yapılandırma yedekleme ve senkronizasyonu",- connectionDescription: "Taşınabilir yapılandırmayı özel bir S3 kovasında şifreleyin. Sohbetler, kaynak dosyaları ve çalışma zamanı durumu dahil edilmez.",+ connectionTitle: "Bağlantı ayarları",+ connectionDescription: "Uygulama ayarlarını cihazlar arasında eşitleyin veya özel S3 depolamanıza yedekleyin. Sohbetler ve proje dosyaları yerel kalır.",+ advancedTitle: "Gelişmiş ayarlar",+ maintenanceTitle: "Güvenlik ve bağlantı",errorTitle: "Senkronizasyon dikkat gerektiriyor",errorDetails: "Teknik ayrıntılar",backupPasswordOptional: "Geçerli kasa parolasını korumak için bunu boş bırakın.",diff --git a/packages/i18n/src/locales/zh-CN/index.ts b/packages/i18n/src/locales/zh-CN/index.tsindex ee94d4565..4ccab7dd5 100644--- a/packages/i18n/src/locales/zh-CN/index.ts+++ b/packages/i18n/src/locales/zh-CN/index.ts@@ -802,8 +802,10 @@ sklm: {},configSync: {title: "云同步",- connectionTitle: "S3 配置备份与同步",- connectionDescription: "将可移植配置加密保存到私有 S3 兼容存储桶,不包含聊天记录、源文件和运行时状态。",+ connectionTitle: "连接设置",+ connectionDescription: "在设备间同步应用配置,或备份到你的私有 S3 存储。不包含聊天记录和项目文件。",+ advancedTitle: "高级设置",+ maintenanceTitle: "安全与连接管理",errorTitle: "同步需要处理",errorDetails: "技术详情",backupPasswordOptional: "留空则保留当前保管库密码。",diff --git a/packages/i18n/src/locales/zh-TW/index.ts b/packages/i18n/src/locales/zh-TW/index.tsindex eb4d0819d..e76832870 100644--- a/packages/i18n/src/locales/zh-TW/index.ts+++ b/packages/i18n/src/locales/zh-TW/index.ts@@ -802,8 +802,10 @@ sklm: {},configSync: {title: "雲端同步",- connectionTitle: "S3 設定備份與同步",- connectionDescription: "將可攜式設定加密儲存到私有 S3 相容儲存桶,不包含聊天記錄、原始碼和執行階段狀態。",+ connectionTitle: "連線設定",+ connectionDescription: "在裝置間同步應用程式設定,或備份到你的私有 S3 儲存空間。不包含聊天記錄和專案檔案。",+ advancedTitle: "進階設定",+ maintenanceTitle: "安全與連線管理",errorTitle: "同步需要處理",errorDetails: "技術詳情",backupPasswordOptional: "留空則保留目前的保管庫密碼。",