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:
DrSmoothl committed 2026-06-20 23:37:21 +08:00
1 parent bba9b82ce9
commit ebadfb968b
5 files changed
+12 -10

No files matched your search

@@ -486,8 +486,8 @@ function AppearancePanel() {
<SettingRow label="高对比模式" hint="加强边框与次要文字的对比度。" layout="inline">
<ToggleSwitch value={a.highContrast} onChange={(highContrast) => setAppearance({ highContrast })} ariaLabel="高对比模式" />
</SettingRow>
<SettingRow label="侧栏默认折叠" hint="新会话首次进入时侧栏默认收起(手动展开/收起后以手动选择为准)。" layout="inline">
<ToggleSwitch value={a.sidebarDefaultCollapsed} onChange={(sidebarDefaultCollapsed) => setAppearance({ sidebarDefaultCollapsed })} ariaLabel="侧栏默认折叠" />
<SettingRow label="钉住侧栏展开" hint="侧栏常驻展开,不再收成图标轨、也不随悬停自动收起。" layout="inline">
<ToggleSwitch value={a.sidebarPinned} onChange={(sidebarPinned) => setAppearance({ sidebarPinned })} ariaLabel="钉住侧栏展开" />
</SettingRow>
</Group>