fix(landing): restore commented-out auto-reset timeout for copied indicator#6249
Conversation
…icator After a successful clipboard copy, setCopied(true) was called but the corresponding reset timeout was commented out, leaving the 'copied' success indicator stuck visible indefinitely instead of auto-dismissing after 3 seconds. Restores the existing copiedTimeoutRef-based timeout, consistent with the same pattern already used in CompareClient.tsx, customize/page.tsx, PreviewPanel.tsx, code-block.tsx, and ProfileOptimizerModal.tsx. Closes JhaSourav07#6248
|
Someone is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
📦 Next.js Bundle Size Report (Gzipped Sizes)✨ No significant bundle size changes detected. 📊 Summary of Totals
|
Aamod-Dev
left a comment
There was a problem hiding this comment.
Great catch! Restoring the copiedTimeoutRef timeout in app/components/LandingPageClient.tsx fixes the sticky 'copied' UI state. It's important to keep these success indicators consistent with the rest of the app. Approved!
|
🎉 Congratulations @nishupr! Your PR has been successfully merged. 🚀 Thank you for contributing to CommitPulse. Your work helps us build a better tool for the community.
Keep building! 💻✨ |
Description
Fixes #6248
In
app/components/LandingPageClient.tsx, after a successful clipboard copy,setCopied(true)is called, but the corresponding reset timeout was commented out:Problem with the old approach:
CompareClient.tsx,customize/page.tsx,PreviewPanel.tsx,code-block.tsx,ProfileOptimizerModal.tsx— all of which callsetTimeout(() => setCopied(false), ...)aftersetCopied(true))copiedTimeoutRefand a cleanup effect that clears it on unmount, but since the timeout was never scheduled, the cleanup had nothing to clear and the UI state never reset during normal usageWhat this PR does:
copiedTimeoutRefand cleanup logic that were already in place but unusedAfter:
Pillar
Visual Preview
No visual changes — this fixes a UI state reset bug, not styling.
Checklist before requesting a review:
CONTRIBUTING.mdfile.localhost:3000/api/streak?user=YOUR_USERNAME).npm run formatandnpm run lintlocally and resolved all errors (CI will fail otherwise).feat(themes): ...,fix(calculate): ...).README.mdif I added a new theme or URL parameter.