feat(webui): replace 「侧栏默认折叠」 with 「钉住侧栏展开」 pin option
The old default-collapsed pref went inert once the sidebar became a hover-expand rail with no collapse button. Repurpose it as an explicit opt-out: when 「钉住侧栏展开」 is on, the sidebar stays permanently expanded and no longer collapses to the rail or reacts to hover. Renamed the appearance field sidebarDefaultCollapsed -> sidebarPinned across the webui types/defaults/settings UI and the core ui-config interface, defaults and validator (kept in lock-step so persistence round-trips). Wired into main-layout: effectiveCollapsed = !editing && !sidebarPinned.
This commit is contained in:
5 files changed
+12
-10
No files matched your search
@@ -100,7 +100,7 @@ export interface UiAppearance {
|
||||
/** Hard-disable all UI animations (stronger than reduceMotion). */
|
||||
disableMotion: boolean;
|
||||
highContrast: boolean;
|
||||
sidebarDefaultCollapsed: boolean;
|
||||
sidebarPinned: boolean;
|
||||
timeFormat: TimeFormat;
|
||||
/** Dashboard poll interval (ms); 0 = paused. */
|
||||
pollInterval: number;
|
||||
@@ -226,7 +226,7 @@ const DEFAULT_APPEARANCE: UiAppearance = {
|
||||
reduceMotion: false,
|
||||
disableMotion: false,
|
||||
highContrast: false,
|
||||
sidebarDefaultCollapsed: false,
|
||||
sidebarPinned: false,
|
||||
timeFormat: '24h',
|
||||
pollInterval: 3000,
|
||||
customCss: '',
|
||||
@@ -531,7 +531,7 @@ export function normalizeAppearance(value: unknown, imageState: ServerImageState
|
||||
reduceMotion: boolOr(v.reduceMotion, DEFAULT_APPEARANCE.reduceMotion),
|
||||
disableMotion: boolOr(v.disableMotion, DEFAULT_APPEARANCE.disableMotion),
|
||||
highContrast: boolOr(v.highContrast, DEFAULT_APPEARANCE.highContrast),
|
||||
sidebarDefaultCollapsed: boolOr(v.sidebarDefaultCollapsed, DEFAULT_APPEARANCE.sidebarDefaultCollapsed),
|
||||
sidebarPinned: boolOr(v.sidebarPinned, DEFAULT_APPEARANCE.sidebarPinned),
|
||||
timeFormat: oneOf<TimeFormat>(v.timeFormat, ['12h', '24h'], DEFAULT_APPEARANCE.timeFormat),
|
||||
pollInterval: clampNum(v.pollInterval, 0, 60_000, DEFAULT_APPEARANCE.pollInterval),
|
||||
customCss: typeof v.customCss === 'string' ? v.customCss.slice(0, 50_000) : DEFAULT_APPEARANCE.customCss,
|
||||
|
||||
Reference in new issue
Block a user