fix(desktop): stop double scrollbar gutters shaving the recents list
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.
This commit is contained in:
parent
fb206fd12b
commit
b6ed6542a1
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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}>
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Reference in New Issue