Skip to content

fix(landing): restore commented-out auto-reset timeout for copied indicator#6249

Merged
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
nishupr:fix/copied-indicator-reset-6248
Jun 21, 2026
Merged

fix(landing): restore commented-out auto-reset timeout for copied indicator#6249
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
nishupr:fix/copied-indicator-reset-6248

Conversation

@nishupr

@nishupr nishupr commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

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:

setCopied(true);
scrollTimeoutRef.current = setTimeout(() => {
  guideRef.current?.scrollIntoView({ behavior: 'smooth', block: 'start' });
}, 80);
//if (copiedTimeoutRef.current) clearTimeout(copiedTimeoutRef.current);
//copiedTimeoutRef.current = setTimeout(() => setCopied(false), 3000);

Problem with the old approach:

  • The "copied" success indicator stayed visible indefinitely after a copy action, instead of auto-dismissing after ~3 seconds like the equivalent pattern used everywhere else in the codebase (CompareClient.tsx, customize/page.tsx, PreviewPanel.tsx, code-block.tsx, ProfileOptimizerModal.tsx — all of which call setTimeout(() => setCopied(false), ...) after setCopied(true))
  • The component already has a copiedTimeoutRef and 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 usage

What this PR does:

  • Uncomments and restores the auto-reset timeout, consistent with the pattern used elsewhere in the codebase
  • Reuses the existing copiedTimeoutRef and cleanup logic that were already in place but unused
  • No new state or refs introduced — purely restoring intended existing behavior

After:

setCopied(true);
scrollTimeoutRef.current = setTimeout(() => {
  guideRef.current?.scrollIntoView({ behavior: 'smooth', block: 'start' });
}, 80);
if (copiedTimeoutRef.current) clearTimeout(copiedTimeoutRef.current);
copiedTimeoutRef.current = setTimeout(() => setCopied(false), 3000);

Pillar

  • 🎨 Pillar 1 — New Theme Design
  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other (Bug fix, refactoring, docs)

Visual Preview

No visual changes — this fixes a UI state reset bug, not styling.

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (localhost:3000/api/streak?user=YOUR_USERNAME).
  • I have run npm run format and npm run lint locally and resolved all errors (CI will fail otherwise).
  • My commits follow the Conventional Commits format (e.g., feat(themes): ..., fix(calculate): ...).
  • I have updated README.md if I added a new theme or URL parameter.
  • I have started the repo.
  • I have made sure that i have only one commit to merge in this PR.
  • The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts).
  • (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.

…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
@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Size Report (Gzipped Sizes)

✨ No significant bundle size changes detected.

📊 Summary of Totals

Category PR Size Base Size Difference
Total JS 3697.07 KB 3697.00 KB +0.07 KB (+0.00%)
Total CSS 296.58 KB 296.58 KB 0 B

@Aamod-Dev Aamod-Dev added GSSoC 2026 mentor:Aamod007 level:beginner Small changes Usually isolated fixes or simple UI/text updates. quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. bug Something isn't working labels Jun 21, 2026

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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!

@JhaSourav07 JhaSourav07 added the gssoc:approved PR has been reviewed and accepted for valid contribution points label Jun 21, 2026
@JhaSourav07 JhaSourav07 merged commit 1d59732 into JhaSourav07:main Jun 21, 2026
10 of 11 checks passed
@github-actions github-actions Bot added this to the GSSoC 2026 milestone Jun 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎉 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.

⚠️ Important for GSSoC Contributors:
You are strictly advised to join our Discord Server as it is mandatory for all GSSoC participants. All important announcements, point claims, and community discussions happen there.

Keep building! 💻✨

@github-actions github-actions Bot added the type:bug Something isn't working as expected label Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working gssoc:approved PR has been reviewed and accepted for valid contribution points GSSoC 2026 level:beginner Small changes Usually isolated fixes or simple UI/text updates. mentor:Aamod007 quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: "copied" success indicator never auto-resets in LandingPageClient (commented-out timeout)

3 participants