From b6ed6542a169f8e332b3461dbbc30ca03207a4ef Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Wed, 12 Aug 2026 20:54:28 -0500 Subject: [PATCH] fix(desktop): stop double scrollbar gutters shaving the recents list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The virtualized recents list sat inside a wrapper that was itself a themed scroller, so two 4px classic-scrollbar gutters stacked and every row ended 8px short of the sidebar edge the pinned list reaches. Drop the wrapper's scroller when the virtual list owns scrolling, use the overlay scrollbar on the virtual scroller (zero gutter, native fade), and neutralize both axes of the wrapper overflow — `overflow-y-visible` next to `overflow-x-hidden` computes to `auto` and still reserved a gutter. --- apps/desktop/src/app/chat/sidebar/index.tsx | 5 ++++- apps/desktop/src/app/chat/sidebar/sessions-section.tsx | 6 ++++-- apps/desktop/src/app/chat/sidebar/virtual-session-list.tsx | 7 ++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/apps/desktop/src/app/chat/sidebar/index.tsx b/apps/desktop/src/app/chat/sidebar/index.tsx index 040f0ec4c372a..40adea2a544ed 100644 --- a/apps/desktop/src/app/chat/sidebar/index.tsx +++ b/apps/desktop/src/app/chat/sidebar/index.tsx @@ -1553,7 +1553,10 @@ export function ChatSidebar({ collapsible={!inProject} contentClassName={cn( 'flex min-h-0 flex-1 flex-col gap-px pb-1.75', - SCROLL_Y, + // The virtualized long list owns its own scroller — giving + // this wrapper one too doubled the scrollbar gutter and + // shaved every row 4px short of the sidebar's right edge. + !recentsVirtualizes && SCROLL_Y, // Flatten into the single scroll when compact — unless this is the // virtualized long list, which must keep its own scroller. !recentsVirtualizes && COMPACT_FLAT diff --git a/apps/desktop/src/app/chat/sidebar/sessions-section.tsx b/apps/desktop/src/app/chat/sidebar/sessions-section.tsx index 461a40fd96e7d..5470b8ec408a1 100644 --- a/apps/desktop/src/app/chat/sidebar/sessions-section.tsx +++ b/apps/desktop/src/app/chat/sidebar/sessions-section.tsx @@ -477,8 +477,10 @@ export function SidebarSessionsSection({ } // The virtualizer owns its own scroller, so suppress the wrapper's overflow - // to avoid a double scroll container. - const resolvedContentClassName = cn(contentClassName, flatVirtualized && 'overflow-y-visible') + // to avoid a double scroll container. Both axes: `overflow-y-visible` next + // to the inherited `overflow-x-hidden` computes to `auto` (CSS spec), which + // kept a phantom 4px scrollbar gutter and cut every row short on the right. + const resolvedContentClassName = cn(contentClassName, flatVirtualized && 'overflow-visible') return ( diff --git a/apps/desktop/src/app/chat/sidebar/virtual-session-list.tsx b/apps/desktop/src/app/chat/sidebar/virtual-session-list.tsx index 6ce09077faa3b..b9f640b855fd0 100644 --- a/apps/desktop/src/app/chat/sidebar/virtual-session-list.tsx +++ b/apps/desktop/src/app/chat/sidebar/virtual-session-list.tsx @@ -143,8 +143,13 @@ export const VirtualSessionList: FC = ({ // just consume that context via useSortable. return (