From a46eb71c0453e395d1da5d8264412a31a26dd9b2 Mon Sep 17 00:00:00 2001 From: drswith <540628938@qq.com> Date: Sat, 16 May 2026 14:22:25 +0800 Subject: [PATCH] fix(ui): improve settings entry discoverability --- .../app/src/components/FloatingShell.tsx | 137 ++++++++---------- 1 file changed, 62 insertions(+), 75 deletions(-) diff --git a/openless-all/app/src/components/FloatingShell.tsx b/openless-all/app/src/components/FloatingShell.tsx index 154cf1ea..88fc7810 100644 --- a/openless-all/app/src/components/FloatingShell.tsx +++ b/openless-all/app/src/components/FloatingShell.tsx @@ -1,6 +1,6 @@ // FloatingShell.tsx — frosted outer frame + raised inner console. -// Sidebar lives INSIDE the console card. Footer icons sit on the frosted outer. -// Settings is no longer a sidebar tab — it opens as a centered modal sheet. +// Sidebar lives INSIDE the console card. +// Settings opens as a centered modal sheet from the sidebar bottom entry. // // Ported verbatim from design_handoff_openless/variants.jsx::FloatingShell. @@ -101,11 +101,19 @@ function FloatingShellBody({ os, initialTab, initialSettings }: { os: OS; initia const navItemRefs = useRef>([]); const [pillRect, setPillRect] = useState<{ top: number; height: number } | null>(null); useLayoutEffect(() => { + if (settingsOpen) { + setPillRect(null); + return; + } const idx = NAV.findIndex(n => n.id === currentTab); + if (idx < 0) { + setPillRect(null); + return; + } const el = navItemRefs.current[idx]; if (!el) return; setPillRect({ top: el.offsetTop, height: el.offsetHeight }); - }, [currentTab, NAV]); + }, [currentTab, settingsOpen, NAV]); useEffect(() => { let cancelled = false; @@ -228,7 +236,7 @@ function FloatingShellBody({ os, initialTab, initialSettings }: { os: OS; initia /> )} {NAV.map((n, i) => { - const active = currentTab === n.id; + const active = !settingsOpen && currentTab === n.id; return ( + +
+ {IS_BETA_BUILD && ( + {t('shell.betaTag')} + )} + + {t('shell.footer.version', { version: APP_VERSION_LABEL })} +
+ {/* Main content — v1.3.1-8 用户希望"sidebar / main panel / caption 三处玻璃统一"。 @@ -319,43 +377,6 @@ function FloatingShellBody({ os, initialTab, initialSettings }: { os: OS; initia - {/* Footer — 透明地坐在外层磨砂底板上,跟 sidebar 同一片磨砂玻璃 */} -
- -
- - {IS_BETA_BUILD && ( - {t('shell.betaTag')} - )} - - {t('shell.footer.version', { version: APP_VERSION_LABEL })} -
- openSettings()} /> -
-
- {/* Settings modal — rendered inside this window */} {settingsOpen && ); } -interface FooterIconProps { - name: string; - tip: string; - active?: boolean; - onClick?: () => void; -} - -function FooterIcon({ name, tip, active, onClick }: FooterIconProps) { - const [hover, setHover] = useState(false); - // 选中(active)= popover 打开,深灰;hover = 浅灰;其它 = 透明 - const background = active - ? 'rgba(0,0,0,0.10)' - : hover - ? 'rgba(0,0,0,0.05)' - : 'transparent'; - return ( - - ); -} -