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
@@ -29,9 +29,10 @@ export function MainLayout({ status, onLogout, children }: MainLayoutProps) {
|
||||
const { editing } = useLayout();
|
||||
const { kiosk, exit: exitKiosk } = useKiosk();
|
||||
// The sidebar rests as a slim icon rail and auto-expands on hover/focus (the
|
||||
// peek logic below) — there's no collapse button. Layout-edit mode force-
|
||||
// expands it so the drag-to-reorder list has room.
|
||||
const effectiveCollapsed = !editing;
|
||||
// peek logic below) — there's no collapse button. Two cases force it fully
|
||||
// expanded: layout-edit mode (the drag-to-reorder list needs room) and the
|
||||
// 「钉住侧栏展开」 appearance pref (operator opted out of the rail entirely).
|
||||
const effectiveCollapsed = !editing && !appearance.sidebarPinned;
|
||||
// Hover/focus peek: while collapsed, hovering (or keyboard-focusing) the rail
|
||||
// temporarily expands it. The rail lives in the flex flow, so the page
|
||||
// content is pushed right rather than overlaid. The pinned `collapsed` pref
|
||||
|
||||
Reference in new issue
Block a user