Support #12243
openEnhancement: Virtual Try-On – Category-Based Jewellery Isolation and AR Placement Optimization
Subtasks
Related issues
Updated by Ajit A 8 days ago
- Estimated time changed from 8:00 h to 16:00 h
Bug: Bangle Distortion & Non-1:1 Aspect Ratio Squishing in AR Try-On Fix: Updated renderer.ts and anchors.ts to calculate intrinsic image aspect ratios (
𝑊
/
𝐻
W/H) and apply dynamic wrist-distance bounding constraints. Ensured bangles render as true circular rings on wrists regardless of raw video feed or canvas dimensions.
Feature: Real-Time Bangle & Kada Tracking on Wrists via MediaPipe Pose Fix: Implemented wrist tracking in anchors.ts and useARSession.ts leveraging MediaPipe Pose landmarks 15 & 16 (wrists) and 13 & 14 (elbows) with hand landmark fallbacks. Extended VirtualTryOn.tsx with category guidance, wrist positioning guides, and live try-on tool panels.
Feature: High-Precision Interactive Image Cropper & Polygonal Lasso Tooling Fix: Built InteractiveImageCropper.tsx supporting arbitrary point-to-point vector contour tracing (mode="polygon"), multi-tier bounding box transforms, instant undo/redo stacks, and preset alignment buttons across necklace, haram, choker, and bangle categories.
Feature: Intelligent Bangle Center Hole Punch & Background Flood-Fill Cleaner Fix: Created bangleHolePunch.ts containing automated BFS flood-fill detection from the center seed point and canvas destination-out anti-aliased ellipse masking. Integrated interactive visual ellipse handles into InteractiveImageCropper.tsx and added a 1-click Clean Center Hole action to the preview modal in ARAssetGenerator.tsx.
Feature: Background Removal Process Cancellation with AbortController Fix: Updated backgroundRemoval.ts to accept signal?: AbortSignal and propagate cancellation into WebAssembly inference. Added visual Cancel buttons to both the main progress bar and modal overlays in ARAssetGenerator.tsx, immediately halting model inference and resetting UI state.
Bug: Inflexible AR Region Selector Modal Sizing & Internal Scrolling Fix: Redesigned the crop modal in ARAssetGenerator.tsx to expand to max-w-4xl lg:max-w-5xl with a 12-column side-by-side desktop layout (md:col-span-7 cropper canvas and md:col-span-5 control adjusters). Eliminated vertical scrollbars and tightened component paddings.
Feature: Dynamic Themed Yellow Mobile Browser Header & System Status Bar Fix: Updated app/layout.tsx with <meta name="theme-color" content="#B59447"> and <meta name="apple-mobile-web-app-status-bar-style" content="default">. Refactored BrandThemeProvider.tsx to dynamically synchronize mobile status bar and Chrome header colors with the company brand primary palette across initial page load and scroll events.
Bug: Mobile Pagination White Border & Disproportionate Manual Page Input Fix: Overhauled Pagination.tsx to hide the manual page input on mobile viewports (hidden sm:flex), replace white borders with themed borders (border-yellow-600/30), and adjust button sizing (min-w-[32px] h-8) for responsive touch navigation.
Bug: Products Listing "Price on Request" Misalignment & Breadcrumb Header Overlap Fix: Centered "Price on Request" text in ProductsListing.tsx with w-full justify-center. Hidden breadcrumb links on mobile in Breadcrumb.tsx and tightened mobile listing top padding to pt-[116px].
Bug: Intrusive Add/Remove Cart Toasts on Mobile Viewports Fix: Extended ToastProvider.tsx with mobile viewport and user-agent detection to suppress "Item added to cart" and "Item removed from cart" toasts on mobile devices while preserving critical status and error alerts.
Issue: Scaled Loading Spinner & Skeleton Dimension Standardization Fix: Downscaled the loading spinner in SectionLoader.tsx and loader.css from h-20 w-20 to h-10 w-10 with a compact min-h-[140px] container. Standardized skeleton placeholders in ProductsListingSkeleton.tsx.
Repository: Noxa-Jewellery-fe
Modified Files:
src/components/ARAssetGenerator.tsx: Integrated multi-category region selectors, bangle center hole punching, expanded 2-column layout, and process cancellation.
src/components/GlobalPagination.tsx: Guarded useEffect page clamping against empty/zero pagination states.
src/pages/products/CreateProduct.tsx: Added category detection flags (isBangle, isHaram, isChoker) and lightbox image navigation.
src/pages/products/ProductsList.tsx: Added sequence tracking to prevent out-of-order race conditions on deleted product pagination.
src/pages/products/components/ProductDetailsPage.tsx: Aligned back button and heading line height.
src/utils/backgroundRemoval.ts: Added AbortSignal support to abort inference.
Added / Untracked Files:
src/components/InteractiveImageCropper.tsx: Vector polygonal lasso, box transforms, history stack, and bangle hole visual handles.
src/utils/bangleHolePunch.ts: BFS flood-fill inner hole detection and canvas destination-out hole punching.
Deleted Files: None.
Repository: Noxa_E_Comm_Fe
Modified Files:
app/layout.tsx: SSR themed yellow meta tags.
components/VirtualTryOn.tsx: Fullscreen mobile AR, bangle category controls, and orientation hints.
components/cart/CartContent.tsx: Suppressed mobile cart modification toasts.
components/checkout/CheckoutContent.tsx: Minor alignment adjustments.
components/home/HomePromoSection.tsx: Compact loading container.
components/home/HomeVirtualTryOnBanner.tsx: Mobile banner typography and try-on deep links.
components/layout/BrandThemeProvider.tsx: Dynamic brand primary palette status bar theming.
components/layout/Breadcrumb.tsx: Hidden on mobile viewports.
components/layout/Header.tsx: Mobile navigation bar optimizations.
components/product/FeaturedCollections.tsx: Visual spacing adjustments.
components/product/ProductDetails.tsx: Mobile toast suppression and try-on integration.
components/product/ProductsListing.tsx: Centered "Price on Request" and tightened top padding.
components/try-on/TryOnStudio.tsx: Mobile toast suppression.
components/ui/Pagination.tsx: Redesigned responsive pagination without white borders.
components/ui/loaders/ProductDetailsSkeleton.tsx: Skeleton loading polish.
components/ui/loaders/ProductSkeleton.tsx: Standardized card skeleton dimensions.
components/ui/loaders/ProductsListingSkeleton.tsx: Skeleton cleanup.
components/ui/loaders/SectionLoader.tsx & loader.css: Scaled spinner size down to h-10 w-10.
lib/ar/anchors.ts: Multi-category anchors (wrist, neck, chest, earlobe) and 1:1 aspect ratio constraint.
lib/ar/mediapipe.ts: Landmark model resolution adjustments.
lib/ar/renderer.ts: Bangle rendering and intrinsic aspect ratio preservation.
lib/hooks/useARSession.ts: Multi-category session coordinator.
lib/hooks/useCamera.ts: Mobile camera orientation and device switching.
lib/providers/ToastProvider.tsx: Selective mobile toast filtering.
Added Files: None.
Deleted Files: None.
Updated by Ajit A 5 days ago
- Status changed from In Progress to Resolved
- % Done changed from 40 to 100
Feature: Dual-Asset 360° Bangle Virtual Try-On Architecture Fix: Extended product schema and DTOs in Noxa-Jewellery-be with arBangleFrontImage, arBangleBackImage, and arBangleSettings. Implemented intelligent normal-vector dot-product tracking in lib/ar/anchors.ts and smooth cross-fading in lib/ar/renderer.ts so dorsal wrist views render the front jewelry piece while palmar wrist turns reveal the clasp/back section.
Bug: Inverted Cranial Occlusion Causing Visible Earring Disappearance and Lip Artifacts Fix: Replaced 2D head yaw heuristics in lib/ar/anchors.ts with true 3D Z-depth differential analysis (zRight - zLeft) and nose midline validation. The turned-away ear behind the cranium now cleanly fades to confidence 0.0, while the forward-facing ear remains at 1.0.
Bug: Earring Try-On Failing for Jewelry Set Products Lacking Pre-Rendered Cutouts Fix: Created an automated client-side jewel extraction engine in components/VirtualTryOn.tsx that scans the focal pendant teardrop from the transparent necklace asset, trims transparent borders, and produces an authentic matching earring data URL instantaneously.
Bug: Necklace Shifting Off-Center and Tilting into Air During Head Yaw Fix: Decoupled anchorX from chinPt.x in lib/ar/anchors.ts and locked it firmly to the chest midline (shoulderMid.x from pose shoulders or yaw-compensated midline), locking necklace tilt (effectiveSlope) to the shoulder line so the necklace stays anchored on the chest regardless of head turning.
Feature: Luxury Black Header & Safe Area UI with Yellow Brand Accents Fix: Styled mobile viewport meta tags, safe area insets, and navigation elements in components/layout/Header.tsx, components/layout/BrandThemeProvider.tsx, and app/globals.css with pure black status bars and yellow accents, removing extraneous top border lines in web view.
Issue: Bottom Action Drawer Overlapping AR Camera Tools Menu Fix: Refactored responsive spacing and z-indexing in components/VirtualTryOn.tsx to eliminate overlap between the floating AR tools pill (Capture, Re-scan, Fit) and the bottom product cart bar.
3. File Changes Summary
Noxa_E_Comm_Fe (Storefront)
app/globals.css: Safe area background rules, dark theme status bar color synchronization.
app/layout.tsx: Viewport theme color definitions (#000000).
components/AR/CameraErrorCard.tsx: Mobile permission diagnostics and camera restart cards.
components/VirtualTryOn.tsx: Client-side earring jewel extraction, proxy URL resolution, UI overlap fixes, set view switching ([SET], [NECKLACE], [EARRINGS]).
components/home/HomeVirtualTryOnBanner.tsx: Category pass-through adjustments.
components/layout/BrandThemeProvider.tsx: Theme configuration for status bar and header.
components/layout/Header.tsx: Removed top yellow webview border line; updated theme colors.
components/product/ProductDetails.tsx: Added ar_earring_image alias and bangle asset props.
components/try-on/TryOnStudio.tsx: Updated category type handling.
lib/ar/anchors.ts: True 3D Z-depth cranial occlusion, anatomical earlobe coordinates, chest-centered necklace placement.
lib/ar/mediapipe.ts: Hand landmark model initialization and preloading.
lib/ar/renderer.ts: Dual-asset bangle rendering with cross-fading, automatic /proxy-image retry on CORS errors.
lib/hooks/useARSession.ts: Bangle dual-asset orientation tracking, lowered confidence cull threshold to 0.01.
lib/hooks/useCamera.ts: Enhanced mobile camera constraints and permission fallback.
lib/hooks/useProducts.ts: Cache invalidation updates for AR assets.
lib/services/productService.ts: Schema property mapping for bangle and earring fields.
lib/types/ar.ts: Types for bangleFrontDataUrl, bangleBackDataUrl, and bangleSettings.
lib/types/product.ts: Product interface definitions for bangle and earring fields.
Noxa-Jewellery-fe (Admin Portal)
src/components/ARAssetGenerator.tsx: Dual-view bangle studio with front/back asset extraction, live wrist 3D preview, and settings persistence.
src/components/InteractiveImageCropper.tsx: Polygon & elliptical hole punch editor for bangle arm openings.
src/hooks/useProducts.ts: Product mutation queries with bangle fields.
src/pages/products/CreateProduct.tsx: Formik initialization for bangle assets.
src/utils/bangleHolePunch.ts: Utility functions for punching transparent wrist openings in bangle cutouts.
Noxa-Jewellery-be (Backend API)
src/products/dto/create-product.dto.ts: Added DTO validation for arBangleFrontImage, arBangleBackImage, and arBangleSettings.
src/products/schemas/product.schema.ts: Added Mongoose schema definitions for bangle fields.
src/products/products.service.ts: Added payload clearing logic for empty strings/null on bangle fields.