From 121685e5645a9fe39908fe521f3970151ec45adc Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Sun, 9 Aug 2026 19:53:49 +0300 Subject: [PATCH] revert: restore auto-hiding overlay scrollbars --- .../ui/src/components/ui/OverlayScrollbar.tsx | 20 ++----------------- packages/ui/src/index.css | 6 ++---- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/packages/ui/src/components/ui/OverlayScrollbar.tsx b/packages/ui/src/components/ui/OverlayScrollbar.tsx index 7a409d00..d1026abb 100644 --- a/packages/ui/src/components/ui/OverlayScrollbar.tsx +++ b/packages/ui/src/components/ui/OverlayScrollbar.tsx @@ -25,12 +25,6 @@ const isSameThumbMetrics = (a: ThumbMetrics, b: ThumbMetrics): boolean => { return Math.abs(a.length - b.length) < METRIC_EPSILON && Math.abs(a.offset - b.offset) < METRIC_EPSILON; }; -// Desktop shells (Electron, VS Code webview) use persistent, not -// auto-hiding, scrollbars. Reads the same `desktop-runtime` root class that -// index.css keys off, so JS and CSS never disagree on what counts as desktop. -const isDesktopScrollbarRuntime = (): boolean => - typeof document !== "undefined" && document.documentElement.classList.contains("desktop-runtime"); - const OverlayScrollbarComponent: React.FC = ({ containerRef, minThumbSize = 32, @@ -134,15 +128,8 @@ const OverlayScrollbarComponent: React.FC = ({ if (isHoveringRef.current) { return; } - // Desktop shells keep the thumb visible once shown instead of - // auto-hiding it after a delay. userIntentOnly callers (e.g. chat - // auto-follow scroll) opt out of persistence on purpose, so they keep - // the existing auto-hide behavior even on desktop. - if (isDesktopScrollbarRuntime() && !userIntentOnly) { - return; - } hideTimeoutRef.current = setTimeout(() => setVisible(false), hideDelayMs); - }, [hideDelayMs, userIntentOnly]); + }, [hideDelayMs]); const markUserIntent = React.useCallback(() => { lastUserIntentAtRef.current = Date.now(); @@ -175,10 +162,7 @@ const OverlayScrollbarComponent: React.FC = ({ if (!container) return; updateMetrics(); - // On desktop shells, show the thumb immediately if content overflows - // instead of waiting for the first scroll event (persistent affordance, - // matching native desktop scrollbar conventions). - setVisible(isDesktopScrollbarRuntime() && !userIntentOnly); + setVisible(false); const onScroll = () => handleScroll(); const onKeyDown = (event: KeyboardEvent) => { diff --git a/packages/ui/src/index.css b/packages/ui/src/index.css index 4805a2c3..b6462769 100644 --- a/packages/ui/src/index.css +++ b/packages/ui/src/index.css @@ -1804,10 +1804,8 @@ input[aria-label="Terminal input"] { } -/* Settings dialog: hide the overlay scrollbar on mobile/web; wheel/keyboard - scroll still works. Desktop shells keep the persistent scrollbar so the - Settings sub-panels aren't left with no scroll affordance at all. */ -html:not(.desktop-runtime) [data-settings-view="true"] .overlay-scrollbar { +/* Settings dialog: hide the overlay scrollbar; wheel/keyboard scroll still works. */ +[data-settings-view="true"] .overlay-scrollbar { display: none; }