Skip to content

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

  1. Open any image in full-screen viewer
  2. Click "Slideshow" button
  3. Wait for slideshow to reach last image

Slideshow now loops back to first image

Summary by CodeRabbit

  • New Features

    • Slideshow now automatically loops back to the first image when reaching the end of the gallery.
  • Improvements

    • Copyright year now dynamically updates to reflect the current year.

✏️ 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

📝 Walkthrough

Walkthrough

These changes implement slideshow looping functionality by adding an optional callback parameter to the useSlideshow hook and integrating it into MediaView to reset the image index and zoom state when reaching the final image. A copyright year is also updated to be dynamically generated.

Changes

Cohort / File(s) Summary
Slideshow looping implementation
frontend/src/hooks/useSlideshow.ts, frontend/src/components/Media/MediaView.tsx
Extended useSlideshow hook API with optional onLoopToStart callback and currentIndex parameter. When the slideshow reaches the last image and both parameters are provided, onLoopToStart() is triggered instead of onNextImage(). MediaView implements this callback to reset image index to 0 and reset zoom state.
Copyright update
frontend/src/components/Navigation/Sidebar/AppSidebar.tsx
Changed footer copyright year from static "2025" to dynamic new Date().getFullYear().

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

enhancement, frontend, UI

Suggested reviewers

  • rahulharpal1603

Poem

🐰 A hop, a skip, through images bright,
Now loops forever—such delight!
When reaching the end, we bounce back home,
No more static years—let dates freely roam!

🚥 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 'Fix/slideshow loop' directly refers to the main change—implementing slideshow looping functionality to resolve issue #1090.
Linked Issues check ✅ Passed All code changes directly address issue #1090 by adding looping functionality to the slideshow hook and implementing the loop-to-start handler in MediaView.
Out of Scope Changes check ✅ Passed The copyright year update in AppSidebar.tsx is a minor ancillary change unrelated to the primary slideshow looping objective but introduces no problematic scope creep.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

@monu808 monu808 closed this Jan 28, 2026
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

1 participant