Skip to content

Comments

Fix/specific UI bugs#2655

Open
LuckyNawale wants to merge 5 commits intocodervivek5:mainfrom
LuckyNawale:fix/specific-ui-bugs
Open

Fix/specific UI bugs#2655
LuckyNawale wants to merge 5 commits intocodervivek5:mainfrom
LuckyNawale:fix/specific-ui-bugs

Conversation

@LuckyNawale
Copy link

@LuckyNawale LuckyNawale commented Sep 3, 2025

Bug Fixes: UI/UX Issues Resolution

Summary

Resolves three specific UI/UX issues to improve user experience and functionality.

Changes Made

  1. Footer Enhancement: Added GitHub repository link to social media section
  2. Signup Improvement: Added required terms & conditions acceptance checkbox
  3. Rating Fix: Synchronized star count with numerical rating display

Files Modified

  • src/User/components/Footer/Footer.jsx - GitHub link addition
  • src/User/pages/UserAuth/UserAuth.jsx - Terms checkbox implementation
  • src/User/components/Popular_Categories/ProductGrid.jsx - Rating display fix

Testing

  • GitHub link redirects correctly
  • Terms checkbox prevents submission when unchecked
  • Product ratings show consistent values

Type: Bug Fix

No breaking changes. Maintains existing functionality while fixing identified issues.

Summary by CodeRabbit

  • New Features

    • Added a GitHub repository icon/link to the footer’s social icons.
    • Added a required “Accept Terms & Privacy Policy” checkbox with links on the signup form; submission is blocked until accepted.
  • Bug Fixes

    • Product rating display now shows the rounded/clamped rating value (0–5) matching the star count and handles missing/non-numeric ratings.
  • Documentation

    • Fixed a typo in the README Contributing section.

@vercel
Copy link

vercel bot commented Sep 3, 2025

Someone is attempting to deploy a commit to the Vivek Prajapati's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 3, 2025

Walkthrough

Fixed a README typo, added a GitHub link to the footer, made product rating rendering robust and clamped, and added a required terms-acceptance checkbox to the signup form (HTML5 validation). No public/exported API changes.

Changes

Cohort / File(s) Summary of Changes
Documentation
README.md
Fixed typo: “accpet” → “accept”.
Footer social icons
src/User/components/Footer/Footer.jsx
Imported FaGithub and added a GitHub social link (https://github.com/codervivek5/VigyBag) with target="_blank", rel="noopener noreferrer", and aria-label="GitHub Repository".
Product rating display
src/User/components/Popular_Categories/ProductGrid.jsx
Compute rating with safe fallback and clamp: `rating = Math.max(0, Math.min(5, Math.round(Number(product.rating?.rate)
User signup form
src/User/pages/UserAuth/UserAuth.jsx
Added a required termsAccepted checkbox with links to Terms & Conditions and Privacy Policy; relies on HTML5 required validation to block submission until accepted.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Form as SignupForm(UI)
  participant Browser as BrowserValidation
  participant App as SubmissionHandler

  User->>Form: Fill inputs + (un)check termsAccepted
  User->>Form: Click "Sign Up"
  Form->>Browser: Trigger HTML5 validation (required fields incl. termsAccepted)
  alt validation fails (e.g., termsAccepted unchecked)
    Browser-->>User: Prevent submit, show validation message
  else validation passes
    Browser-->>Form: Validation OK
    Form->>App: Proceed with existing submit flow
    App-->>User: Handle response (success/error)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

OSCI, 1⭐

Suggested reviewers

  • codervivek5

Poem

A hop, a fix, a tiny new link,
Stars rounded true — no more to rethink.
“I agree” checked, the signup will fly,
README polished beneath morning sky.
From rabbit paws, a joyful nibble—🥕🐇

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • 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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@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)
README.md (1)

94-94: Typo fix looks good; tiny phrasing polish (optional).

Current sentence is correct. For a crisper tone, consider “subject to” instead of “pertaining to … stated below.”

Apply if you agree:

-We accept contributions to our project pertaining to the [Code of Conduct](https://github.com/codervivek5/VigyBag?tab=coc-ov-file) and [Contributing Guidelines](https://github.com/codervivek5/VigyBag/blob/main/CONTRIBUTING.md) stated below.
+We accept contributions to our project, subject to our [Code of Conduct](https://github.com/codervivek5/VigyBag?tab=coc-ov-file) and [Contributing Guidelines](https://github.com/codervivek5/VigyBag/blob/main/CONTRIBUTING.md) outlined below.
src/User/components/Popular_Categories/ProductGrid.jsx (1)

107-114: Optionally clamp rating to [0,5] before rendering.

Prevents unexpected arrays if rate is out-of-range.

Minimal change:

-          {[...Array(Math.round(product.rating.rate))].map((_, i) => (
+          {[
+            ...Array(
+              Math.max(0, Math.min(5, Math.round(product.rating.rate)))
+            ),
+          ].map((_, i) => (
             <span key={i} className="text-yellow-400">
               ⭐
             </span>
           ))}
-          <span className="text-gray-500 ml-1">({Math.round(product.rating.rate)})</span>
+          <span className="text-gray-500 ml-1">({Math.max(0, Math.min(5, Math.round(product.rating.rate)))})</span>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 36ca86e and c3b2b99.

📒 Files selected for processing (4)
  • README.md (1 hunks)
  • src/User/components/Footer/Footer.jsx (2 hunks)
  • src/User/components/Popular_Categories/ProductGrid.jsx (1 hunks)
  • src/User/pages/UserAuth/UserAuth.jsx (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
src/User/components/Popular_Categories/ProductGrid.jsx (3)
src/User/components/ProductCard/ProductCard.jsx (2)
  • _ (18-20)
  • div (4-45)
src/User/pages/Latest_in_the_Market/OrganicTea.jsx (1)
  • product (31-42)
src/User/utils/productFilters.js (2)
  • normalizeAndFilterByRating (1-9)
  • product (5-8)
src/User/pages/UserAuth/UserAuth.jsx (1)
src/Admin/Pages/VigyForm.jsx (1)
  • activeTab (9-409)
src/User/components/Footer/Footer.jsx (2)
src/User/components/About/ContributorCard.jsx (2)
  • link (17-27)
  • div (3-32)
src/User/pages/Contributors/Contributors.jsx (1)
  • link (386-403)
🔇 Additional comments (4)
src/User/pages/UserAuth/UserAuth.jsx (1)

461-486: Split policy links from checkbox label and add rel attributes
File: src/User/pages/UserAuth/UserAuth.jsx:461-486

-                    <div className="flex items-start space-x-2">
-                      <input
-                        type="checkbox"
-                        id="termsAccepted"
-                        required
-                        className="mt-1 h-4 w-4 rounded border-gray-300 text-emerald-600 focus:ring-emerald-500"
-                      />
-                      <label htmlFor="termsAccepted" className="text-xs text-gray-300">
-                        I agree to the{" "}
-                        <Link
-                          to="/terms-and-condition"
-                          className="text-[#4caf50] hover:underline"
-                          target="_blank"
-                        >
-                          Terms and Conditions
-                        </Link>{" "}
-                        and{" "}
-                        <Link
-                          to="/privacy-policy"
-                          className="text-[#4caf50] hover:underline"
-                          target="_blank"
-                        >
-                          Privacy Policy
-                        </Link>
-                      </label>
-                    </div>
+                    <div className="flex items-start space-x-2">
+                      <input
+                        type="checkbox"
+                        id="termsAccepted"
+                        required
+                        className="mt-1 h-4 w-4 rounded border-gray-300 text-emerald-600 focus:ring-emerald-500"
+                      />
+                      <div className="text-xs text-gray-300">
+                        <label htmlFor="termsAccepted">I agree to the</label>{" "}
+                        <Link
+                          to="/terms-and-condition"
+                          className="text-[#4caf50] hover:underline"
+                          target="_blank"
+                          rel="noopener noreferrer"
+                        >
+                          Terms and Conditions
+                        </Link>{" "}
+                        and{" "}
+                        <Link
+                          to="/privacy-policy"
+                          className="text-[#4caf50] hover:underline"
+                          target="_blank"
+                          rel="noopener noreferrer"
+                        >
+                          Privacy Policy
+                        </Link>
+                      </div>
+                    </div>

I couldn’t find any route definitions for /terms-and-condition or /privacy-policy—please verify those paths exist to avoid 404s.

src/User/components/Footer/Footer.jsx (2)

9-9: Import for GitHub icon is correct.


156-156: GitHub social link added correctly (secure, accessible).

Has target="_blank" with rel="noopener noreferrer" and an aria-label. LGTM.

src/User/components/Popular_Categories/ProductGrid.jsx (1)

113-114: Numeric rating now matches star count.

Switching to Math.round(product.rating.rate) keeps UI consistent.

Copy link
Contributor

@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: 1

🧹 Nitpick comments (2)
src/User/components/Popular_Categories/ProductGrid.jsx (2)

108-114: Optional: use FaStar for consistency and add an accessible label.

Other components use react-icons; aligning here improves UI consistency and accessibility.

-
+              <FaStar aria-hidden="true" />
           </span>
         ))}
+          <span className="sr-only">
+            {Math.max(0, Math.min(5, Math.round(Number(product.rating?.rate ?? 0)) || 0))} out of 5 stars
+          </span>

Add import (outside the shown hunk):

import { FaHeart, FaRegHeart, FaStar } from "react-icons/fa";

8-8: Remove unused import.

PaymentPage isn’t used and can be dropped to avoid lint warnings.

-import PaymentPage from "../../pages/Payment/Payment";
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c3b2b99 and 01aaabb.

📒 Files selected for processing (1)
  • src/User/components/Popular_Categories/ProductGrid.jsx (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/User/components/Popular_Categories/ProductGrid.jsx (3)
src/User/components/Products/ProductDetails.jsx (5)
  • product (256-256)
  • totalReviews (178-198)
  • acc (182-188)
  • rating (210-212)
  • calculatePercentages (177-215)
src/User/utils/productFilters.js (2)
  • normalizeAndFilterByRating (1-9)
  • product (5-8)
src/User/components/ProductCard/ProductCard.jsx (1)
  • _ (18-20)

Copy link
Contributor

@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

♻️ Duplicate comments (1)
src/User/components/Popular_Categories/ProductGrid.jsx (1)

108-120: Rating clamped/coerced and synced with stars + text — LGTM

Coerces to Number, rounds, clamps to [0,5], and reuses one value for stars and text. This resolves the prior bot comment.

🧹 Nitpick comments (3)
src/User/components/Popular_Categories/ProductGrid.jsx (3)

109-109: Nit: prefer nullish coalescing over truthiness fallback

Avoids accidental truthy/falsey semantics and reads clearer.

-            const rating = Math.max(0, Math.min(5, Math.round(Number(product.rating?.rate) || 0)));
+            const rating = Math.max(0, Math.min(5, Math.round(Number(product.rating?.rate ?? 0))));

112-118: Optional a11y: mark stars as decorative and add a screen-reader label

Improves SR output without visual changes.

-                {Array.from({ length: rating }).map((_, i) => (
-                  <span key={i} className="text-yellow-400">
+                <span className="sr-only">{`Rating: ${rating} out of 5`}</span>
+                {Array.from({ length: rating }).map((_, i) => (
+                  <span key={i} className="text-yellow-400" aria-hidden="true">
                     ⭐
                   </span>
                 ))}
-                <span className="text-gray-500 ml-1">({rating})</span>
+                <span className="text-gray-500 ml-1" aria-hidden="true">({rating})</span>

108-120: Extract shared rating normalization helper
Filter callbacks in src/User/pages/Popular_Categories/*.jsx and src/User/pages/Latest_in_the_Market/*.jsx use Math.round(product.rating.rate) without clamping, whereas ProductGrid.jsx clamps to [0, 5] before rendering. Extract a helper—e.g.

function getNormalizedRating(rate) {
  const n = Math.round(Number(rate) || 0);
  return Math.max(0, Math.min(5, n));
}

Then import and use it in both ProductGrid.jsx and all filter functions (e.g. in Beauty-Wellness.jsx, Health-Supplements.jsx, etc.) to keep filtering and display consistent.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 01aaabb and 91a4e99.

📒 Files selected for processing (1)
  • src/User/components/Popular_Categories/ProductGrid.jsx (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/User/components/Popular_Categories/ProductGrid.jsx (5)
src/User/components/Products/ProductDetails.jsx (5)
  • product (256-256)
  • rating (210-212)
  • totalReviews (178-198)
  • acc (182-188)
  • calculatePercentages (177-215)
src/User/utils/productFilters.js (2)
  • normalizeAndFilterByRating (1-9)
  • product (5-8)
src/User/components/ProductCard/ProductCard.jsx (1)
  • _ (18-20)
src/User/components/Popular_Categories/Filters.jsx (1)
  • e (46-49)
src/User/pages/Latest_in_the_Market/ArtSupplies.jsx (1)
  • product (32-43)

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