Skip to content

Conversation

timsburk
Copy link
Collaborator

@timsburk timsburk commented Oct 2, 2025

Summary by CodeRabbit

  • New Features
    • Hero carousel now auto-rotates through slides every 3 seconds for a more dynamic landing experience.
    • Added pause-on-hover: rotation stops when you hover over the carousel and resumes when you move the cursor away.
    • Smoothly resumes from the current slide after pausing, ensuring seamless browsing.

Copy link
Contributor

coderabbitai bot commented Oct 2, 2025

Walkthrough

Adds auto-rotation to the hero carousel using a 3-second interval controlled by a paused state. Implements pause-on-hover via mouse enter/leave handlers. The interval respects paused and is cleaned up on effect re-run or unmount. No public API changes.

Changes

Cohort / File(s) Summary of Changes
Hero carousel auto-rotate & hover pause
src/components/landing/hero/HeroCarousel.tsx
Added useEffect-managed 3s setInterval to advance slides modulo length; introduced paused state; wired onMouseEnter/onMouseLeave to toggle paused; ensured interval cleanup on dependency changes/unmount.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant HeroCarousel
  participant Effect as useEffect (auto-rotate)
  participant Timer as setInterval (3s)

  User->>HeroCarousel: Load component
  HeroCarousel->>Effect: Mount effect with paused=false
  Effect->>Timer: Start interval (advance slide)
  Timer-->>HeroCarousel: Every 3s: setCurrent((i+1)%n)

  User->>HeroCarousel: Mouse enter (hover)
  HeroCarousel->>Effect: paused=true (re-run)
  Effect->>Timer: Clear/stop interval
  Note over HeroCarousel,Timer: Rotation paused while hovered

  User->>HeroCarousel: Mouse leave
  HeroCarousel->>Effect: paused=false (re-run)
  Effect->>Timer: Restart interval
  Timer-->>HeroCarousel: Resume advancing slides

  HeroCarousel-->>Effect: Unmount
  Effect->>Timer: Cleanup interval
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

Poem

I hop past slides that glide in time,
Three beats—next scene, a gentle chime.
I pause when paws rest on the show,
Then bounce again when breezes blow.
A tidy loop, a tidy tune—
Carousel moon, I’ll rotate soon. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The title claims the PR is merely correcting indentation and formatting, but the changes actually introduce significant functionality (auto-rotation and pause-on-hover) in the HeroCarousel component rather than just layout fixes. This mismatch means the title does not accurately summarize the main changes. Please update the pull request title to clearly reflect the new functionality added, for example “feat: add auto-rotation and pause-on-hover to HeroCarousel component.”
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/hero-carusol

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 788de50 and a62d5e9.

📒 Files selected for processing (1)
  • src/components/landing/hero/HeroCarousel.tsx (1 hunks)

@aleskrin aleskrin merged commit fa940a4 into main Oct 2, 2025
1 check 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.

2 participants