From b388e79c73a37df11b8540e5767abc51ca2850bd Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sun, 10 May 2026 23:41:48 +0100 Subject: [PATCH] Default Settings sidebar to expanded on Infrastructure tab The Infrastructure workspace previously inverted the default by initializing focusedNavigationExpanded=false, which meant landing on Settings (which defaults to the Infrastructure tab) always opened with the navigation collapsed to a 4rem rail. On a typical desktop the 18rem sidebar isn't crowding the workspace, but the rail-by-default cost a click on every settings visit. Remove the focused-navigation special case and the now-trivial wrappers around setSidebarCollapsed; let Infrastructure share the same sidebar-defaults-expanded behavior as every other settings tab. Manual collapse/expand via the chevron is unchanged. --- .../components/Settings/SettingsPageShell.tsx | 47 +++++-------------- 1 file changed, 13 insertions(+), 34 deletions(-) diff --git a/frontend-modern/src/components/Settings/SettingsPageShell.tsx b/frontend-modern/src/components/Settings/SettingsPageShell.tsx index 6e063dd81..3b775abdd 100644 --- a/frontend-modern/src/components/Settings/SettingsPageShell.tsx +++ b/frontend-modern/src/components/Settings/SettingsPageShell.tsx @@ -1,4 +1,4 @@ -import { Accessor, Component, For, JSX, Setter, Show, createSignal } from 'solid-js'; +import { Accessor, Component, For, JSX, Setter, Show } from 'solid-js'; import ChevronRight from 'lucide-solid/icons/chevron-right'; import { Card } from '@/components/shared/Card'; import { PageHeader } from '@/components/shared/PageHeader'; @@ -32,29 +32,8 @@ interface SettingsPageShellProps { } export const SettingsPageShell: Component = (props) => { - const [focusedNavigationExpanded, setFocusedNavigationExpanded] = createSignal(false); const unsavedChangesBanner = () => getSettingsUnsavedChangesBanner(); const infrastructureWorkspaceActive = () => isInfrastructureSettingsTab(props.activeTab()); - const effectiveSidebarCollapsed = () => - infrastructureWorkspaceActive() && !props.isMobileMenuOpen() - ? !focusedNavigationExpanded() - : props.sidebarCollapsed(); - const collapseSidebar = () => { - if (infrastructureWorkspaceActive() && !props.isMobileMenuOpen()) { - setFocusedNavigationExpanded(false); - return; - } - - props.setSidebarCollapsed(true); - }; - const expandSidebar = () => { - if (infrastructureWorkspaceActive() && !props.isMobileMenuOpen()) { - setFocusedNavigationExpanded(true); - return; - } - - props.setSidebarCollapsed(false); - }; const isSidebarItemActive = (itemId: SettingsTab) => itemId === 'infrastructure-systems' ? isInfrastructureSettingsTab(props.activeTab()) @@ -114,21 +93,21 @@ export const SettingsPageShell: Component = (props) => {
- +

{SETTINGS_SHELL_COPY.navigationTitle}

- +
- +
= (props) => {
@@ -207,13 +186,13 @@ export const SettingsPageShell: Component = (props) => { type="button" aria-current={isActive() ? 'page' : undefined} disabled={item.disabled} - class={`group flex w-full items-center ${effectiveSidebarCollapsed() ? 'justify-center' : 'justify-between'} lg:rounded-md ${effectiveSidebarCollapsed() ? 'px-2 py-2.5' : 'px-4 py-3.5 lg:px-3 lg:py-2'} text-[15px] lg:text-sm font-medium transition-colors ${item.disabled ? 'opacity-60 cursor-not-allowed text-muted' : isActive() ? 'lg:bg-blue-50 text-blue-600 dark:lg:bg-blue-900 dark:text-blue-300 lg:dark:text-blue-200 bg-surface' : ' lg:hover:bg-surface-hover hover:text-base-content active:bg-surface-hover lg:active:bg-transparent'}`} + class={`group flex w-full items-center ${props.sidebarCollapsed() ? 'justify-center' : 'justify-between'} lg:rounded-md ${props.sidebarCollapsed() ? 'px-2 py-2.5' : 'px-4 py-3.5 lg:px-3 lg:py-2'} text-[15px] lg:text-sm font-medium transition-colors ${item.disabled ? 'opacity-60 cursor-not-allowed text-muted' : isActive() ? 'lg:bg-blue-50 text-blue-600 dark:lg:bg-blue-900 dark:text-blue-300 lg:dark:text-blue-200 bg-surface' : ' lg:hover:bg-surface-hover hover:text-base-content active:bg-surface-hover lg:active:bg-transparent'}`} onClick={() => { if (item.disabled) return; props.setActiveTab(item.id); props.setIsMobileMenuOpen(false); }} - title={effectiveSidebarCollapsed() ? item.label : undefined} + title={props.sidebarCollapsed() ? item.label : undefined} >
= (props) => { {...(item.iconProps || {})} />
- +