Skip to content

feat: add fresh copy success toast for badge markdown#1747

Open
codedbydollys10 wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
codedbydollys10:fix-badge-toast-v2
Open

feat: add fresh copy success toast for badge markdown#1747
codedbydollys10 wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
codedbydollys10:fix-badge-toast-v2

Conversation

@codedbydollys10
Copy link
Copy Markdown
Contributor

Summary

Added a toast/snackbar notification when badge markdown is copied from the Badge Section.

Closes #160


Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor / code cleanup

Changes Made

  • Added a success toast notification for badge markdown copy actions
  • Toast appears at the bottom of the screen after a successful clipboard write
  • Toast automatically dismisses after approximately 2000ms
  • Added accessibility support with role="status" and aria-live="polite"
  • Preserved the existing inline ✓ Copied! button state
  • Ensured functionality works for all badge copy actions (streak, commits, combined)

How to Test

  1. Navigate to the Badge Section

  2. Click the Streak badge copy button

  3. Verify:

    • Badge markdown is copied to the clipboard
    • Existing ✓ Copied! button state still appears
    • Toast appears at the bottom of the screen
  4. Wait ~2 seconds and confirm the toast disappears

  5. Repeat for:

    • Commits badge copy button
    • Combined badge copy button

Screenshots (if UI change)


Checklist

  • Linked issue in summary
  • Self-reviewed the diff
  • No unrelated files modified
  • Existing functionality preserved
  • Added/updated tests if applicable

Accessibility Checklist

  • role="status" added
  • aria-live="polite" added
  • Keyboard interaction remains unchanged
  • Existing UI behavior preserved

Additional Notes

Implementation was intentionally limited to src/components/BadgeSection.tsx to keep the change focused and minimize merge conflict risk.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 31, 2026

@codedbydollys10 is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:feature GSSoC type bonus: new feature labels May 31, 2026
@github-actions
Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@codedbydollys10
Copy link
Copy Markdown
Contributor Author

Hello @Priyanshu-byte-coder
Apologies for the duplicate PR on the same issue. My previous PR kept running into recurring merge conflicts even after multiple resolutions, so I started fresh from an updated branch and recreated the fix to keep the changes clean and conflict-free. Thanks for your understanding.

The failing Playwright test appears unrelated to this change.

This PR only modifies src/components/BadgeSection.tsx to add a toast notification after successful badge markdown copy actions.

The CI failure occurs in e2e/dashboard-widgets.spec.js where getByRole('heading', { name: 'Goals' }) matches both "Goals & Insights" and "Goals", causing a strict mode violation. This appears to be an existing dashboard test issue and is outside the scope of the badge toast implementation.

@Priyanshu-byte-coder Priyanshu-byte-coder added level1 GSSoC Level 1 - Beginner (10 points) gssoc:approved GSSoC: PR approved for scoring labels May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC: PR approved for scoring gssoc26 GSSoC 2026 contribution level1 GSSoC Level 1 - Beginner (10 points) type:feature GSSoC type bonus: new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GOOD FIRST ISSUE] Show 'Copied!' toast when copying badge markdown in BadgeSection

2 participants