From a0764b9c962b404e34a57a0bd791e3781a0b2ad6 Mon Sep 17 00:00:00 2001 From: Maurice Date: Fri, 13 Nov 2026 23:10:05 +0000 Subject: [PATCH] fix(settings): the checks the settings redesign left red The phone's MCP card still read the config fold state that the shared hook no longer holds, so the client failed to typecheck. The phone keeps its folded config, so it now holds that state itself. SettingsColumns takes start and end instead of left and right: the prop types counted as two physical sides for lint:rtl, and in a right-to-left language the first column is the right one anyway. Also: an unused icon import, seven files outside the format baseline run through Prettier, Routing (de) and Services (fr) confirmed as the same word as in English, and the size and warning baselines lowered to what the redesign left (AdminPluginsPanel one wrapped line shorter, two promise warnings, one long function and two non-null assertions in tests fewer). --- client/scripts/eslint-baseline.json | 6 +++--- client/scripts/size-baseline.json | 2 +- client/src/components/Admin/AddonManager.tsx | 5 ++--- .../components/Admin/AdminMcpTokensPanel.tsx | 4 ++-- .../Admin/DefaultUserSettingsTab.tsx | 4 ++-- .../components/Admin/ServiceIdentityPanel.tsx | 3 ++- .../components/Admin/addons/AiAdminConfig.tsx | 6 +----- .../Admin/addons/ParsingSettings.tsx | 7 +------ .../Admin/storage/AdminStoragePanel.tsx | 4 ++-- .../Admin/storage/StorageReclaimSection.tsx | 7 +------ client/src/components/Settings/AccountTab.tsx | 4 ++-- .../Settings/AppearanceSettingsTab.tsx | 4 ++-- .../Settings/DisplaySettingsTab.tsx | 4 ++-- .../components/Settings/IntegrationsTab.tsx | 4 ++-- client/src/components/Settings/OfflineTab.tsx | 4 ++-- .../Settings/WandererConnectionSection.tsx | 1 - .../components/Settings/WandererWatchRow.tsx | 7 +------ .../Settings/ai/AiConnectionSection.tsx | 20 +++---------------- .../src/components/Settings/settingsKit.tsx | 9 +++++---- .../mobile/screens/settings/MSettingsMcp.tsx | 9 ++++----- .../src/pages/admin/AdminNotificationsTab.tsx | 4 ++-- client/src/pages/admin/AdminSettingsTab.tsx | 10 +++++----- shared/src/i18n/de/admin.ts | 2 +- shared/src/i18n/fr/admin.ts | 2 +- 24 files changed, 49 insertions(+), 83 deletions(-) diff --git a/client/scripts/eslint-baseline.json b/client/scripts/eslint-baseline.json index 24d45e507..9ed3db742 100644 --- a/client/scripts/eslint-baseline.json +++ b/client/scripts/eslint-baseline.json @@ -1,7 +1,7 @@ { "src": { "@typescript-eslint/no-non-null-assertion": 375, - "@typescript-eslint/no-misused-promises": 840, + "@typescript-eslint/no-misused-promises": 838, "no-console": 88, "complexity": 218, "@typescript-eslint/no-explicit-any": 143, @@ -14,7 +14,7 @@ "react-hooks/exhaustive-deps": 114, "@typescript-eslint/no-unused-vars": 122, "react-hooks/immutability": 28, - "max-lines-per-function": 130, + "max-lines-per-function": 129, "react-hooks/static-components": 50, "react-hooks/preserve-manual-memoization": 12, "no-useless-assignment": 7, @@ -35,7 +35,7 @@ }, "tests": { "@typescript-eslint/no-explicit-any": 489, - "@typescript-eslint/no-non-null-assertion": 1907, + "@typescript-eslint/no-non-null-assertion": 1905, "@typescript-eslint/no-misused-promises": 22, "@typescript-eslint/no-unused-vars": 51, "@typescript-eslint/no-floating-promises": 33, diff --git a/client/scripts/size-baseline.json b/client/scripts/size-baseline.json index 3d3878d81..0a2e6a704 100644 --- a/client/scripts/size-baseline.json +++ b/client/scripts/size-baseline.json @@ -2,7 +2,7 @@ "e2e/help/fixtures.ts": 2291, "src/api/client.ts": 1873, "src/components/Admin/AdminPluginsPanel.test.tsx": 2704, - "src/components/Admin/AdminPluginsPanel.tsx": 1266, + "src/components/Admin/AdminPluginsPanel.tsx": 1265, "src/components/Budget/CostsPanel.test.tsx": 2725, "src/components/Budget/CostsPanel.tsx": 1607, "src/components/Map/MapView.tsx": 1200, diff --git a/client/src/components/Admin/AddonManager.tsx b/client/src/components/Admin/AddonManager.tsx index 623f93b56..591b78e5b 100644 --- a/client/src/components/Admin/AddonManager.tsx +++ b/client/src/components/Admin/AddonManager.tsx @@ -204,8 +204,7 @@ export default function AddonManager({ bagTrackingEnabled, onToggleBagTracking, /* A card per type, the way every other admin tab sets its cards: Trip in the left column, Global and Integration in the right one, each card with the - dialogs' head band carrying the type, its count and what it means. Above - them one card says how many are on and finds an addon by name. */ + dialogs' head band carrying the type, its count and what it means. */ const groups = [ { key: 'trip', addons: tripAddons }, { key: 'global', addons: globalAddons }, @@ -252,5 +251,5 @@ export default function AddonManager({ bagTrackingEnabled, onToggleBagTracking, ) } - return {cards.end}{aside}} /> + return {cards.end}{aside}} /> } diff --git a/client/src/components/Admin/AdminMcpTokensPanel.tsx b/client/src/components/Admin/AdminMcpTokensPanel.tsx index ed45dc2c6..5e0aa41b5 100644 --- a/client/src/components/Admin/AdminMcpTokensPanel.tsx +++ b/client/src/components/Admin/AdminMcpTokensPanel.tsx @@ -74,7 +74,7 @@ export default function AdminMcpTokensPanel() {
{/* The sessions and the tokens side by side: two lists of the same kind. */} + start={<> {/* OAuth Sessions. The tab's own subtitle sits in its band: the sidebar already names the tab, so a bare heading over the cards only repeated it. */} } - right={<> + end={<> {/* MCP Tokens */}
@@ -223,7 +223,7 @@ export default function DefaultUserSettingsTab(): React.ReactElement { )} } - right={ + end={
{/* Map Tile URL */} {t('settings.mapTemplate')}} hint={t('settings.mapDefaultHint')}> diff --git a/client/src/components/Admin/ServiceIdentityPanel.tsx b/client/src/components/Admin/ServiceIdentityPanel.tsx index ff438c2d7..ce448f2d5 100644 --- a/client/src/components/Admin/ServiceIdentityPanel.tsx +++ b/client/src/components/Admin/ServiceIdentityPanel.tsx @@ -92,7 +92,8 @@ function ServiceTile({ allowance }: { allowance: ServiceAllowance }) { title={`${t('admin.trekApi.quota.remaining')}: ${number.format(quota.remaining)}`} > {number.format(quota.used)} - {' / '}{number.format(quota.limit)} + {' / '} + {number.format(quota.limit)} )} diff --git a/client/src/components/Admin/addons/AiAdminConfig.tsx b/client/src/components/Admin/addons/AiAdminConfig.tsx index a89567eda..e648c93be 100644 --- a/client/src/components/Admin/addons/AiAdminConfig.tsx +++ b/client/src/components/Admin/addons/AiAdminConfig.tsx @@ -124,11 +124,7 @@ function InstanceConnection({ A }: { A: AiAdmin }) { )} {replacing && ( - )} diff --git a/client/src/components/Admin/addons/ParsingSettings.tsx b/client/src/components/Admin/addons/ParsingSettings.tsx index 23e1b341c..871140362 100644 --- a/client/src/components/Admin/addons/ParsingSettings.tsx +++ b/client/src/components/Admin/addons/ParsingSettings.tsx @@ -160,12 +160,7 @@ function LocalModels({ P }: { P: Parsing }) { {m.recommended && {t('assistant.model.recommended')}} {here ? ( - diff --git a/client/src/components/Admin/storage/AdminStoragePanel.tsx b/client/src/components/Admin/storage/AdminStoragePanel.tsx index 93e943bc3..922283619 100644 --- a/client/src/components/Admin/storage/AdminStoragePanel.tsx +++ b/client/src/components/Admin/storage/AdminStoragePanel.tsx @@ -138,7 +138,7 @@ export default function AdminStoragePanel(): React.ReactElement { {/* Two columns by length: the health and the backends on the left, which category goes where on the right, its save bar at the card's foot. */} + start={<>
{state.health.replicaFailures.length === 0 ? (

@@ -493,7 +493,7 @@ export default function AdminStoragePanel(): React.ReactElement { onDelete={(enabled) => void handleReclaimDelete(enabled)} /> } - right={<> + end={<>

{STORAGE_CATEGORIES.map((category) => { diff --git a/client/src/components/Admin/storage/StorageReclaimSection.tsx b/client/src/components/Admin/storage/StorageReclaimSection.tsx index dfb538ab7..1e82abb27 100644 --- a/client/src/components/Admin/storage/StorageReclaimSection.tsx +++ b/client/src/components/Admin/storage/StorageReclaimSection.tsx @@ -47,12 +47,7 @@ export default function StorageReclaimSection({ icon={Eraser} hint={t('storage.reclaim.hint')} action={ - ) : ( )} {own.kind === 'chatgpt' && own.status === 'ok' ? ( - ) : ( - )} diff --git a/client/src/components/Settings/settingsKit.tsx b/client/src/components/Settings/settingsKit.tsx index c226e06b6..faeb72aed 100644 --- a/client/src/components/Settings/settingsKit.tsx +++ b/client/src/components/Settings/settingsKit.tsx @@ -182,13 +182,14 @@ export function SettingsCard({ icon: Icon, iconFill = false, title, hint, badge, * grid over a flat list, which pairs cards row by row and leaves a hole under * the shorter of two. A column with nothing to show drops out and the other * takes the whole width. The cards carry their own bottom margin, so only the - * gap between the columns is set. + * gap between the columns is set. `start` is the left column, the right one in + * a right-to-left language. */ -export function SettingsColumns({ left, right }: { left: ReactNode; right: ReactNode }) { +export function SettingsColumns({ start, end }: { start: ReactNode; end: ReactNode }) { return (
-
{left}
-
{right}
+
{start}
+
{end}
) } diff --git a/client/src/mobile/screens/settings/MSettingsMcp.tsx b/client/src/mobile/screens/settings/MSettingsMcp.tsx index 94c7db7a4..e6b12c496 100644 --- a/client/src/mobile/screens/settings/MSettingsMcp.tsx +++ b/client/src/mobile/screens/settings/MSettingsMcp.tsx @@ -1,4 +1,4 @@ -import type { ReactNode } from 'react' +import { useState, type ReactNode } from 'react' import { Check, ChevronDown, ChevronRight, Copy, KeyRound, Plus, RefreshCw, Terminal, Trash2, Key, CircleCheck, RotateCcw } from 'lucide-react' import { useTranslation } from '../../../i18n' import { useFormatDate } from '../../../hooks/useDateFormat' @@ -43,13 +43,12 @@ export default function MSettingsMcp() { const { t } = useTranslation() const { formatDate } = useFormatDate() const demoLocked = useDemoAccountLock() + // The desktop page shows the client config open; the phone keeps it folded. + const [configOpenOAuth, setConfigOpenOAuth] = useState(false) + const [configOpenToken, setConfigOpenToken] = useState(false) const { activeMcpTab: activeTab, setActiveMcpTab: setActiveTab, - configOpenOAuth, - setConfigOpenOAuth, - configOpenToken, - setConfigOpenToken, copiedKey, oauthClients: clients, oauthSessions: sessions, diff --git a/client/src/pages/admin/AdminNotificationsTab.tsx b/client/src/pages/admin/AdminNotificationsTab.tsx index b5b2e50a9..1d114b5b7 100644 --- a/client/src/pages/admin/AdminNotificationsTab.tsx +++ b/client/src/pages/admin/AdminNotificationsTab.tsx @@ -79,7 +79,7 @@ export default function AdminNotificationsTab({ admin, t }: AdminNotificationsTa relay's fields a section under them; the operator's own targets and the admin-only matrix on the right. */} {/* The relay is the operator's on a managed install: their host, their @@ -166,7 +166,7 @@ export default function AdminNotificationsTab({ admin, t }: AdminNotificationsTa )} } - right={ + end={ // What the operator receives about running the instance: one card, the // two targets as its blocks, then which event goes out over which channel. diff --git a/client/src/pages/admin/AdminSettingsTab.tsx b/client/src/pages/admin/AdminSettingsTab.tsx index 2bb5caf53..205653dc0 100644 --- a/client/src/pages/admin/AdminSettingsTab.tsx +++ b/client/src/pages/admin/AdminSettingsTab.tsx @@ -3,7 +3,7 @@ import { adminApi } from '../../api/client' import { getApiErrorMessage } from '../../types' import { AlertTriangle, CheckCircle, Compass, Eye, EyeOff, FileType, Fingerprint, KeyRound, Loader2, LockKeyhole, LogIn, - Plane, RefreshCw, Save, ShieldCheck, XCircle, + Plane, RefreshCw, Save, XCircle, } from 'lucide-react' import ToggleSwitch from '../../components/Settings/ToggleSwitch' import CustomSelect from '../../components/shared/CustomSelect' @@ -748,13 +748,13 @@ export default function AdminSettingsTab({ admin, t, part }: AdminSettingsTabPro // Place search and the services on the left, the keys and file types on the right. return ( + start={<> {/* Inside the place search card elsewhere; that card is the operator's here, sharing place details is still the admin's decision. */} {managed && } {servicesCard} } - right={<> + end={<> {apiKeysCard} {fileTypesCard} } @@ -767,13 +767,13 @@ export default function AdminSettingsTab({ admin, t, part }: AdminSettingsTabPro // Split by length, not by kind: single sign-on is the one long form, so the // right column holds it and the short danger zone under it. {authCard} {passkeyCard} } - right={ + end={ <> {oidcCard} {dangerCard} diff --git a/shared/src/i18n/de/admin.ts b/shared/src/i18n/de/admin.ts index e98d06203..635b30052 100644 --- a/shared/src/i18n/de/admin.ts +++ b/shared/src/i18n/de/admin.ts @@ -269,7 +269,7 @@ const admin: TranslationStrings = { 'admin.tabs.config': 'Personalisierung', 'admin.tabs.defaults': 'Standards', 'admin.defaultSettings.title': 'Standard-Benutzereinstellungen', - 'admin.defaultSettings.routing': 'Routing', + 'admin.defaultSettings.routing': 'Routing', // same-as-en 'admin.defaultSettings.description': 'Instanzweite Standards festlegen. Benutzer, die eine Einstellung nicht geändert haben, sehen diese Werte. Eigene Änderungen haben immer Vorrang.', 'admin.defaultSettings.saved': 'Standard gespeichert', diff --git a/shared/src/i18n/fr/admin.ts b/shared/src/i18n/fr/admin.ts index 056fee79f..8beeae1a7 100644 --- a/shared/src/i18n/fr/admin.ts +++ b/shared/src/i18n/fr/admin.ts @@ -77,7 +77,7 @@ const admin: TranslationStrings = { 'admin.invite.deleteError': 'Erreur lors de la suppression du lien', 'admin.tabs.settings': 'Paramètres', 'admin.tabs.security': 'Sécurité', - 'admin.tabs.services': 'Services', + 'admin.tabs.services': 'Services', // same-as-en 'admin.allowRegistration': 'Autoriser les inscriptions', 'admin.allowRegistrationHint': "Les nouveaux utilisateurs peuvent s'inscrire eux-mêmes", 'admin.authMethods': "Méthodes d'authentification",