Skip to content

The agent that grows with you

fix(desktop): stop double scrollbar gutters shaving the recents list

Brooklyn Nicholsonb6ed6542a169
diff --git a/apps/desktop/src/app/chat/sidebar/index.tsx b/apps/desktop/src/app/chat/sidebar/index.tsx
index 040f0ec4c37..40adea2a544 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 461a40fd96e..5470b8ec408 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 (
<SidebarGroup className={rootClassName}>
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 6ce09077faa..b9f640b855f 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<VirtualSessionListProps> = ({
// just consume that context via useSortable.
return (
<div
+ // `scrollbar-overlay`, not `scrollbar-fade`: the themed (classic)
+ // scrollbar reserves a 4px gutter, which shaved this list's rows
+ // narrower than the pinned/non-virtual lists above it and left dead
+ // space along the right edge. Overlay keeps native macOS behavior —
+ // zero gutter, thumb draws over content only while scrolling.
className={cn(
- 'scrollbar-fade relative min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain',
+ 'scrollbar-overlay relative min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain',
className
)}
ref={scrollerRef}