Skip to content

fix(frontend): suppress slide animation when entering grid view#228

Merged
lstein merged 1 commit into
masterfrom
lstein/fix/grid-view-slide-animation
May 11, 2026
Merged

fix(frontend): suppress slide animation when entering grid view#228
lstein merged 1 commit into
masterfrom
lstein/fix/grid-view-slide-animation

Conversation

@lstein
Copy link
Copy Markdown
Owner

@lstein lstein commented May 11, 2026

Summary

  • Switching from swiper view to grid view caused an unwanted horizontal scroll right after the grid faded in.
  • Cause: resetAllSlides() prepends a context batch before the target slide, and loadBatch() then runs swiper.slideTo(currentColumns, 300, false) to compensate — that 300 ms animation is what was visible.
  • Threaded an animatePrepend flag through loadBatch(). The initial-reset prepend now passes false (0 ms slideTo); runtime back-scrolling keeps the 300 ms animation.

Test plan

  • In swiper view, navigate several slides forward, then toggle to grid view — grid appears in place with no horizontal scroll.
  • In grid view, scroll backward past the start of the loaded batch — prepend still animates smoothly.
  • Toggle grid ↔ swiper repeatedly; confirm no regression in fade or current-slide highlighting.
  • npm test and npm run lint pass.

🤖 Generated with Claude Code

When switching from swiper to grid view, resetAllSlides() prepends a
context batch before the target slide and compensates with an animated
slideTo, producing an unwanted horizontal scroll right after the grid
fades in. Thread an animatePrepend flag through loadBatch so the
initial reset uses 0ms duration; runtime back-scrolling still animates.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@lstein lstein merged commit 4aeda89 into master May 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant