Skip to content

fix: resolve duplicate testimonial mapping in Testimonial section (#938)#942

Open
Pratik-1213 wants to merge 1 commit intoPremkolte:mainfrom
Pratik-1213:fix/duplicate-testimonial-mapping-938
Open

fix: resolve duplicate testimonial mapping in Testimonial section (#938)#942
Pratik-1213 wants to merge 1 commit intoPremkolte:mainfrom
Pratik-1213:fix/duplicate-testimonial-mapping-938

Conversation

@Pratik-1213
Copy link
Copy Markdown

Changes

Problem

The "Loved by developers" testimonial section on the landing page displayed the same
set of testimonials twice visibly due to a naive array duplication ([...testimonials, ...testimonials])
with a hardcoded translateX(-50%) scroll animation.

Fix

  • Added getUniqueTestimonials() helper — deduplicates testimonials by id using a Set,
    preventing any future duplicate data entries from showing up
  • Pixel-based scroll calculation — uses useRef + useEffect to measure the exact pixel
    width of one set of testimonials, then scrolls by that exact amount instead of a hardcoded 50%.
    This ensures the infinite loop resets seamlessly without visible duplication
  • Dynamic animation duration — speed scales proportionally to content width for consistent
    scroll velocity across all screen sizes
  • Added will-change: transform for smoother GPU-accelerated animation
  • Memoized unique testimonials and scroll array with useMemo to avoid unnecessary re-computation

Files Changed

  • src/Pages/Home/Testimonial.jsx

Related Issue

Closes #938

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Please mention these details about yourself here.

  1. Contributor Name : Pratik Kumbhar
  2. Contributor Email ID : kumbharpratik1213@gmail.com
  3. Contributor Github Link : https://github.com/Pratik-1213

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 18, 2026

@Pratik-1213 is attempting to deploy a commit to the premkolte's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown
Contributor

✨ Hi @Pratik-1213! Thanks for submitting another pull request. Your continuous improvements are highly valued. Keep contributing! 🙌

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.

[UI/UX] <short-title>Fix Duplicate Testimonial Mapping

1 participant