Skip to content

fix(pos): hide mobile cart button on desktop - #1122

Merged
khaira777 merged 2 commits into
mainfrom
fm/flocafe-issue-1058-r1
Oct 13, 2026
Merged

khaira777 merged 2 commits into
mainfrom
fm/flocafe-issue-1058-r1

Conversation

@khaira777

Copy link
Copy Markdown
Contributor

Intent

Verify and implement the surgical fix for FreeOpenSourcePOS/FloCafe issue #1058 ("hide floating cart button on tablet and desktop viewports"): the floating mobile Cart button on /pos remains visible at desktop viewports (>= 768px / >= 1024px) because unlayered .touch-target (display: inline-flex;) in frontend/src/app/globals.css overrides Tailwind's responsive hiding class (lg:hidden / md:hidden) in frontend/src/app/(dashboard)/pos/page.tsx. Ensure the floating mobile Cart button is hidden on desktop viewports while remaining visible and 44x44px on mobile/narrow viewports. Deliver via the no-mistakes pipeline as its own PR with Fixes #1058 in the PR summary.

What Changed

  • Wrapped the .touch-target rule in frontend/src/app/globals.css inside @layer components so Tailwind responsive utility classes (such as md:hidden / lg:hidden) take cascade precedence over its display: inline-flex declaration while preserving 44x44px touch sizing on mobile viewports.
  • Added a Playwright E2E test in frontend/e2e/layout-integrity.spec.ts verifying that the /pos floating mobile Cart button is hidden at 1024x768 and 768x1024 viewports and remains visible with dimensions >= 44x44px at 390x844.

Fixes #1058

Risk Assessment

✅ Low: Wrapping .touch-target in @layer components is a minimal, targeted CSS layer change that allows Tailwind responsive utilities (such as md:hidden) to override its default display property while preserving 44x44px touch sizing on mobile viewports, verified by a Playwright E2E test.

Testing

Built the backend and static desktop frontend, ran the focused Playwright E2E regression test in frontend/e2e/layout-integrity.spec.ts against an isolated E2E server instance, and drove live Chromium checks across 1024x768, 768x1024, 767x1024, and 390x844 viewports with screenshots and computed-style/bounding-box measurements; all scenarios passed.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
At a 1024x768 desktop viewport on /pos, the floating mobile Cart button is hidden (display: none) while the desktop side-by-side cart panel is visible ✅ pass live ~/.no-mistakes/evidence/01M4VCJ1VBWJVH95TH4T62DSAS/pos-desktop-1024x768.png
At the 768px md breakpoint boundary (768x1024 vs 767x1024), the floating mobile Cart button remains hidden at 768x1024 and switches to visible (56x56px, min 44x44px) at 767x1024 when the desktop cart… ✅ pass live ~/.no-mistakes/evidence/01M4VCJ1VBWJVH95TH4T62DSAS/pos-tablet-768x1024.png
At a 390x844 mobile viewport on /pos, the floating Cart button is visible, enforces >= 44x44px touch target sizing (56x56px), shows the cart item count badge, and opens the mobile cart drawer when cli… ✅ pass live ~/.no-mistakes/evidence/01M4VCJ1VBWJVH95TH4T62DSAS/pos-mobile-390x844-drawer-open.png

POS at desktop viewport (1024x768) with floating mobile Cart button hidden and desktop cart panel visible
POS at tablet breakpoint (768x1024) with floating mobile Cart button hidden and desktop cart panel visible
POS at 1px below md breakpoint (767x1024) with floating mobile Cart button visible (56x56px) and desktop cart hidden
POS at mobile viewport (390x844) showing 56x56px floating Cart button with item badge
POS at mobile viewport (390x844) after clicking floating Cart button to open mobile cart drawer

Evidence: Computed style and bounding-box measurements across desktop, tablet, boundary, and mobile viewports

{ "desktop-1024x768": { "mobileCartDisplay": "none", "width": 0, "height": 0, "desktopCartDisplay": "flex" }, "tablet-768x1024": { "mobileCartDisplay": "none", "width": 0, "height": 0, "desktopCartDisplay": "flex" }, "boundary-767x1024": { "mobileCartDisplay": "flex", "minWidth": "44px", "minHeight": "44px", "width": 56, "height": 56, "desktopCartDisplay": "none" }, "mobile-390x844": { "mobileCartDisplay": "flex", "minWidth": "44px", "minHeight": "44px", "width": 56, "height": 56, "desktopCartDisplay": "none" } }

{
  "measurements": [
    {
      "label": "desktop-1024x768",
      "viewport": "1024x768",
      "mobileCartButton": {
        "display": "none",
        "minWidth": "44px",
        "minHeight": "44px",
        "width": 0,
        "height": 0,
        "visible": false
      },
      "desktopCartDisplay": "flex",
      "screenshot": "~/.no-mistakes/evidence/01M4VCJ1VBWJVH95TH4T62DSAS/pos-desktop-1024x768.png"
    },
    {
      "label": "tablet-768x1024",
      "viewport": "768x1024",
      "mobileCartButton": {
        "display": "none",
        "minWidth": "44px",
        "minHeight": "44px",
        "width": 0,
        "height": 0,
        "visible": false
      },
      "desktopCartDisplay": "flex",
      "screenshot": "~/.no-mistakes/evidence/01M4VCJ1VBWJVH95TH4T62DSAS/pos-tablet-768x1024.png"
    },
    {
      "label": "boundary-767x1024",
      "viewport": "767x1024",
      "mobileCartButton": {
        "display": "flex",
        "minWidth": "44px",
        "minHeight": "44px",
        "width": 56,
        "height": 56,
        "visible": true
      },
      "desktopCartDisplay": "none",
      "screenshot": "~/.no-mistakes/evidence/01M4VCJ1VBWJVH95TH4T62DSAS/pos-boundary-767x1024.png"
    },
    {
      "label": "mobile-390x844",
      "viewport": "390x844",
      "mobileCartButton": {
        "display": "flex",
        "minWidth": "44px",
        "minHeight": "44px",
        "width": 56,
        "height": 56,
        "visible": true
      },
      "desktopCartDisplay": "none",
      "screenshot": "~/.no-mistakes/evidence/01M4VCJ1VBWJVH95TH4T62DSAS/pos-mobile-390x844-floating-cart.png"
    }
  ],
  "mobileDrawerOpened": true,
  "drawerScreenshot": "~/.no-mistakes/evidence/01M4VCJ1VBWJVH95TH4T62DSAS/pos-mobile-390x844-drawer-open.png"
}

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
At a 1024x768 desktop viewport on /pos, the floating mobile Cart button is hidden (display: none) while the desktop side-by-side cart panel is visible ✅ pass live ~/.no-mistakes/evidence/01M4VCJ1VBWJVH95TH4T62DSAS/pos-desktop-1024x768.png
At the 768px md breakpoint boundary (768x1024 vs 767x1024), the floating mobile Cart button remains hidden at 768x1024 and switches to visible (56x56px, min 44x44px) at 767x1024 when the desktop cart… ✅ pass live ~/.no-mistakes/evidence/01M4VCJ1VBWJVH95TH4T62DSAS/pos-tablet-768x1024.png
At a 390x844 mobile viewport on /pos, the floating Cart button is visible, enforces >= 44x44px touch target sizing (56x56px), shows the cart item count badge, and opens the mobile cart drawer when cli… ✅ pass live ~/.no-mistakes/evidence/01M4VCJ1VBWJVH95TH4T62DSAS/pos-mobile-390x844-drawer-open.png
  • npm run build && npm run build:frontend
  • E2E_BASE_URL=http://127.0.0.1:43001 E2E_KDS_BASE_URL=http://127.0.0.1:43002 E2E_SERVER_APP_BASE_URL=http://127.0.0.1:43003 npx playwright test --config=playwright.config.ts --project=chromium e2e/layout-integrity.spec.ts --grep "POS hides the floating mobile cart button on tablet and desktop viewports and keeps it touch-sized on mobile"
  • Live Playwright verification and screenshot capture across 1024x768, 768x1024, 767x1024, and 390x844 against tests/e2e-server.cjs
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Place .touch-target in @layer components so Tailwind responsive display utilities (md:hidden) override its default display: inline-flex and hide the floating mobile cart button on tablet and desktop viewports while preserving its 44x44px touch target on mobile.

Fixes #1058
@khaira777 khaira777 changed the title fix(frontend): hide floating cart button on tablet and desktop viewports fix(pos): hide mobile cart button on desktop Oct 13, 2026
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: FreeOpenSourcePOS/FloCafe/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5e70fa46-b5e8-4196-9a1c-81126da66edd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@khaira777

Copy link
Copy Markdown
Contributor Author

@greptile review

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low impact] The PR appears safe to merge and fixes the floating Cart button’s desktop visibility.

Summary

Moves .touch-target into @layer components so responsive utilities can hide the floating Cart button.

  • The POS hides its floating Cart button on wider screens.

Reviews (1) · Last reviewed commit: "fix(pos): hide mobile cart button on des..." · Reviewed by Greptile

@khaira777
khaira777 enabled auto-merge (squash) October 13, 2026 20:59
@khaira777
khaira777 merged commit e434e5f into main Oct 13, 2026
23 checks passed
@khaira777
khaira777 deleted the fm/flocafe-issue-1058-r1 branch October 13, 2026 21:09
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.

fix(pos): hide floating cart button on tablet and desktop viewports

1 participant