Skip to content

Feature/menu cart ux refinement#450

Open
saidai-bhuvanesh wants to merge 6 commits into
PatelHarsh2006:mainfrom
saidai-bhuvanesh:feature/menu-cart-ux-refinement
Open

Feature/menu cart ux refinement#450
saidai-bhuvanesh wants to merge 6 commits into
PatelHarsh2006:mainfrom
saidai-bhuvanesh:feature/menu-cart-ux-refinement

Conversation

@saidai-bhuvanesh
Copy link
Copy Markdown

Pull Request Description
PR Title: [UX] Critical Menu Experience & Cart UX Refinement

📝 Overview
This pull request focuses on optimizing the core food ordering experience of ChaatBazaar. It resolves a layout rendering bug where duplicated card footers were rendered, fixes a runtime crash during cart item removals, introduces silent quantity updates inside the cart drawer sidebar, and improves touch target accessibility dimensions on mobile viewports.

🛠️ Key Changes
Unified Menu Card Footer Layout

Cleaned up createCard inside
js/main.js
to resolve a merge issue that rendered two separate footers and add-to-cart buttons.
Refactored the price section to conditionally render original prices and discount percentage badges only if the item has an active discount (originalPrice > price), avoiding empty badge borders.
Fixed removeFromCart Runtime Crash

Removed duplicate const removedItem declarations in the same scope inside
js/main.js
that triggered runtime exceptions and blocked cart item decrements.
Cleanly wired the function to call cartManager.decreaseQuantity and trigger UI updates.
Silent Drawer Quantity Adjustments

Upgraded addToCart with a conditional showFeedback flag.
Click handlers on quantity control buttons inside the cart drawer now update item counts silently without spamming repetitive toast alert notifications. Menu page clicks continue to show notifications as normal.
WCAG-Compliant Touch Targets (44px)

Styled .qty-controls button inside
css/style.css
to have a minimum target footprint of 44px by 44px with flexible item alignment.
Added interactive scale(0.92) micro-interactions on hover and click states.
Voice Search Code Quality Restoration

Extracted pre-existing, garbled speech recognition and search input listeners inside the init() function into a clean helper method setupVoiceSearch().
📷 Visual Previews (After Changes)
improved_cart_ux_after
improved_menu_hierarchy_after
improved_mobile_interactions_after

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