From bc690f0394a00703d6f25a48c63ecb0170b2e091 Mon Sep 17 00:00:00 2001 From: chengyongru <2755839590@qq.com> Date: Fri, 20 Nov 2026 22:53:24 +0800 Subject: [PATCH] fix(webui): align settings sidebar footer rows --- webui/src/components/remote/HostSwitcher.tsx | 6 +++--- webui/src/components/remote/HostSwitcherView.tsx | 5 +++-- .../src/components/settings/SettingsSidebar.tsx | 16 +++++++++------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/webui/src/components/remote/HostSwitcher.tsx b/webui/src/components/remote/HostSwitcher.tsx index 06189e39e..4a6bc3c3f 100644 --- a/webui/src/components/remote/HostSwitcher.tsx +++ b/webui/src/components/remote/HostSwitcher.tsx @@ -1,4 +1,4 @@ -import { useContext, useEffect, useState } from "react"; +import { useContext, useEffect, useState, type ComponentProps } from "react"; import { useClient } from "@/providers/ClientProvider"; import type { ConnectionStatus } from "@/lib/types"; @@ -8,10 +8,10 @@ import { HostSwitcherView } from "./HostSwitcherView"; export { HostNavigationContext, type HostPicker } from "./host-navigation"; export { RemoteHostMenu } from "./HostSwitcherView"; -export function HostSwitcher({ collapsed = false, portalContainer }: { collapsed?: boolean; portalContainer?: HTMLElement | null }) { +export function HostSwitcher(props: Omit, "picker" | "status">) { const picker = useContext(HostNavigationContext); const { client } = useClient(); const [status, setStatus] = useState(client.status); useEffect(() => client.onStatus(setStatus), [client]); - return ; + return ; } diff --git a/webui/src/components/remote/HostSwitcherView.tsx b/webui/src/components/remote/HostSwitcherView.tsx index cf8d51b4c..cd7e94bf4 100644 --- a/webui/src/components/remote/HostSwitcherView.tsx +++ b/webui/src/components/remote/HostSwitcherView.tsx @@ -101,11 +101,12 @@ function HostMenuItems({ picker }: { picker: HostPicker }) { } /** Shared sidebar control. Remote frames can only open the trusted shell's menu. */ -export function HostSwitcherView({ picker, status, collapsed = false, portalContainer }: { +export function HostSwitcherView({ picker, status, collapsed = false, portalContainer, className }: { picker: HostPicker | EmbeddedPicker | null; status: ConnectionStatus; collapsed?: boolean; portalContainer?: HTMLElement | null; + className?: string; }) { const { t } = useTranslation(); const buttonRef = useRef(null); @@ -128,7 +129,7 @@ export function HostSwitcherView({ picker, status, collapsed = false, portalCont const detail = pendingName ? `${current}. ${t("remote.preparing", { name: pendingName })}` : current; const button = - + ) : null} {onLogout && !hostChromeInset ? ( ) : null} - {hostNavigation &&
} + {hostNavigation && } );