Skip to content

feat: complete mobile responsiveness — merchant nav, sticky checkout,…#187

Merged
onerandomdevv merged 2 commits into
devfrom
feat/mobile-responsive-v2
Mar 15, 2026
Merged

feat: complete mobile responsiveness — merchant nav, sticky checkout,…#187
onerandomdevv merged 2 commits into
devfrom
feat/mobile-responsive-v2

Conversation

@onerandomdevv
Copy link
Copy Markdown
Collaborator

@onerandomdevv onerandomdevv commented Mar 15, 2026

… Instagram-style feed, table-to-card conversions

Fix 1 (CRITICAL): Merchant mobile navigation

  • Created merchant-mobile-nav.tsx (5-item bottom bar with elevated +New button)
  • Wired existing merchant-header.tsx into merchant layout
  • Added MobileDrawer with hamburger trigger to merchant layout
  • Added pb-20 main content padding to clear bottom nav

Fix 2 (CRITICAL): Mode Switcher on mobile

  • Removed isDesktop guard from ModeSwitcher in merchant sidebar
  • ModeSwitcher now renders inside MobileDrawer when sidebar opens

Fix 3 (HIGH): Cart checkout sticky button

  • Added fixed bottom-20 sticky bar with total + checkout button (lg:hidden)

Fix 4 (HIGH): WhatsApp OTP input overflow

  • Reduced OTP box to w-10 h-12 on mobile (sm:w-12 sm:h-14 on desktop)
  • Reduced gap to gap-2 sm:gap-3

Fix 5 (HIGH): Merchant profile tabs overflow

  • Added overflow-x-auto scrollbar-hide on tab container
  • Added whitespace-nowrap on tab labels
  • Hidden view-toggle on mobile (hidden sm:flex)

Fix 6 (MEDIUM): Merchant products mobile grid

  • Force grid view on mobile (md:hidden), hide view toggle below md
  • Fixed filter bar min-width from 300px to 200px

Fix 7 (MEDIUM): Merchant wallet mobile cards

  • Escrow table: md:hidden card view + hidden md:block table

Fix 8 (MEDIUM): Catalogue padding

  • Reduced inner container to px-3 sm:px-8

Fix 9 (MEDIUM): Verification page polish

  • Heading scaled: text-2xl sm:text-3xl lg:text-4xl
  • Form indent: pl-0 sm:pl-11

Fix 10 (LOW): Feed full-bleed

  • Zero gap + divide-y dividers on mobile
  • ProductCard accepts className prop for rounded-none on mobile

Fix 11 (LOW): Sort pill tap targets

  • min-h-[44px], px-4 py-2.5, gap-2

Summary by CodeRabbit

  • New Features

    • Merchant mobile navigation and merchant header added for improved mobile workflows.
    • Mobile-only sticky checkout bar for buyers.
    • Mobile card view for order transactions.
  • UI/UX Improvements

    • Improved responsive layouts, spacing, padding, and sizing across buyer and merchant screens.
    • Product card styling made more adaptable for different viewports.
    • OTP input, tabs, and grid/table views refined for better mobile usability.

… Instagram-style feed, table-to-card conversions

Fix 1 (CRITICAL): Merchant mobile navigation
- Created merchant-mobile-nav.tsx (5-item bottom bar with elevated +New button)
- Wired existing merchant-header.tsx into merchant layout
- Added MobileDrawer with hamburger trigger to merchant layout
- Added pb-20 main content padding to clear bottom nav

Fix 2 (CRITICAL): Mode Switcher on mobile
- Removed isDesktop guard from ModeSwitcher in merchant sidebar
- ModeSwitcher now renders inside MobileDrawer when sidebar opens

Fix 3 (HIGH): Cart checkout sticky button
- Added fixed bottom-20 sticky bar with total + checkout button (lg:hidden)

Fix 4 (HIGH): WhatsApp OTP input overflow
- Reduced OTP box to w-10 h-12 on mobile (sm:w-12 sm:h-14 on desktop)
- Reduced gap to gap-2 sm:gap-3

Fix 5 (HIGH): Merchant profile tabs overflow
- Added overflow-x-auto scrollbar-hide on tab container
- Added whitespace-nowrap on tab labels
- Hidden view-toggle on mobile (hidden sm:flex)

Fix 6 (MEDIUM): Merchant products mobile grid
- Force grid view on mobile (md:hidden), hide view toggle below md
- Fixed filter bar min-width from 300px to 200px

Fix 7 (MEDIUM): Merchant wallet mobile cards
- Escrow table: md:hidden card view + hidden md:block table

Fix 8 (MEDIUM): Catalogue padding
- Reduced inner container to px-3 sm:px-8

Fix 9 (MEDIUM): Verification page polish
- Heading scaled: text-2xl sm:text-3xl lg:text-4xl
- Form indent: pl-0 sm:pl-11

Fix 10 (LOW): Feed full-bleed
- Zero gap + divide-y dividers on mobile
- ProductCard accepts className prop for rounded-none on mobile

Fix 11 (LOW): Sort pill tap targets
- min-h-[44px], px-4 py-2.5, gap-2
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
swift-trade Ready Ready Preview, Comment Mar 15, 2026 5:38pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9a23a4ad-3678-4102-a12b-ab321daaab72

📥 Commits

Reviewing files that changed from the base of the PR and between ea0c5bd and 616ad4b.

📒 Files selected for processing (1)
  • apps/web/src/components/buyer/cart/cart-view.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/src/components/buyer/cart/cart-view.tsx

📝 Walkthrough

Walkthrough

Refactors UI spacing and responsive sizing across buyer and merchant dashboards, adds a merchant mobile navigation bar and a mobile sticky checkout, restructures merchant products rendering for mobile vs desktop, and extends ProductCard with an optional className prop.

Changes

Cohort / File(s) Summary
Buyer pages
apps/web/src/app/(dashboard)/buyer/catalogue/page.tsx, apps/web/src/app/(dashboard)/buyer/feed/page.tsx, apps/web/src/app/(dashboard)/buyer/profile/page.tsx
Adjusted padding, gaps, and spacing for small screens; added grid dividers and responsive rounded classes on ProductCard usage; resized OTP inputs for responsive behavior.
Merchant layout & navigation
apps/web/src/app/(dashboard)/merchant/layout.tsx, apps/web/src/components/layout/merchant-mobile-nav.tsx, apps/web/src/components/layout/merchant-sidebar.tsx
Inserted new MerchantMobileNav and MerchantHeader into layout, added persistent mobile nav, adjusted main padding, and made ModeSwitcher rendering/padding conditional across breakpoints.
Merchant pages
apps/web/src/app/(dashboard)/merchant/products/page.tsx, apps/web/src/app/(dashboard)/merchant/verification/page.tsx
Reworked products page to render a mobile grid (md:hidden) separately from desktop grid/table paths and reduced FilterBar min-width; applied responsive typography and left-padding changes on verification page.
Shared & cart/wallet components
apps/web/src/components/shared/product-card.tsx, apps/web/src/components/buyer/cart/cart-view.tsx, apps/web/src/components/merchant/profile/merchant-profile-view.tsx, apps/web/src/components/merchant/wallet/merchant-wallet-dashboard.tsx
Added optional className prop to ProductCard; added mobile-only sticky checkout bar; updated tabs to support horizontal overflow and no-wrap labels; added mobile card view for wallet orders.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • SAHEED2010

Poem

🐇 I hopped through paddings, gaps, and screens,

tiny tweaks and mobile dreams,
a nav that rests where thumbs can reach,
sticky checkout within leap's reach,
code and carrots — smooth UX streams.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is comprehensive with detailed fixes organized by priority level, but the required template sections (Module(s) affected, Type of change, Checklist, How to test, Screenshots) are not completed. Complete the template sections including modules affected (mark Merchant/Frontend/Shared), type of change (New feature), checklist items, and testing steps for reviewers.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main objective of the PR: implementing complete mobile responsiveness with specific features (merchant nav, sticky checkout, feed style, table-to-card conversions).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/mobile-responsive-v2
📝 Coding Plan
  • Generate coding plan for human review comments

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
Copy Markdown
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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/web/src/app/(dashboard)/merchant/products/page.tsx (1)

296-565: ⚠️ Potential issue | 🟠 Major

Avoid mounting both responsive branches simultaneously.

Both branches map filteredProducts, so each product card tree is created twice and the hidden branch still mounts its <img> elements. That will scale poorly on larger inventories. Derive an effective view mode from the breakpoint, or reset viewMode below md, so only one catalog layout renders.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/app/`(dashboard)/merchant/products/page.tsx around lines 296 -
565, The page currently mounts both responsive branches (mobile section with
md:hidden and desktop sections gated by viewMode) causing filteredProducts to be
mapped twice and hidden imgs to mount; fix by making rendering mutually
exclusive: derive an effective view mode from the breakpoint (e.g., use
window.matchMedia or a useMediaQuery hook) and override/reset viewMode for
widths < md so only the mobile branch renders, or conditionally render the
desktop branches only when the media query matches (instead of relying on CSS
classes alone); update references in this file to use the media-query-driven
boolean when deciding to map filteredProducts (affecting viewMode, the md:hidden
mobile section, and the desktop grid/table sections) so only one product tree is
mounted.
🧹 Nitpick comments (2)
apps/web/src/components/layout/merchant-mobile-nav.tsx (1)

29-32: Consider adding aria-label to the center action button for accessibility.

The "New" button only has an icon visible initially (the label is small text below). Adding an aria-label improves screen reader experience.

♻️ Suggested fix
-              <div className="size-12 rounded-full bg-primary text-white flex items-center justify-center shadow-lg shadow-primary/30 active:scale-95 transition-transform">
+              <div 
+                className="size-12 rounded-full bg-primary text-white flex items-center justify-center shadow-lg shadow-primary/30 active:scale-95 transition-transform"
+                aria-hidden="true"
+              >

And on the Link:

-            <Link
-              key={item.href}
-              href={item.href}
-              className="flex flex-col items-center gap-0.5 -mt-4"
-            >
+            <Link
+              key={item.href}
+              href={item.href}
+              className="flex flex-col items-center gap-0.5 -mt-4"
+              aria-label="Add new product"
+            >
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/components/layout/merchant-mobile-nav.tsx` around lines 29 - 32,
The center action button in the MerchantMobileNav component renders only an icon
(see the div with class "size-12 rounded-full bg-primary..." and the inner span
"material-symbols-outlined") so add an accessible name by adding an aria-label
(e.g., aria-label="New" or aria-label="Create new item") to that button
container or the interactive element that wraps it; also ensure the surrounding
Link (if present) includes an aria-label or descriptive aria-labelledby to
provide the same screen-reader text.
apps/web/src/components/merchant/wallet/merchant-wallet-dashboard.tsx (1)

163-166: Consider expanding status color mapping for better visual distinction.

The status badge only maps 2 of 9 possible OrderStatus values to specific colors. Statuses like CANCELLED, DISPUTE, or DELIVERED fall back to the neutral gray (bg-slate-300), which may confuse users.

Based on packages/shared/src/enums/order-status.enum.ts, consider a more complete mapping:

♻️ Suggested status color mapping
-                      <span className={cn(
-                        "size-1.5 rounded-full",
-                        order.status === "COMPLETED" ? "bg-emerald-500" : order.status === "PAID" ? "bg-amber-500" : "bg-slate-300"
-                      )} />
+                      <span className={cn(
+                        "size-1.5 rounded-full",
+                        {
+                          "bg-emerald-500": order.status === "COMPLETED" || order.status === "DELIVERED",
+                          "bg-amber-500": order.status === "PAID" || order.status === "PREPARING" || order.status === "IN_TRANSIT" || order.status === "DISPATCHED",
+                          "bg-rose-500": order.status === "CANCELLED" || order.status === "DISPUTE",
+                          "bg-slate-300": order.status === "PENDING_PAYMENT",
+                        }
+                      )} />

Note: The same logic at lines 204-206 in the desktop table view should be updated for consistency.

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/web/src/components/buyer/cart/cart-view.tsx`:
- Around line 467-472: The visual disabled state is not aligned with the
functional disabled prop: include isSubmitting in the className conditional so
the button gets the "disabled" styles when isSubmitting is true; update the
conditional that currently checks !selectedMerchantId || !isAddressComplete to
also check isSubmitting (e.g., use isSubmitting || !selectedMerchantId ||
!isAddressComplete) so the button in the CartView component (the checkout/submit
button using isSubmitting, selectedMerchantId, isAddressComplete) shows the
"bg-slate-200 text-slate-400 cursor-not-allowed" styling whenever it is
functionally disabled.

---

Outside diff comments:
In `@apps/web/src/app/`(dashboard)/merchant/products/page.tsx:
- Around line 296-565: The page currently mounts both responsive branches
(mobile section with md:hidden and desktop sections gated by viewMode) causing
filteredProducts to be mapped twice and hidden imgs to mount; fix by making
rendering mutually exclusive: derive an effective view mode from the breakpoint
(e.g., use window.matchMedia or a useMediaQuery hook) and override/reset
viewMode for widths < md so only the mobile branch renders, or conditionally
render the desktop branches only when the media query matches (instead of
relying on CSS classes alone); update references in this file to use the
media-query-driven boolean when deciding to map filteredProducts (affecting
viewMode, the md:hidden mobile section, and the desktop grid/table sections) so
only one product tree is mounted.

---

Nitpick comments:
In `@apps/web/src/components/layout/merchant-mobile-nav.tsx`:
- Around line 29-32: The center action button in the MerchantMobileNav component
renders only an icon (see the div with class "size-12 rounded-full
bg-primary..." and the inner span "material-symbols-outlined") so add an
accessible name by adding an aria-label (e.g., aria-label="New" or
aria-label="Create new item") to that button container or the interactive
element that wraps it; also ensure the surrounding Link (if present) includes an
aria-label or descriptive aria-labelledby to provide the same screen-reader
text.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 948dc999-3bc3-403f-b617-d212708e3b57

📥 Commits

Reviewing files that changed from the base of the PR and between 395564d and ea0c5bd.

📒 Files selected for processing (12)
  • apps/web/src/app/(dashboard)/buyer/catalogue/page.tsx
  • apps/web/src/app/(dashboard)/buyer/feed/page.tsx
  • apps/web/src/app/(dashboard)/buyer/profile/page.tsx
  • apps/web/src/app/(dashboard)/merchant/layout.tsx
  • apps/web/src/app/(dashboard)/merchant/products/page.tsx
  • apps/web/src/app/(dashboard)/merchant/verification/page.tsx
  • apps/web/src/components/buyer/cart/cart-view.tsx
  • apps/web/src/components/layout/merchant-mobile-nav.tsx
  • apps/web/src/components/layout/merchant-sidebar.tsx
  • apps/web/src/components/merchant/profile/merchant-profile-view.tsx
  • apps/web/src/components/merchant/wallet/merchant-wallet-dashboard.tsx
  • apps/web/src/components/shared/product-card.tsx

Comment thread apps/web/src/components/buyer/cart/cart-view.tsx
@onerandomdevv onerandomdevv merged commit f6b2639 into dev Mar 15, 2026
4 checks passed
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