From 6c8242158e1473de581f28269058ac1483b19ed8 Mon Sep 17 00:00:00 2001 From: Kevinroo Date: Wed, 11 Nov 2026 18:13:39 +0800 Subject: [PATCH] fix(frontend): keep scrollbars flush and use one split line Native scrollbars took layout width when a tab grew, and the drag sash sat beside the AI panel border. Paint an overlay thumb on the panel edge and make that sash the only divider. --- .../legacy-design/LegacyDesignScope.tsx | 2 + .../legacy-design/OverlayScrollbar.tsx | 29 ++ .../legacy-design/overlayScrollbar.test.ts | 149 ++++++++++ .../legacy-design/scrollbarOverlay.ts | 273 ++++++++++++++++++ frontend/src/styles/dockview-ayu.css | 25 +- .../src/styles/dockview-sash.styles.test.ts | 12 + frontend/src/styles/legacy/index.css | 45 ++- frontend/src/styles/scrollbar.styles.test.ts | 5 +- 8 files changed, 528 insertions(+), 12 deletions(-) create mode 100644 frontend/src/components/legacy-design/OverlayScrollbar.tsx create mode 100644 frontend/src/components/legacy-design/overlayScrollbar.test.ts create mode 100644 frontend/src/components/legacy-design/scrollbarOverlay.ts diff --git a/frontend/src/components/legacy-design/LegacyDesignScope.tsx b/frontend/src/components/legacy-design/LegacyDesignScope.tsx index 6be6aff73..8ada32ee3 100644 --- a/frontend/src/components/legacy-design/LegacyDesignScope.tsx +++ b/frontend/src/components/legacy-design/LegacyDesignScope.tsx @@ -5,6 +5,7 @@ import NiceModal from '@ebay/nice-modal-react'; import { cn } from '@/lib/utils'; import { useTheme } from '@/components/ThemeProvider'; import { Theme as AstryxTheme } from '@astryxdesign/core/theme'; +import { OverlayScrollbar } from '@/components/legacy-design/OverlayScrollbar'; import { NativeTitleTooltipHost } from '@/components/ui/native-title-tooltip-host'; import { neutralTheme } from '@astryxdesign/theme-neutral/built'; // Astryx CSS cascade: reset → component styles → theme token overrides. @@ -53,6 +54,7 @@ export function LegacyDesignScope({ {children} + diff --git a/frontend/src/components/legacy-design/OverlayScrollbar.tsx b/frontend/src/components/legacy-design/OverlayScrollbar.tsx new file mode 100644 index 000000000..afe2fbebf --- /dev/null +++ b/frontend/src/components/legacy-design/OverlayScrollbar.tsx @@ -0,0 +1,29 @@ +import { useEffect, useRef } from 'react'; +import { attachOverlayScrollbars } from './scrollbarOverlay'; + +export function OverlayScrollbar() { + const verticalRef = useRef(null); + const horizontalRef = useRef(null); + + useEffect(() => { + const vertical = verticalRef.current; + const horizontal = horizontalRef.current; + if (!vertical || !horizontal) return undefined; + return attachOverlayScrollbars(document, { vertical, horizontal }); + }, []); + + return ( + <> +