Skip to content

fix: replace UA-based mobile detection with viewport size checks for workspace modal#5132

Open
elevatingcreativity wants to merge 1 commit intoMintplex-Labs:masterfrom
elevatingcreativity:fix/manage-workspace-mobile-detection
Open

fix: replace UA-based mobile detection with viewport size checks for workspace modal#5132
elevatingcreativity wants to merge 1 commit intoMintplex-Labs:masterfrom
elevatingcreativity:fix/manage-workspace-mobile-detection

Conversation

@elevatingcreativity
Copy link
Contributor

@elevatingcreativity elevatingcreativity commented Mar 4, 2026

Summary

  • Replaces isMobile from react-device-detect (user-agent based) with window.innerWidth < 560 || window.innerHeight < 600 so that "Request Desktop Site" on iPad is correctly respected
  • Removes md: prefix from overflow-y-auto on the modal container so scrolling works on iPad mini in portrait mode (744px wide, which falls below the 768px md breakpoint)
  • Adds onTouchEnd handler to the workspace upload button in the sidebar to fix an iOS double-tap issue caused by the button being a descendant of an <a> element
  • Updates the blocking message to accurately describe the screen width requirement rather than incorrectly stating "desktop only"

Motivation

Fixes #5055 — on iPadOS, "Request Desktop Site" was ignored because isMobile from react-device-detect uses the user agent string, which does not reliably change when requesting desktop mode. The fix uses actual viewport dimensions, which do reflect the rendered layout regardless of user agent.

Test plan

  • iPhone (portrait + landscape) — blocking message shown in both orientations
  • iPad mini portrait — modal opens, scrolls correctly
  • iPad mini landscape — modal opens, scrolls correctly
  • iPad with Magic Keyboard/trackpad — hover-to-reveal behavior unchanged
  • Desktop browser — behavior unchanged
  • Upload button in sidebar opens on first tap (not double-tap) on touch devices

🤖 Generated with Claude Code

…orkspace modal

- Replace isMobile (react-device-detect) with window.innerWidth/innerHeight
  checks so "Request Desktop Site" on iPad is respected
- Block modal when viewport < 560px wide OR < 600px tall, covering phones
  in both portrait and landscape while allowing tablets
- Remove md: prefix from overflow-y-auto so modal scrolls correctly on
  iPad mini in portrait mode (744px wide, below the 768px md breakpoint)
- Add onTouchEnd handler to upload button in sidebar to fix iOS double-tap
  issue caused by button being a descendant of an anchor element
- Update blocking message to accurately describe screen width requirement
  rather than incorrectly stating desktop-only

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

[BUG]: request desktop ignored on mobile

1 participant