Skip to content

feat: add looping functionality to slideshow for seamless experience#1100

Merged
rahulharpal1603 merged 2 commits intoAOSSIE-Org:mainfrom
monu808:fix/slideshow-loop-clean
Feb 4, 2026
Merged

feat: add looping functionality to slideshow for seamless experience#1100
rahulharpal1603 merged 2 commits intoAOSSIE-Org:mainfrom
monu808:fix/slideshow-loop-clean

Conversation

@monu808
Copy link
Contributor

@monu808 monu808 commented Jan 28, 2026

@rahulharpal1603
Fixes: #1090
Description
Fixed the slideshow stopping at the last image instead of looping continuously.

Changes
Updated useSlideshow hook to support looping via optional onLoopToStart callback
Added handleLoopToStart in MediaView.tsx to reset to first image

Testing

Open any image in full-screen viewer
Click "Slideshow" button
Wait for slideshow to reach last image
Slideshow now loops back to first image

Summary by CodeRabbit

  • New Features
    • Added automatic loop-to-start functionality for slideshows. When a slideshow reaches the final image, it now seamlessly returns to the first image instead of stopping, enabling continuous browsing. The zoom state is also reset when looping back to the beginning.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions github-actions bot added enhancement New feature or request frontend good first issue Good for newcomers labels Jan 28, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 28, 2026

Warning

Rate limit exceeded

@rahulharpal1603 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 36 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

The changes add looping functionality to the slideshow feature by introducing a handler that resets the image position to the start and updating the useSlideshow hook to conditionally invoke looping logic when reaching the final image.

Changes

Cohort / File(s) Summary
Slideshow looping handler
frontend/src/components/Media/MediaView.tsx
Added handleLoopToStart handler that resets the current image index to 0 and zoom state; integrated into useSlideshow hook call with handleNextImage.
Hook signature expansion
frontend/src/hooks/useSlideshow.ts
Extended hook signature with optional onLoopToStart and currentIndex parameters; updated interval callback with conditional logic to invoke onLoopToStart when at or beyond the final image, otherwise invoke onNextImage; updated dependency array.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Round and round the images go,
Now they loop from end to start,
No more halting, smooth as snow,
Slideshow magic, final part!
✨ Loop complete, our work's an art!

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding looping functionality to the slideshow, which directly addresses the PR objectives and linked issue #1090.
Linked Issues check ✅ Passed The PR implements the required looping functionality [#1090] by adding an onLoopToStart callback to useSlideshow and handling the loop-back to the first image in MediaView.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing slideshow looping functionality specified in issue #1090; no out-of-scope modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@HardikaPaliwal
Copy link

Hi maintainers , I am interested in contributing to this issue can you please assign it me?

Copy link
Contributor

@rahulharpal1603 rahulharpal1603 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @monu808!

@rahulharpal1603 rahulharpal1603 merged commit 1b7ca52 into AOSSIE-Org:main Feb 4, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request frontend good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG:Slideshow Doesn't Loop

3 participants