Skip to content

A full-featured download manager.

fix(downloads): keep scrollbar below the column header (#2323)

Dr_rOotfab91fc6a0a1
diff --git a/e2e/downloads-visibility.spec.ts b/e2e/downloads-visibility.spec.ts
index 6d23cb1a..be9a7749 100644
--- a/e2e/downloads-visibility.spec.ts
+++ b/e2e/downloads-visibility.spec.ts
@@ -1101,10 +1101,17 @@ test('marquee selection survives row feedback, data updates and blank-space drag
elements.map((element) => element.getAttribute('data-task-id'))
)
const beforeScrollbar = await selectionAtTop()
- const thumb = grid.locator(
- '[data-slot="scroll-area-scrollbar"][data-orientation="vertical"] [data-slot="scroll-area-thumb"]'
+ const scrollbar = grid.locator(
+ '[data-slot="scroll-area-scrollbar"][data-orientation="vertical"]'
)
+ const thumb = scrollbar.locator('[data-slot="scroll-area-thumb"]')
await thumb.hover()
+ const headerBox = (await viewport.getByRole('row').first().boundingBox())!
+ const scrollbarBox = (await scrollbar.boundingBox())!
+ expect(scrollbarBox.y).toBeCloseTo(headerBox.y + headerBox.height, 0)
+ await grid.screenshot({
+ path: testInfo.outputPath('scrollbar-below-header.png'),
+ })
const thumbBox = (await thumb.boundingBox())!
await mainWindow.mouse.move(
thumbBox.x + thumbBox.width / 2,
diff --git a/screenshots/motrix-downloads-scrollbar-header.png b/screenshots/motrix-downloads-scrollbar-header.png
new file mode 100644
index 00000000..7e1e8f00
Binary files /dev/null and b/screenshots/motrix-downloads-scrollbar-header.png differ
diff --git a/src/renderer/components/desktop-kit/virtual-list/virtual-list.tsx b/src/renderer/components/desktop-kit/virtual-list/virtual-list.tsx
index ddb0c6c4..d29943cb 100644
--- a/src/renderer/components/desktop-kit/virtual-list/virtual-list.tsx
+++ b/src/renderer/components/desktop-kit/virtual-list/virtual-list.tsx
@@ -155,7 +155,7 @@ function VirtualListInner<T>(
{content}
</ScrollAreaContent>
</ScrollAreaViewport>
- <ScrollBar />
+ <ScrollBar style={{ top: headerHeight }} />
<ScrollBar orientation="horizontal" />
</ScrollArea>
)