From b74f645541bef260a7db2c7bd246b4d8a0e9ac0e Mon Sep 17 00:00:00 2001 From: Cyrus Gray <144336577+graycyrus@users.noreply.github.com> Date: Fri, 26 Jun 2026 17:57:00 +0530 Subject: [PATCH] style(settings): normalize spacing and controls to shared design system (#4162) --- .../components/settings/panels/AIPanel.tsx | 8 +- .../components/settings/panels/AboutPanel.tsx | 8 +- .../settings/panels/AccountPanel.tsx | 23 ++- .../settings/panels/AgentBoxPanel.tsx | 94 +++++---- .../settings/panels/AgentChatPanel.tsx | 55 +++--- .../settings/panels/AnalysisViewsPanel.tsx | 4 +- .../settings/panels/EmbeddingsPanel.tsx | 2 +- .../settings/panels/MascotPanel.tsx | 10 +- .../settings/panels/McpServerPanel.tsx | 2 +- .../settings/panels/MemoryDataPanel.tsx | 10 +- .../settings/panels/MemoryDebugPanel.tsx | 2 +- .../settings/panels/MigrationPanel.tsx | 4 +- .../panels/NotificationRoutingPanel.tsx | 14 +- .../settings/panels/PermissionsPanel.tsx | 9 +- .../panels/ProfileEditorPage.test.tsx | 5 + .../settings/panels/ProfileEditorPage.tsx | 26 ++- .../settings/panels/ProfilesPanel.tsx | 2 +- .../settings/panels/RecoveryPhrasePanel.tsx | 4 +- .../panels/ScreenAwarenessDebugPanel.tsx | 32 +-- .../panels/ScreenIntelligencePanel.tsx | 57 +++--- .../settings/panels/SearchPanel.tsx | 2 +- .../settings/panels/SystemDiagnostics.tsx | 2 +- .../panels/ToolPolicyDiagnosticsPanel.tsx | 14 +- .../components/settings/panels/UsagePanel.tsx | 2 +- .../components/settings/panels/VoicePanel.tsx | 2 +- .../panels/__tests__/AccountPanel.test.tsx | 61 ++++++ .../panels/__tests__/MemoryDataPanel.test.tsx | 11 ++ .../NotificationRoutingPanel.test.tsx | 57 ++++++ .../ScreenIntelligencePanel.test.tsx | 18 +- .../PermissionsSection.tsx | 183 +++++++++--------- .../__tests__/PermissionsSection.test.tsx | 130 +++++++++++++ 31 files changed, 563 insertions(+), 290 deletions(-) create mode 100644 app/src/components/settings/panels/__tests__/AccountPanel.test.tsx create mode 100644 app/src/components/settings/panels/__tests__/NotificationRoutingPanel.test.tsx create mode 100644 app/src/components/settings/panels/screen-intelligence/__tests__/PermissionsSection.test.tsx diff --git a/app/src/components/settings/panels/AIPanel.tsx b/app/src/components/settings/panels/AIPanel.tsx index 5b0e6b346..f8579206a 100644 --- a/app/src/components/settings/panels/AIPanel.tsx +++ b/app/src/components/settings/panels/AIPanel.tsx @@ -3142,12 +3142,12 @@ const AIPanel = ({ embedded = false }: AIPanelProps = {}) => { contentClassName="" description={embedded ? undefined : t('pages.settings.ai.llmDesc')} leading={embedded ? undefined : }> -
+
{/* ═══════════════════════════════════════════════════════════════ AUTH — provider authentication (cloud providers + local Ollama setup). Everything the user needs to wire a model up. ═══════════════════════════════════════════════════════════════ */} -
+

{t('settings.ai.llmProviders')} @@ -3174,7 +3174,7 @@ const AIPanel = ({ embedded = false }: AIPanelProps = {}) => { )} -
+
{ Own = one provider/model for everything. Custom = fine-grained per-workload routing. ═══════════════════════════════════════════════════════════════ */} -
+

{t('settings.ai.routing')}

{t('settings.ai.routingDesc')}

diff --git a/app/src/components/settings/panels/AboutPanel.tsx b/app/src/components/settings/panels/AboutPanel.tsx index 556a7519c..4b57dbde1 100644 --- a/app/src/components/settings/panels/AboutPanel.tsx +++ b/app/src/components/settings/panels/AboutPanel.tsx @@ -69,7 +69,7 @@ const AboutPanel = () => { {/* Version */} -
+
{t('settings.about.version')}
v{APP_VERSION}
{info?.available && info.available_version && ( @@ -97,7 +97,7 @@ const AboutPanel = () => { } /> {lastCheckedAt && ( -
+
{t('settings.about.lastChecked')} {formatRelative(lastCheckedAt, t)}
)} @@ -127,7 +127,7 @@ const AboutPanel = () => { } /> -
+

{coreMode.kind === 'cloud' ? t('settings.about.connectionHelperCloud') @@ -138,7 +138,7 @@ const AboutPanel = () => { {/* Releases */} -

+
{t('settings.about.releases')}

{t('settings.about.releasesDesc')} diff --git a/app/src/components/settings/panels/AccountPanel.tsx b/app/src/components/settings/panels/AccountPanel.tsx index 8949afccc..ecd747039 100644 --- a/app/src/components/settings/panels/AccountPanel.tsx +++ b/app/src/components/settings/panels/AccountPanel.tsx @@ -1,5 +1,6 @@ import { useT } from '../../../lib/i18n/I18nContext'; import { useCoreState } from '../../../providers/CoreStateProvider'; +import { SettingsSection } from '../controls'; import SettingsPanel from '../layout/SettingsPanel'; import LogoutAndClearActions from '../LogoutAndClearActions'; @@ -22,20 +23,22 @@ const AccountPanel = () => { testId="account-panel" description={t('pages.settings.accountSection.description')}> {(name || username) && ( -

-
- {(name ?? username ?? '?').replace('@', '').slice(0, 1).toUpperCase()} + +
+
+ {(name ?? username ?? '?').replace('@', '').slice(0, 1).toUpperCase()} +
+
+ {name &&
{name}
} + {username &&
{username}
} +
-
- {name &&
{name}
} - {username &&
{username}
} -
-
+ )} -
+ -
+ ); }; diff --git a/app/src/components/settings/panels/AgentBoxPanel.tsx b/app/src/components/settings/panels/AgentBoxPanel.tsx index ce52fa6bf..bdfe52dda 100644 --- a/app/src/components/settings/panels/AgentBoxPanel.tsx +++ b/app/src/components/settings/panels/AgentBoxPanel.tsx @@ -9,7 +9,8 @@ import { useCallback, useEffect, useMemo, useState } from 'react'; import { useT } from '../../../lib/i18n/I18nContext'; import { callCoreRpc } from '../../../services/coreRpcClient'; -import { SettingsStatusLine } from '../controls'; +import Button from '../../ui/Button'; +import { SettingsRow, SettingsSection, SettingsStatusLine } from '../controls'; import SettingsPanel from '../layout/SettingsPanel'; interface AgentBoxProviderInfo { @@ -29,9 +30,6 @@ type PanelState = | { kind: 'ready'; status: AgentBoxStatus } | { kind: 'error'; message: string }; -const ROW = - 'px-4 py-3 rounded-lg border border-sage-300 dark:border-sage-500/40 bg-surface dark:bg-sage-900/20'; - const AgentBoxPanel = () => { const { t } = useT(); @@ -81,59 +79,57 @@ const AgentBoxPanel = () => { const modeLabel = s.mode_enabled ? t('common.enabled') : t('common.disabled'); return ( -
+
{t('settings.agentbox.intro')}
-
-
- - {t('settings.agentbox.modeLabel')} - - - {modeLabel} - -
-
+ + + {modeLabel} + + } + /> + -
-
- {t('settings.agentbox.providerHeading')} + +
+ {s.provider_configured && s.provider ? ( +
+
{t('settings.agentbox.slug')}
+
+ {s.provider.slug} +
+
+ {t('settings.agentbox.baseUrl')} +
+
+ {s.provider.base_url} +
+
{t('settings.agentbox.model')}
+
+ {s.provider.model} +
+
+ ) : ( +
+ {t('settings.agentbox.notConfigured')} +
+ )}
- {s.provider_configured && s.provider ? ( -
-
{t('settings.agentbox.slug')}
-
- {s.provider.slug} -
-
{t('settings.agentbox.baseUrl')}
-
- {s.provider.base_url} -
-
{t('settings.agentbox.model')}
-
- {s.provider.model} -
-
- ) : ( -
- {t('settings.agentbox.notConfigured')} -
- )} -
+ - +
); }, [state, t, load]); diff --git a/app/src/components/settings/panels/AgentChatPanel.tsx b/app/src/components/settings/panels/AgentChatPanel.tsx index 8bf42a3a0..df18cd9cf 100644 --- a/app/src/components/settings/panels/AgentChatPanel.tsx +++ b/app/src/components/settings/panels/AgentChatPanel.tsx @@ -5,6 +5,7 @@ import { openhumanAgentChat } from '../../../utils/tauriCommands'; import Button from '../../ui/Button'; import { SettingsEmptyState, + SettingsRow, SettingsSection, SettingsStatusLine, SettingsTextArea, @@ -82,31 +83,35 @@ const AgentChatPanel = () => { return ( -
-
- - setModelOverride(event.target.value)} - aria-label={t('chat.model')} - /> -
-
- - setTemperature(event.target.value)} - aria-label={t('chat.temperature')} - /> -
+
+ setModelOverride(event.target.value)} + aria-label={t('chat.model')} + /> + } + /> + setTemperature(event.target.value)} + aria-label={t('chat.temperature')} + /> + } + />
diff --git a/app/src/components/settings/panels/AnalysisViewsPanel.tsx b/app/src/components/settings/panels/AnalysisViewsPanel.tsx index 7b3293812..929172456 100644 --- a/app/src/components/settings/panels/AnalysisViewsPanel.tsx +++ b/app/src/components/settings/panels/AnalysisViewsPanel.tsx @@ -54,12 +54,12 @@ const AnalysisViewsPanel = () => { contentClassName="" description={t('settings.analysisViews.menuDesc')} leading={}> -
+
items={views.map(view => ({ id: view.id, label: view.label }))} value={activeView} onChange={setActiveView} - className="flex flex-wrap gap-2 pb-1" + className="flex flex-wrap gap-1.5 pb-1" /> {activeView === 'diagram' && } diff --git a/app/src/components/settings/panels/EmbeddingsPanel.tsx b/app/src/components/settings/panels/EmbeddingsPanel.tsx index 152bbcfd3..8485ffb5b 100644 --- a/app/src/components/settings/panels/EmbeddingsPanel.tsx +++ b/app/src/components/settings/panels/EmbeddingsPanel.tsx @@ -394,7 +394,7 @@ const EmbeddingsPanel = ({ embedded = false }: EmbeddingsPanelProps = {}) => { contentClassName="" description={embedded ? undefined : t('pages.settings.ai.embeddingsDesc')} leading={embedded ? undefined : }> -
+

{t('settings.embeddings.description')}

diff --git a/app/src/components/settings/panels/MascotPanel.tsx b/app/src/components/settings/panels/MascotPanel.tsx index dafa43d04..1d59b91b0 100644 --- a/app/src/components/settings/panels/MascotPanel.tsx +++ b/app/src/components/settings/panels/MascotPanel.tsx @@ -41,7 +41,7 @@ import { SUPPORTED_MASCOT_COLORS, } from '../../../store/mascotSlice'; import Button from '../../ui/Button'; -import { SettingsTextField } from '../controls'; +import { SettingsSelect, SettingsTextField } from '../controls'; import SettingsPanel from '../layout/SettingsPanel'; import { defaultVoiceIdForLocale, @@ -479,20 +479,20 @@ const MascotPanel = ({ embedded = false }: MascotPanelProps) => { {t('settings.mascot.voice.presetHeading')} - + {isCustomVoice && ( @@ -734,7 +734,7 @@ const MascotPanel = ({ embedded = false }: MascotPanelProps) => { // Embedded inside the tabbed Personality & Face page: the parent owns the // header, so render just the padded body. - if (embedded) return
{body}
; + if (embedded) return
{body}
; return {body}; }; diff --git a/app/src/components/settings/panels/McpServerPanel.tsx b/app/src/components/settings/panels/McpServerPanel.tsx index da9b93adf..a8c4f5a12 100644 --- a/app/src/components/settings/panels/McpServerPanel.tsx +++ b/app/src/components/settings/panels/McpServerPanel.tsx @@ -177,7 +177,7 @@ const McpServerPanel = ({ embedded = false }: McpServerPanelProps = {}) => { title={t('settings.mcpServer.toolsSectionTitle')} description={t('settings.mcpServer.toolsSectionDesc')}> {MCP_TOOLS.map(tool => ( -
+
{tool.name} diff --git a/app/src/components/settings/panels/MemoryDataPanel.tsx b/app/src/components/settings/panels/MemoryDataPanel.tsx index 90acee146..f506e1203 100644 --- a/app/src/components/settings/panels/MemoryDataPanel.tsx +++ b/app/src/components/settings/panels/MemoryDataPanel.tsx @@ -8,6 +8,7 @@ import { VaultHealthChecklist } from '../../intelligence/VaultHealthChecklist'; import PanelPage from '../../layout/PanelPage'; import MemoryWindowControl from '../components/MemoryWindowControl'; import SettingsBackButton from '../components/SettingsBackButton'; +import { SettingsSection } from '../controls'; import { useSettingsNavigation } from '../hooks/useSettingsNavigation'; interface MemoryDataPanelProps { @@ -54,10 +55,9 @@ const MemoryDataPanel = ({ embedded = false }: MemoryDataPanelProps = {}) => { contentClassName="" description={embedded ? undefined : t('devOptions.memoryInspectionDesc')} leading={embedded ? undefined : }> -
-
-

{t('memoryData.howItWorks')}

-
+
+ +
{t('memoryData.workspaceVault')} @@ -83,7 +83,7 @@ const MemoryDataPanel = ({ embedded = false }: MemoryDataPanelProps = {}) => {
-
+ diff --git a/app/src/components/settings/panels/MemoryDebugPanel.tsx b/app/src/components/settings/panels/MemoryDebugPanel.tsx index 1f7bc33e1..14f43f99a 100644 --- a/app/src/components/settings/panels/MemoryDebugPanel.tsx +++ b/app/src/components/settings/panels/MemoryDebugPanel.tsx @@ -203,7 +203,7 @@ const MemoryDebugPanel = () => { testId="memory-debug-panel" description={t('devOptions.debugPanelsDesc')} leading={}> -
+
{/* Documents */}
diff --git a/app/src/components/settings/panels/MigrationPanel.tsx b/app/src/components/settings/panels/MigrationPanel.tsx index 675e61634..eba9eb717 100644 --- a/app/src/components/settings/panels/MigrationPanel.tsx +++ b/app/src/components/settings/panels/MigrationPanel.tsx @@ -137,7 +137,7 @@ const MigrationPanel = ({ embedded = false }: MigrationPanelProps = {}) => {

{t('migration.description')}

-
+
-