feat: option to hide the sidebar after opening a host (#1652)

This commit is contained in:
LukeGus committed 2026-10-15 21:06:47 -05:00
1 parent f20d64b4f2
commit 7324982f47
7 files changed
+36 -1

No files matched your search

+14
View File
@@ -223,6 +223,20 @@ export function CustomizeSidebarPanel({
}
/>
</SettingRow>
<SettingRow
label={t("hosts.closeOnOpen")}
description={t("hosts.closeOnOpenDesc")}
>
<FakeSwitch
checked={preferences.display.closeOnOpen}
onChange={(v) =>
update((prev) => ({
...prev,
display: { ...prev.display, closeOnOpen: v },
}))
}
/>
</SettingRow>
<SettingRow
label={t("newUi.sidebar.userProfile.statusColors")}
description={t("newUi.sidebar.userProfile.statusColorsDesc")}
+6 -1
View File
@@ -201,6 +201,7 @@ export function HostsPanel({
hostTree,
loading,
active = true,
onCloseSidebar,
}: {
onOpenTab: (
host: Host,
@@ -217,6 +218,7 @@ export function HostsPanel({
/** Unused since editing moved to the Manage tab. */
onEditingChange?: (editing: boolean) => void;
active?: boolean;
onCloseSidebar?: () => void;
}) {
const { t } = useTranslation();
const { statuses, getStatus } = useServerStatus();
@@ -1044,7 +1046,10 @@ export function HostsPanel({
).children
: []
}
onOpenTab={onOpenTab}
onOpenTab={(host, type, options) => {
onOpenTab(host, type, options);
if (sidebarPrefs.display.closeOnOpen) onCloseSidebar?.();
}}
onEditHost={onEditHost}
onShareHost={(host) => setShareModalHost(host)}
query={hostSearch.trim().toLowerCase()}