[PR #5132] [CLOSED] fix: replace UA-based mobile detection with viewport size checks for workspace modal #5312

Closed
opened 2026-06-05 15:20:56 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/5132
Author: @elevatingcreativity
Created: 3/3/2026
Status: Closed

Base: masterHead: fix/manage-workspace-mobile-detection


📝 Commits (1)

  • f1e5582 fix: replace UA-based mobile detection with viewport size check for workspace modal

📊 Changes

3 files changed (+8 additions, -4 deletions)

View changed files

📝 frontend/src/components/Modals/ManageWorkspace/index.jsx (+2 -3)
📝 frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx (+5 -0)
📝 frontend/src/locales/en/common.js (+1 -1)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/5132 **Author:** [@elevatingcreativity](https://github.com/elevatingcreativity) **Created:** 3/3/2026 **Status:** ❌ Closed **Base:** `master` ← **Head:** `fix/manage-workspace-mobile-detection` --- ### 📝 Commits (1) - [`f1e5582`](https://github.com/Mintplex-Labs/anything-llm/commit/f1e5582d8b1977cad843886de730070df83a98a6) fix: replace UA-based mobile detection with viewport size check for workspace modal ### 📊 Changes **3 files changed** (+8 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/Modals/ManageWorkspace/index.jsx` (+2 -3) 📝 `frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx` (+5 -0) 📝 `frontend/src/locales/en/common.js` (+1 -1) </details> ### 📄 Description ## 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 - [x] iPhone (portrait + landscape) — blocking message shown in both orientations - [x] iPad mini portrait — modal opens, scrolls correctly - [x] iPad mini landscape — modal opens, scrolls correctly - [x] iPad with Magic Keyboard/trackpad — hover-to-reveal behavior unchanged - [x] Desktop browser — behavior unchanged - [x] Upload button in sidebar opens on first tap (not double-tap) on touch devices 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 15:20:56 -04:00
yindo closed this issue 2026-06-05 15:20:56 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#5312