Skip to content

Add copy toast feedback#627

Open
shreyamittal0622 wants to merge 64 commits into
JhaSourav07:mainfrom
shreyamittal0622:add-copy-toast-feedback
Open

Add copy toast feedback#627
shreyamittal0622 wants to merge 64 commits into
JhaSourav07:mainfrom
shreyamittal0622:add-copy-toast-feedback

Conversation

@shreyamittal0622
Copy link
Copy Markdown

Description

Added toast notifications for copy-to-clipboard actions to improve user feedback and usability.
Fixes #614

Pillar

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

##Changes Made

  • Added react-hot-toast
  • Added global in app/layout.tsx
  • Added success toast for successful markdown copy
  • Added error toast handling for clipboard failures
  • Prevented duplicate toast notifications using toast IDs

##Why

Previously, users received no clear feedback after clicking the copy button, which could make the action feel unresponsive.

This improves the overall UX by providing immediate visual confirmation for copy actions.

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.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 27, 2026

@shreyamittal0622 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

👋 Hey @shreyamittal0622, welcome to CommitPulse! 🎉

Thanks for opening your first pull request — this is a big deal and we appreciate the effort!

While you wait for a review, please double-check:

  • ✅ You've read the CONTRIBUTING.md checklist
  • npm run lint, npm run format, and npm run test all pass locally
  • ✅ Your PR has a visual preview if it touches any SVG output
  • 💬 You've joined our Discord for faster PR feedback

A maintainer will review your PR shortly. Hang tight! 🚀

@github-actions github-actions Bot added the status:blocked This PR is blocked due to a failing CI check. label May 27, 2026
@github-actions
Copy link
Copy Markdown

🚨 Hey @shreyamittal0622, the CI Pipeline is failing on this PR and it has been marked as status:blocked.

Please fix the issues before this can be reviewed. Here's how:

1. Run checks locally before pushing:

npm run format:check   # Check Prettier formatting
npm run lint           # Run ESLint
npm run typecheck      # TypeScript type check
npm run test           # Run unit tests (Vitest)
npm run build          # Verify production build passes

2. Auto-fix common issues:

npm run format         # Auto-fix formatting with Prettier
npm run lint -- --fix  # Auto-fix lint errors where possible

3. Check the full failure log here:
👉 View CI Run

Once you push a fix and the CI passes, the status:blocked label will be removed automatically. 💪

@github-actions github-actions Bot added type:bug Something isn't working as expected and removed status:blocked This PR is blocked due to a failing CI check. labels May 27, 2026
@shreyamittal0622
Copy link
Copy Markdown
Author

visual Preview

Screenshot 2026-05-27 191424 A message appears succesfully showing copied and giving user a better interface.

Copy link
Copy Markdown
Collaborator

@Aamod007 Aamod007 left a comment

Choose a reason for hiding this comment

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

{children} rendered twice in app/layout.tsx:75 — line 75 has a duplicate {children} just before . The page content already renders on line 72. This second {children} will cause the entire page to render twice. Remove that line.

@shreyamittal0622 shreyamittal0622 requested a review from Aamod007 May 27, 2026 15:02
@github-actions github-actions Bot added status:blocked This PR is blocked due to a failing CI check. needs-rebase This PR has merge conflicts and needs a rebase. and removed status:blocked This PR is blocked due to a failing CI check. labels May 27, 2026
@github-actions
Copy link
Copy Markdown

⚠️ Hey @shreyamittal0622, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

1 similar comment
@github-actions
Copy link
Copy Markdown

⚠️ Hey @shreyamittal0622, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

sandesh-861 and others added 11 commits May 28, 2026 09:30
## Description

Fixes JhaSourav07#397

## Pillar

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

## Visual Preview

N/A - Test only, no visual changes

## Checklist before requesting a review:

- [x] I have read the `CONTRIBUTING.md` file.
- [x] I have tested these changes locally.
- [x] I have run `npm run format` and `npm run lint` locally and
resolved all errors.
- [x] My commits follow the Conventional Commits format.
- [ ] I have updated `README.md` if I added a new theme or URL
parameter.
- [x] I have starred the repo.
- [x] 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.
- [ ] (Recommended) I joined the CommitPulse Discord server.
* refactor(i18n): add Portuguese locale to badge labels

* style(readme): format Portuguese locale docs
* test(api): add integration tests for og route

* fix(test): resolve og route typecheck issues
ShreyasPatil3105 and others added 9 commits May 28, 2026 09:54
…26 ] (JhaSourav07#598)

* fix(TTLCache): reset insertion order on key update in set()

* ci: retrigger pipeline
* refactor(i18n): add Korean locale to badge labels

* style(readme): format after conflict resolution

* fix(readme): remove merge artifacts
* docs: add architecture overview

* style: format architecture document

* style: apply prettier formatting
## Description
- exported cacheKey function
- added unit tests for cacheKey
- tested with and without year
- tested lowercase conversion
- tested all three kind values
- 
Fixes JhaSourav07#364 

## Pillar

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

## Visual Preview
N/A

## Checklist before requesting a review:

- [x] I have read the `CONTRIBUTING.md` file.
- [x] I have tested these changes locally
(`localhost:3000/api/streak?user=YOUR_USERNAME`).
- [x] I have run `npm run format` and `npm run lint` locally and
resolved all errors (CI will fail otherwise).
- [x] 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.
- [x] 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.
@shreyamittal0622 shreyamittal0622 force-pushed the add-copy-toast-feedback branch from 6dc0c14 to 2fc3259 Compare May 28, 2026 04:25
@github-actions github-actions Bot added the status:blocked This PR is blocked due to a failing CI check. label May 28, 2026
@shreyamittal0622 shreyamittal0622 force-pushed the add-copy-toast-feedback branch from a0e33c1 to d7acce4 Compare May 28, 2026 04:55
@shreyamittal0622 shreyamittal0622 force-pushed the add-copy-toast-feedback branch from 3c81f48 to 104353d Compare May 28, 2026 05:04
@shreyamittal0622
Copy link
Copy Markdown
Author

can u please see into it i am fixing thses things again and again

@shreyamittal0622 shreyamittal0622 force-pushed the add-copy-toast-feedback branch from a8a0890 to 104353d Compare May 28, 2026 05:15
@github-actions github-actions Bot removed the status:blocked This PR is blocked due to a failing CI check. label May 28, 2026
@shreyamittal0622
Copy link
Copy Markdown
Author

all issues have been fixed kindly merge it

@github-actions github-actions Bot added type:feature New features, additions, or enhancements and removed type:bug Something isn't working as expected needs-rebase This PR has merge conflicts and needs a rebase. labels May 28, 2026
Copy link
Copy Markdown
Collaborator

@Aamod007 Aamod007 left a comment

Choose a reason for hiding this comment

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

  • useRecentSearches hydration bug — The original code used useEffect to load from localStorage, ensuring SSR and client first render both returned empty (no mismatch). The new code uses a useState lazy initializer that reads localStorage during the client's hydration render, producing different output than the SSR HTML → hydration mismatch.
  • Unused dependency — react-hot-toast is installed with zero usage. Unnecessary bundle bloat.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR is intended to add toast feedback for copy-to-clipboard actions, but the submitted changes mostly add a toast dependency and include unrelated hook/footer changes without implementing the described copy toast behavior.

Changes:

  • Adds react-hot-toast to dependencies and lockfile.
  • Refactors useRecentSearches localStorage hydration logic.
  • Adjusts footer spacing/alignment styles.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
package.json Adds react-hot-toast dependency.
package-lock.json Updates lockfile for the new dependency, with additional metadata churn.
hooks/useRecentSearches.ts Refactors recent-search persistence and hydration behavior.
app/components/Footer.tsx Changes footer layout and spacing classes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
"next": "^16.2.3",
"react": "19.2.4",
"react-dom": "19.2.4",
"react-hot-toast": "^2.6.0",
Comment on lines +14 to +28
const [state, setState] = useState<State>(() => {
if (typeof window === 'undefined') {
return {
searches: [],
mounted: false,
};
}

localStorage.setItem(STORAGE_KEY, JSON.stringify(searches));
} catch {
// ignore storage write failures
}
}
try {
const stored = localStorage.getItem(STORAGE_KEY);

return {
searches: stored ? (JSON.parse(stored) as string[]) : [],
mounted: true,
};
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

i have actually done the same only

Comment thread app/components/Footer.tsx
Comment on lines +5 to +6
<footer className="mt-14 border-t border-black/15 bg-transparent pt-10 pb-4 text-sm transition-colors dark:border-white/10">
<div className="mx-auto flex max-w-7xl flex-col items-start justify-between gap-8 px-6 md:flex-row">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New features, additions, or enhancements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add success toast for embed/copy link actions