From f8152d232382c858fed176bdc1cb0f96d4ce9ef6 Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Sun, 12 Jul 2026 04:05:52 -0400 Subject: [PATCH] feat(desktop): embeddable Gateway settings panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an `embedded` flag to GatewaySettings (and a `bare` variant to SettingsContent) that drops the page title/intro, Diagnostics row, "Save for next restart", and the page gutters — so the same panel can be reused inside a tighter surface without a second connection form to maintain. No change to the standalone Settings → Gateway page (defaults off). --- .../src/app/settings/gateway-settings.tsx | 72 +++++++++++-------- apps/desktop/src/app/settings/primitives.tsx | 8 ++- 2 files changed, 47 insertions(+), 33 deletions(-) diff --git a/apps/desktop/src/app/settings/gateway-settings.tsx b/apps/desktop/src/app/settings/gateway-settings.tsx index a06c57a396cf..f7743203e5dc 100644 --- a/apps/desktop/src/app/settings/gateway-settings.tsx +++ b/apps/desktop/src/app/settings/gateway-settings.tsx @@ -110,7 +110,11 @@ function ScopeChip({ active, label, onSelect }: { active: boolean; label: string ) } -export function GatewaySettings() { +// `embedded` trims the page chrome for reuse inside the boot-failure recovery +// card: the outer title/intro, the "Save for next restart" action, and the +// Diagnostics row are redundant there (the card owns its header + a single +// reconnect action), so only the connection controls render. +export function GatewaySettings({ embedded = false }: { embedded?: boolean } = {}) { const { t } = useI18n() const g = t.settings.gateway const [loading, setLoading] = useState(true) @@ -707,17 +711,19 @@ export function GatewaySettings() { } return ( - -
-
- - {g.title} - {state.envOverride ? {g.envOverride} : null} + + {embedded ? null : ( +
+
+ + {g.title} + {state.envOverride ? {g.envOverride} : null} +
+

+ {g.intro} +

-

- {g.intro} -

-
+ )} {namedProfiles.length > 0 ? (
@@ -1037,14 +1043,16 @@ export function GatewaySettings() { {g.testRemote} ) : null} - + {embedded ? null : ( + + )}
) : null} -
- void window.hermesDesktop?.revealLogs()} size="sm" variant="textStrong"> - - {g.openLogs} - - } - description={g.diagnosticsDesc} - title={g.diagnostics} - /> -
+ {embedded ? null : ( +
+ void window.hermesDesktop?.revealLogs()} size="sm" variant="textStrong"> + + {g.openLogs} + + } + description={g.diagnosticsDesc} + title={g.diagnostics} + /> +
+ )} ) } diff --git a/apps/desktop/src/app/settings/primitives.tsx b/apps/desktop/src/app/settings/primitives.tsx index beeddf32c386..27fefa5d484b 100644 --- a/apps/desktop/src/app/settings/primitives.tsx +++ b/apps/desktop/src/app/settings/primitives.tsx @@ -8,10 +8,14 @@ import { cn } from '@/lib/utils' import { PAGE_INSET_X } from '../layout-constants' -export function SettingsContent({ children }: { children: ReactNode }) { +// `bare` drops the page gutters + tall bottom pad for embedding in a tighter +// surface (e.g. the boot-failure recovery card owns its own padding). +export function SettingsContent({ children, bare = false }: { children: ReactNode; bare?: boolean }) { return (
-
{children}
+
+ {children} +
) }