AI Review Center
Commit Review Workspace ?
Select a commit on the left to inspect quality, security, business value, findings, and suggested code changes.
Project AI Score
?
63%
Quality Avg
?
68%
Security Avg
?
45%
Reviews
?
56
Review Result ?
jattin01/avriti · a36e988f
This commit adds a new order-confirmation popup to the checkout page with a redirect after 5 seconds, links to order list and shop, and improves the services page with service-tier selection and corresponding pricing. It also adds service CSS for rich content formatting and improves image rendering in order cards and order pages. The commit message is brief and has typos. The code improvements increase usability and user feedback after order submission.
Quality
?
80%
Security
?
50%
Business Value
?
85%
Maintainability
?
80%
Issues & Suggested Fixes
?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Typo And Clarity Issue
Where
commit message
Issue / Evidence
typo and clarity issue
Suggested Fix
fix spelling and improve detail to better reflect changes made
Use Of Settimeout With Direct Window.locat...
Where
app/checkout/page.tsx:545
Issue / Evidence
use of setTimeout with direct window.location.href
Suggested Fix
consider using router navigation method for SPA behavior and better reliability
Use Of Settimeout With Direct Window.locat...
Where
app/checkout/page.tsx:607
Issue / Evidence
use of setTimeout with direct window.location.href
Suggested Fix
consider using router navigation method for SPA behavior and better reliability
Inline Event Handlers With Side Effects
Where
app/checkout/page.tsx:660
Issue / Evidence
inline event handlers with side effects
Suggested Fix
consider extracting to named functions for readability and testability
Inline Event Handlers With Side Effects
Where
app/checkout/page.tsx:666
Issue / Evidence
inline event handlers with side effects
Suggested Fix
consider extracting to named functions for readability and testability
Missing Validation
Where
app/services/[slug]/page.tsx:194
Issue / Evidence
persisting buyNowItem in localStorage without validation
Suggested Fix
consider validating or sanitizing data before storage
Using Window.location.href For Navigation
Where
app/services/[slug]/page.tsx:195
Issue / Evidence
using window.location.href for navigation
Suggested Fix
prefer next/router or Link for client-side navigation to prevent full page reloads
Image Uses Img Tag With Src
Where
components/order-card.tsx:40
Issue / Evidence
image uses img tag with src
Suggested Fix
prefer Next.js Image component for optimized image loading and performance
Code Change Preview · .gitignore
?
Removed / Before Commit
- /salt product (bracelet format).xlsx - /salt product.xlsx - - .salt product.xlsx/ - \ No newline at end of file - \ No newline at end of file
Added / After Commit
+ /salt product (bracelet format).xlsx + /salt product.xlsx + + \ No newline at end of file + .salt product.xlsx/ + /FRONTEND_AI_PROMPT.md + \ No newline at end of file
Removed / Before Commit
- const [shippingError, setShippingError] = useState(""); - const [shippingLoading, setShippingLoading] = useState(false); - - // coupon - const [couponCode, setCouponCode] = useState(""); - const [appliedCoupon, setAppliedCoupon] = useState<{ code: string; title?: string } | null>(null); - const data = await res.json(); - if (!res.ok) { setError(data.message ?? "Something went wrong."); return; } - localStorage.removeItem("avriti_buy_now"); - window.location.href = "/order-list"; - } catch { - setError("Something went wrong. Please try again."); - } finally { - return; - } - localStorage.removeItem("avriti_buy_now"); - window.location.href = "/order-list"; - } catch {
Added / After Commit
+ const [shippingError, setShippingError] = useState(""); + const [shippingLoading, setShippingLoading] = useState(false); + + // order-confirmed popup + const [orderSuccess, setOrderSuccess] = useState<{ orderNumber?: string } | null>(null); + + // coupon + const [couponCode, setCouponCode] = useState(""); + const [appliedCoupon, setAppliedCoupon] = useState<{ code: string; title?: string } | null>(null); + const data = await res.json(); + if (!res.ok) { setError(data.message ?? "Something went wrong."); return; } + localStorage.removeItem("avriti_buy_now"); + setOrderSuccess({ orderNumber: data.order_number }); + setTimeout(() => { window.location.href = "/order-list"; }, 5000); + } catch { + setError("Something went wrong. Please try again."); + } finally { + return;
Removed / Before Commit
- className="grid grid-cols-[50px_1fr_auto] items-center gap-4 py-4 first:pt-0 last:pb-0" - > - <div className="relative h-[50px] w-[50px] overflow-hidden rounded-[4px] bg-white"> - <Image - src={item.product_image || "/1.jpeg"} - alt={item.product_name} - fill - sizes="50px" - className="object-contain p-1" - onError={(e) => { (e.target as HTMLImageElement).src = "/1.jpeg"; }} - /> - </div> - - <div className="min-w-0">
Added / After Commit
+ className="grid grid-cols-[50px_1fr_auto] items-center gap-4 py-4 first:pt-0 last:pb-0" + > + <div className="relative h-[50px] w-[50px] overflow-hidden rounded-[4px] bg-white"> + {item.product_image && ( + <Image + src={item.product_image} + alt={item.product_name} + fill + sizes="50px" + className="object-contain p-1" + /> + )} + </div> + + <div className="min-w-0">
Removed / Before Commit
- import { useParams } from "next/navigation"; - import Link from "next/link"; - import { isLoggedIn } from "@/lib/cart"; - - type OtherDetail = { - sno: number; - section_name: string; - details: string; - }; - - type ServiceDetail = { - id: number; - name: string; - slug: string; - short_description: string; - consultation_fee: string; - icon: string | null; - image: string | null;
Added / After Commit
+ import { useParams } from "next/navigation"; + import Link from "next/link"; + import { isLoggedIn } from "@/lib/cart"; + import "../service.css"; + + type OtherDetail = { + sno: number; + section_name: string; + details: string; + }; + + type Tier = { + sr_no: number; + tier_name: string; + sku: string; + consultation_fee: string; + }; +
Removed / Before Commit
Added / After Commit
+ /* Rich content (Quill HTML) for service pages — restores what Tailwind's base reset strips */ + + .service-content ul { list-style: disc !important; padding-left: 22px !important; margin: 0 0 12px; } + .service-content ol { list-style: decimal !important; padding-left: 22px !important; margin: 0 0 12px; } + .service-content li { display: list-item !important; margin-bottom: 6px; } + .service-content li:last-child { margin-bottom: 0; } + + .service-content p { margin: 0 0 12px; } + .service-content p:last-child { margin-bottom: 0; } + .service-content p:empty { display: none; } + + .service-content h1 { font-size: 24px; font-weight: 700; color: #3b2b24; margin: 16px 0 8px; } + .service-content h2 { font-size: 20px; font-weight: 700; color: #3b2b24; margin: 14px 0 8px; } + .service-content h3 { font-size: 18px; font-weight: 600; color: #3b2b24; margin: 14px 0 6px; } + .service-content h4 { font-size: 16px; font-weight: 600; color: #3b2b24; margin: 12px 0 6px; } + .service-content h5 { font-size: 15px; font-weight: 600; color: #3b2b24; margin: 12px 0 6px; } + .service-content h6 { font-size: 14px; font-weight: 600; color: #3b2b24; margin: 10px 0 6px; } + .service-content h1:first-child,
Removed / Before Commit
- return ( - <Card className="overflow-hidden p-6 mb-4 md:flex items-center justify-between gap-6"> - <Link href={`/my-order?id=${order.id}`} className="sm:flex-row flex-col flex items-start gap-6 flex-1 cursor-pointer"> - {/* Logo/Image */} - <div className="flex-shrink-0 p-2 w-24 h-24 rounded-lg flex items-center justify-center border border-gray-200 overflow-hidden"> - <img - src={order.productImage || "/1.jpeg"} - alt={order.productName || order.shopName || "Order"} - className="object-contain w-full h-full" - onError={(e) => { (e.target as HTMLImageElement).src = "/1.jpeg"; }} - /> - </div> - - {/* Order Details */}
Added / After Commit
+ return ( + <Card className="overflow-hidden p-6 mb-4 md:flex items-center justify-between gap-6"> + <Link href={`/my-order?id=${order.id}`} className="sm:flex-row flex-col flex items-start gap-6 flex-1 cursor-pointer"> + {/* Logo/Image — no fallback: show nothing when there's no real image */} + <div className="flex-shrink-0 p-2 w-24 h-24 rounded-lg flex items-center justify-center border border-gray-200 overflow-hidden"> + {order.productImage && ( + <img + src={order.productImage} + alt={order.productName || order.shopName || "Order"} + className="object-contain w-full h-full" + /> + )} + </div> + + {/* Order Details */}