fix(web): keep jump-to-bottom visible in history (#2304)

This commit is contained in:
Kiyoshi
2026-11-06 13:13:32 +08:00
committed by GitHub
parent 3ce46a9b13
commit 810aab72fc
4 changed files with 47 additions and 14 deletions
@@ -224,6 +224,25 @@ function renderSearchThread(options: {
}
describe('mobile initial scroll settling', () => {
it('shows the jump control during continuous upward scrolling and hides it at the bottom', () => {
const { viewport, queryByRole } = renderThread()
act(() => { vi.advanceTimersByTime(3_000) })
viewport.scrollTop = 702
fireEvent.scroll(viewport)
expect(queryByRole('button', { name: /scroll to bottom/i })).toBeNull()
viewport.scrollTop = 600
fireEvent.scroll(viewport)
expect(queryByRole('button', { name: /scroll to bottom/i })).not.toBeNull()
viewport.scrollTop = 400
fireEvent.scroll(viewport)
expect(queryByRole('button', { name: /scroll to bottom/i })).not.toBeNull()
viewport.scrollTop = 702
fireEvent.scroll(viewport)
expect(queryByRole('button', { name: /scroll to bottom/i })).toBeNull()
})
it('uses the explicit tail transition when a send requests a forced scroll', () => {
const onViewModeChange = vi.fn()
const onJumpToTail = vi.fn()