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

+1
View File
@@ -2698,6 +2698,7 @@ export function AppShell({
if (isMobile) setSidebarOpen(false);
}}
onEditHost={editHostInManager}
onCloseSidebar={() => setSidebarOpen(false)}
hostTree={realHostTree ?? undefined}
loading={hostsLoading}
onEditingChange={panelEditingSetter("hosts")}
+2
View File
@@ -644,6 +644,8 @@
"actionsClick": "Click to expand/collapse",
"openOnDoubleClick": "Open on double click",
"openOnDoubleClickDesc": "Require a double click to open a host session instead of a single click",
"closeOnOpen": "Hide sidebar after opening",
"closeOnOpenDesc": "Close the sidebar after you open a host from it",
"showFolderPaths": "Show folder paths",
"showFolderPathsDesc": "Show the parent folder path above nested subfolder names. Subfolders stay indented either way.",
"rowDetailsTitle": "Row details",
+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()}
@@ -28,6 +28,7 @@ describe("defaultHostSidebarPreferences", () => {
openOnDoubleClick: false,
showFolderPaths: true,
hostClickBehavior: "newTab",
closeOnOpen: false,
barActions: {},
showAddress: true,
showUsername: true,
@@ -74,6 +75,7 @@ describe("sanitizeHostSidebarPreferences", () => {
openOnDoubleClick: true,
showFolderPaths: false,
hostClickBehavior: "focusExistingDoubleClickNew",
closeOnOpen: true,
barActions: { maintenance: true },
showAddress: false,
showUsername: false,