Skip to content

Enhancement: disable compare button during async requests#2240

Open
Plansha wants to merge 5 commits into
Priyanshu-byte-coder:mainfrom
Plansha:clean-disable-compare-button
Open

Enhancement: disable compare button during async requests#2240
Plansha wants to merge 5 commits into
Priyanshu-byte-coder:mainfrom
Plansha:clean-disable-compare-button

Conversation

@Plansha

@Plansha Plansha commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Description

This PR improves the Friend Comparison form by preventing duplicate async submissions during ongoing API requests.

Changes Made

  • Reused existing loading state to prevent repeated submissions
  • Disabled compare button during async requests
  • Added loading feedback (Comparing...)
  • Added guard clause to prevent duplicate API calls

Benefits

  • Prevents duplicate requests
  • Improves UX consistency
  • Avoids accidental repeated actions during async processing

Fixes #2238

@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

@Priyanshu-byte-coder 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:testing GSSoC type bonus: tests (+10 pts) labels Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

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

@Plansha

Plansha commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

@Priyanshu-byte-coder , Implemented loading-state protection for the Friend Comparison form by reusing the existing loading state.

Changes

  • Disabled compare button during async requests
  • Added duplicate submission guard clause
  • Added loading feedback (Comparing...)

Tested locally and verified that repeated clicks no longer trigger multiple requests.

@Priyanshu-byte-coder Priyanshu-byte-coder added gssoc:approved GSSoC: PR approved for scoring level:beginner GSSoC: Beginner difficulty (20 pts) labels Jun 9, 2026
@Priyanshu-byte-coder

Copy link
Copy Markdown
Owner

Hi! This PR has merge conflicts with the main branch. Could you please rebase or merge main into your branch to resolve them? We'd love to get this merged! 🚀

git fetch upstream
git rebase upstream/main
# resolve any conflicts
git push --force-with-lease

If you're no longer working on this, let us know and we can close it. Thanks!

@Priyanshu-byte-coder

Copy link
Copy Markdown
Owner

This PR has merge conflicts with the main branch. Please rebase your branch on latest main and resolve the conflicts so it can be reviewed and merged.

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 level:beginner GSSoC: Beginner difficulty (20 pts) type:testing GSSoC type bonus: tests (+10 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement]: Disable submit button during async API requests

2 participants