Skip to content

Comments

Shree#103

Open
Shriii19 wants to merge 8 commits intoRamakrushnaBiswal:mainfrom
Shriii19:shree
Open

Shree#103
Shriii19 wants to merge 8 commits intoRamakrushnaBiswal:mainfrom
Shriii19:shree

Conversation

@Shriii19
Copy link

@Shriii19 Shriii19 commented Nov 2, 2025

#31 issues is solve check it and let me know that it is working well
We added spinning loaders to buttons when they're working.

What You'll See:
Click "Sign Up" → Shows spinner + "Creating Account..."
Click "Sign In" → Shows spinner + "Signing In..."
Click "Verify" → Shows spinner + "Verifying..."
Click "Generate Certificate" → Shows spinner + "Generating..."
Click "Subscribe" → Shows spinner + "Subscribing..."

Why:
So users know the app is working and not frozen.

Summary by CodeRabbit

  • New Features
    • Added a reusable animated loading spinner used across Sign Up, Sign In, Verify, Certificate Generation and Newsletter flows.
    • Buttons now show a spinner + descriptive text while processing and are disabled during loading.
    • Certificate generation shows a placeholder spinner while fetching the latest image, improving feedback for long requests.

@vercel
Copy link

vercel bot commented Nov 2, 2025

@Shriii19 is attempting to deploy a commit to the bunty's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link

coderabbitai bot commented Nov 2, 2025

Walkthrough

Adds a reusable LoadingSpinner component and integrates it into multiple frontend components to show inline and placeholder spinners during async operations; introduces a fetchingImage state in Generate.jsx to track image retrieval. No business logic or public API signatures changed.

Changes

Cohort / File(s) Summary
New Component
Frontend/src/components/LoadingSpinner.jsx
New default-exported React component LoadingSpinner({ size = "medium", message = "Loading..." }) with Framer Motion rotation and optional fade-in message; supports small/medium/large sizes and Tailwind-like styling.
Generate (image flow)
Frontend/src/components/Generate.jsx
Adds fetchingImage state; fetchLatestImage sets fetchingImage true/false and updates uploadedImage; UI shows LoadingSpinner placeholder while image fetches; generate button renders spinner+text when loading.
Button integrations
Frontend/src/components/Newsletter.jsx, Frontend/src/components/SignIn.jsx, Frontend/src/components/SignUp.jsx, Frontend/src/components/Verify.jsx
Import LoadingSpinner and replace plain loading text in buttons with an inline spinner + loading text; preserve existing loading booleans and disabled behavior.
Documentation
LOADING_SPINNER_IMPLEMENTATION.md, PR_DESCRIPTION.md
New documentation describing the LoadingSpinner, integration pattern, animation details, and testing notes.
Manifest / Misc
package.json
(Referenced in summary) Potentially updated manifest entries (no signature/API changes reported).

Sequence Diagram(s)

sequenceDiagram
    participant UI as Generate.jsx (UI)
    participant API as Backend / Storage
    participant Spinner as LoadingSpinner

    Note over UI,Spinner #DDEBF7: On mount / generate click
    UI->>UI: set fetchingImage = true / set loading = true
    UI->>Spinner: render placeholder spinner
    UI->>API: fetchLatestImage / generate certificate (async)
    API-->>UI: image URL / result
    UI->>UI: set uploadedImage, fetchingImage = false, loading = false
    Note over UI,Spinner #E6F4EA: UI swaps spinner for image / shows generated output
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Mixed edits: one new component and multiple UI integrations (consistent pattern).
  • Areas needing attention:
    • Generate.jsx fetchingImage lifecycle and race conditions between mount fetch and generate action.
    • Accessibility and focus/disabled states on buttons after replacing inner content.
    • Framer Motion animation performance and class name sizing across button contexts.

Possibly related PRs

Suggested labels

enhancement, Level 2, GSSOC-25

Suggested reviewers

  • RamakrushnaBiswal

Poem

🐰 I twirled a purple spinner bright,
A gentle whirl through day and night,
Buttons gleam with patient light,
Images load and then take flight,
Hooray — the UI feels just right!

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The PR title "Shree" is a single word name that bears no relation to the actual changes in the pull request. The changeset introduces a LoadingSpinner component and integrates it across multiple frontend components (SignUp, SignIn, Verify, Generate, Newsletter) to display loading indicators. The title does not describe any aspect of these changes and would be misleading to someone reviewing the project history, as it provides no meaningful information about what was modified.
Description Check ⚠️ Warning The PR description is largely incomplete when compared to the repository's description template. While it does communicate the general intent (adding spinning loaders to buttons for user feedback) with helpful examples of what users will see, it omits most required template sections including: proper issue linking format (missing "Closes #31" syntax), no Type of Change selection, no structured Changes Made list, no screenshots, no testing section with checkboxes or test cases, no completed checklist items, and no information about contribution guidelines. The description is also informal and lacks the structured format specified in the template.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (2)
Frontend/src/components/LoadingSpinner.jsx (1)

3-35: LGTM! Well-designed reusable component.

The LoadingSpinner component is well-structured with good API design (size variants and customizable message). The Framer Motion animations are smooth and appropriate.

However, I noticed that while this component is imported in Verify.jsx, SignIn.jsx, Newsletter.jsx, and SignUp.jsx, it's not actually used in any of them—they all implement inline spinners instead. Only Generate.jsx uses it. Consider using this component consistently across all files to eliminate code duplication.

Frontend/src/components/Generate.jsx (1)

211-216: Consider using LoadingSpinner for consistency.

The Generate button uses an inline spinner, but since you're already using the LoadingSpinner component for the image placeholder (lines 197-203), consider using it here too for consistency:

-            {loading ? (
-              <div className="flex items-center justify-center gap-2">
-                <div className="w-5 h-5 border-3 border-white border-t-transparent rounded-full animate-spin"></div>
-                <span>Generating...</span>
-              </div>
-            ) : "Generate Certificate"}
+            {loading ? (
+              <div className="flex items-center justify-center gap-2">
+                <LoadingSpinner size="small" message="" />
+                <span>Generating...</span>
+              </div>
+            ) : "Generate Certificate"}

This would make Generate.jsx the reference implementation showing how to use LoadingSpinner consistently for both standalone loading states and inline button loading states.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2266687 and 9aebb12.

📒 Files selected for processing (7)
  • Frontend/src/components/Generate.jsx (4 hunks)
  • Frontend/src/components/LoadingSpinner.jsx (1 hunks)
  • Frontend/src/components/Newsletter.jsx (2 hunks)
  • Frontend/src/components/SignIn.jsx (2 hunks)
  • Frontend/src/components/SignUp.jsx (2 hunks)
  • Frontend/src/components/Verify.jsx (2 hunks)
  • LOADING_SPINNER_IMPLEMENTATION.md (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-04T19:02:27.890Z
Learnt from: cherylpinto
Repo: RamakrushnaBiswal/HonorBox PR: 79
File: Frontend/src/components/Navbar.jsx:0-0
Timestamp: 2025-08-04T19:02:27.890Z
Learning: In the HonorBox project Frontend/src/components/Navbar.jsx, the email change functionality includes a confirmation modal triggered by clicking the "Change" button, which calls setShowConfirmEmailChange(true) and displays a modal asking for user confirmation before applying the email change via handleEmailChange().

Applied to files:

  • Frontend/src/components/Verify.jsx
📚 Learning: 2025-08-04T18:51:46.896Z
Learnt from: cherylpinto
Repo: RamakrushnaBiswal/HonorBox PR: 79
File: Frontend/src/components/Navbar.jsx:0-0
Timestamp: 2025-08-04T18:51:46.896Z
Learning: In the HonorBox project Frontend/src/components/Navbar.jsx, the password change functionality in confirmChangePassword() intentionally only logs to console as this was a UI-only enhancement PR, with backend integration planned for future implementation.

Applied to files:

  • Frontend/src/components/Verify.jsx
  • Frontend/src/components/SignIn.jsx
  • Frontend/src/components/SignUp.jsx
🧬 Code graph analysis (3)
Frontend/src/components/LoadingSpinner.jsx (1)
Frontend/src/components/Generate.jsx (1)
  • message (11-11)
Frontend/src/components/Generate.jsx (1)
Frontend/src/components/LoadingSpinner.jsx (1)
  • LoadingSpinner (3-35)
Frontend/src/components/SignUp.jsx (1)
Frontend/src/components/SignIn.jsx (1)
  • loading (19-19)
🪛 LanguageTool
LOADING_SPINNER_IMPLEMENTATION.md

[style] ~106-~106: Some style guides suggest that commas should set off the year in a month-day-year date.
Context: ...- Implementation Date: November 2, 2025 Status: ✅ Complete **Code Condi...

(MISSING_COMMA_AFTER_YEAR)

🔇 Additional comments (2)
Frontend/src/components/Generate.jsx (2)

16-16: LGTM! Good loading state management.

The new fetchingImage state is properly initialized and managed—set to true when fetching starts and reset to false in the finally block. This ensures the loading state is always cleaned up.

Also applies to: 27-27, 35-36


197-203: LGTM! Excellent use of LoadingSpinner component.

This is the only file in the PR that actually uses the LoadingSpinner component as intended. The placeholder with "Loading image..." message provides clear feedback during image fetch.

Comment on lines +1 to +108
# Loading Spinner Implementation

## Overview
Added visual loading spinners/indicators to improve user feedback during network requests throughout the application, **without changing any existing logic**.

## What Was Added

### 1. New Component: LoadingSpinner.jsx
- **Location**: `Frontend/src/components/LoadingSpinner.jsx`
- **Features**:
- Reusable animated spinner component
- Three sizes: small, medium, large
- Customizable loading message
- Smooth animations using Framer Motion
- Purple-themed design matching the app's color scheme

### 2. Enhanced Components with Loading Indicators

#### SignUp.jsx
- ✅ Added inline spinner to "Sign Up" button during account creation
- ✅ Shows rotating spinner icon + "Creating Account..." text
- ✅ Button is disabled during loading
- ✅ Works for both standard signup and Google OAuth

#### SignIn.jsx
- ✅ Added inline spinner to "Sign In" button during authentication
- ✅ Shows rotating spinner icon + "Signing In..." text
- ✅ Button is disabled during loading
- ✅ Prevents multiple submissions

#### Verify.jsx
- ✅ Added inline spinner to "Verify" button during certificate verification
- ✅ Shows rotating spinner icon + "Verifying..." text
- ✅ Button is disabled during loading

#### Generate.jsx
- ✅ Added inline spinner to "Generate Certificate" button
- ✅ Shows rotating spinner icon + "Generating..." text
- ✅ Added loading state for fetching uploaded images on component mount
- ✅ Shows LoadingSpinner component while image is loading

#### Newsletter.jsx
- ✅ Added inline spinner to "Subscribe" button
- ✅ Shows rotating spinner icon + "Subscribing..." text
- ✅ Maintains the beautiful animation effects during loading

## Design Features

### Spinner Animation
- Clean, professional rotating border animation
- Uses Tailwind CSS `animate-spin` utility
- White spinner on colored button backgrounds
- Smooth 360° rotation

### User Experience Improvements
1. **Visual Feedback**: Users can see when their action is being processed
2. **Button States**: Buttons are disabled during loading to prevent duplicate submissions
3. **Clear Messaging**: Text changes to indicate what's happening (e.g., "Generating...", "Verifying...")
4. **Consistent Design**: All loading indicators follow the same design pattern
5. **Non-intrusive**: Spinners are inline with button text, not blocking the entire UI

## Technical Implementation

### No Logic Changes
- ✅ All existing loading states (`loading` variable) were preserved
- ✅ No changes to async/await patterns
- ✅ No changes to error handling
- ✅ No changes to success/failure flows
- ✅ Only added visual components to existing loading states

### Key Pattern Used
```jsx
{loading ? (
<div className="flex items-center justify-center gap-2">
<div className="w-5 h-5 border-3 border-white border-t-transparent rounded-full animate-spin"></div>
<span>Loading Text...</span>
</div>
) : "Normal Button Text"}
```

## Components Updated
1. ✅ `SignUp.jsx` - Account creation spinner
2. ✅ `SignIn.jsx` - Authentication spinner
3. ✅ `Verify.jsx` - Certificate verification spinner
4. ✅ `Generate.jsx` - Certificate generation & image loading spinners
5. ✅ `Newsletter.jsx` - Subscription spinner

## Files Created
- `Frontend/src/components/LoadingSpinner.jsx` - Reusable spinner component

## Benefits
1. **Better UX**: Users know their actions are being processed
2. **Professional Look**: Modern loading indicators match the app's design
3. **Prevents Errors**: Disabled buttons during loading prevent duplicate submissions
4. **Accessibility**: Clear visual feedback for all interactions
5. **Maintainability**: Consistent pattern across all components

## Testing Recommendations
- Test slow network conditions to see spinners in action
- Verify spinners appear on all form submissions
- Confirm buttons are properly disabled during loading
- Check that spinners disappear after requests complete (success or error)

---

**Implementation Date**: November 2, 2025
**Status**: ✅ Complete
**Code Condition**: No existing logic was changed, only visual enhancements added
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Update documentation to reflect actual implementation.

The documentation states that a reusable LoadingSpinner component is used across all components, but the actual implementation shows that Verify.jsx, SignIn.jsx, Newsletter.jsx, and SignUp.jsx use inline spinner code instead of the LoadingSpinner component. Only Generate.jsx actually uses the LoadingSpinner component.

Consider updating this documentation to accurately reflect the implementation, or better yet, refactor the components to consistently use the LoadingSpinner component as documented.

🧰 Tools
🪛 LanguageTool

[style] ~106-~106: Some style guides suggest that commas should set off the year in a month-day-year date.
Context: ...- Implementation Date: November 2, 2025 Status: ✅ Complete **Code Condi...

(MISSING_COMMA_AFTER_YEAR)

🤖 Prompt for AI Agents
LOADING_SPINNER_IMPLEMENTATION.md lines 1-108: the doc claims a reusable
LoadingSpinner.jsx is used everywhere but only Generate.jsx imports it while
Verify.jsx, SignIn.jsx, Newsletter.jsx, and SignUp.jsx use inline spinner
markup; either update the doc to list which components use the reusable
component vs inline implementations, or refactor the four components to import
LoadingSpinner.jsx and replace their inline spinner JSX with <LoadingSpinner />
(pass size/message props matching existing texts like "Creating Account...",
"Signing In...", "Verifying...", "Subscribing..."), remove duplicated spinner
markup, ensure buttons remain disabled during loading, run the app and tests to
confirm visual parity, and update the documentation to reflect the final state.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
PR_DESCRIPTION.md (2)

29-32: Fix spelling inconsistency: "signin" → "sign in".

For consistency with standard terminology, use "sign in" (two words) or "sign-in" (hyphenated) instead of "signin" in user-facing documentation.

2. **SignIn.jsx**
-  - Added spinner to signin button during authentication
+  - Added spinner to sign in button during authentication
-  - Shows rotating icon + "Signing In..." text
+  - Shows rotating icon + "Signing In..." text
   - Button disabled during loading

76-82: Fix spelling inconsistency: "signin flow" → "sign in flow".

Apply the same consistency fix to the test cases section.

2. **SignIn Component**
   - Tested login with valid credentials
   - Verified spinner appears during authentication
   - Confirmed button is disabled during loading
-  - Tested Google OAuth signin flow
+  - Tested Google OAuth sign in flow
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9aebb12 and 27c93c5.

📒 Files selected for processing (1)
  • PR_DESCRIPTION.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
PR_DESCRIPTION.md

[grammar] ~30-~30: Ensure spelling is correct
Context: ...2. SignIn.jsx - Added spinner to signin button during authentication - Shows...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[grammar] ~81-~81: Ensure spelling is correct
Context: ...during loading - Tested Google OAuth signin flow 3. Verify Component - Test...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🪛 markdownlint-cli2 (0.18.1)
PR_DESCRIPTION.md

149-149: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

🔇 Additional comments (1)
PR_DESCRIPTION.md (1)

1-148: PR description is well-structured and comprehensive.

The PR description clearly communicates:

  • Purpose and user impact (visual loading feedback)
  • Detailed list of components enhanced
  • Comprehensive test coverage across all affected flows
  • Technical approach and implementation details
  • Benefits aligned with UX best practices

The documentation provides adequate context for reviewers to understand the scope and impact of the changes.

@Shriii19 Shriii19 marked this pull request as draft November 20, 2025 12:34
@Shriii19 Shriii19 marked this pull request as ready for review November 20, 2025 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant