Remove mobile device detection

Bug #1539322 reported by Kristina Hoeppner
12
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Lisa Seeto

Bug Description

Mahara 15.10 introduced Bootstrap. All themes are now responsive. When I tested the "Deactivate device detection" functionality, I couldn't see much of a difference when using the site. I did notice the content chooser was displayed the start of the words instead of only showing the icon on the "Edit page" screen.

I wonder if we can remove the custom device detection. You can enable the user turning off device detection in Admin -> Config site -> User settings -> Users can disable device detection. That then happens on the account settings page.

summary: - Do we still need devicee detection?
+ Do we still need device detection?
Aaron Wells (u-aaronw)
Changed in mahara:
milestone: 16.04.0 → 16.10.0
Revision history for this message
Aaron Wells (u-aaronw) wrote : Re: Do we still need device detection?

Currently, device detection does two things:

1. Disables TinyMCE
2. Hides the "Portfolio -> Export" navigation tab

There is also code in htdocs/lib/web.php, in the smarty() function, which looks at the results of device detection and puts them into some Smarty template variables. But since 15.10, we no longer actually read those Smarty variables, at least not in any of the core themes.

1. $HANDHELD_DEVICE
2. $MOBILE
3. $DROPDOWNMENU (to disable dropdown menus; in 15.10 we show them anyway)

Revision history for this message
Aaron Wells (u-aaronw) wrote :

The latest version of TinyMCE works fine in our supported range of mobile OS'es. The export tab was disabled, I think, because in iOS there'd be no place for the download to go. I'm not sure whether that's still true, but it certainly works fine for Android.

For most of the other situations where we might want to change our behavior depending on the device, we've farmed that complexity out to a third-party library that does its own sniffing and decision making (i.e. mediaplayer, pdfjs, jQuery, etc).

There are two remaining things I think we might want device detection for... and they match up pretty closely with the two current things we do:

1. TinyMCE: Works fine in mobile, but I think we might want to change the layout of the buttons to fit on a mobile browser better. If we could do that in a responsive way that would be best, but otherwise, using device detection might be a good way to handle it.

2. The export tab. Can iOS handle download of ZIP files? If not, then we still need to detect iOS in order to hide it.

However, I think we could at least remove the settings related to device detection. So no more "disable device detection" user preference, and no "allow device detection" site setting. Instead, we'll just detect devices automatically. And if a power-user wants to get the desktop version of the site, they can change their browser's user-agent. (Or maybe replace the "allow device detection" setting with a "show desktop site" setting.)

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

I still can't get TinyMCE to work on iOS though no matter whether device detection is turned on or not. Using the example at https://www.tinymce.com/docs/demo/classic/ I can see the TinyMCE buttons on the iPad and iPhone. So it might be something on how it's implemented in Mahara. We have bug #1576643 for that issue.

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Hi Aaron,

Your suggestion of removing device detection sounds reasonable as there is no big difference between not having device detection and not and switching between the two is probably not done much.

We will still need device detection though for the audio recording that we want to implement.

I would suggest to always have TinyMCE available though on mobile devices and use device detection only for the export tab then and audio/video recordings.

Cheers
Kristina

Robert Lyon (robertl-9)
Changed in mahara:
milestone: 16.10.0 → 16.10.1
Robert Lyon (robertl-9)
Changed in mahara:
milestone: 16.10.1 → 17.04.0
Changed in mahara:
milestone: 17.04.0 → 17.10.0
Robert Lyon (robertl-9)
Changed in mahara:
milestone: 17.10.0 → 18.04.0
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Currently, when device detection is turned off, swiping will be disabled. See bug #1749308 A better solution would be the one described there so that we can still remove device detection.

Robert Lyon (robertl-9)
Changed in mahara:
milestone: 18.04.0 → 18.10.0
Changed in mahara:
milestone: 18.10.0 → 19.04.0
Changed in mahara:
milestone: 19.04.0 → none
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

TinyMCE has advanced and has a good mobile interface. The change Cecilia made in https://reviews.mahara.org/11075 allows to swipe even when device detection is turned on. I don't think we need this library any more only to hide the import and export buttons. When sites have 'Export via queue' enabled, the export could be triggered from a mobile device and completed on a regular computer.

Changed in mahara:
milestone: none → 21.04.0
summary: - Do we still need device detection?
+ Remove mobile device detection
Revision history for this message
Lisa Seeto (lisaseeto) wrote :

There have been many advances in mobile's since the original patch was created and it is now possible to download files on mobiles including iOS. A test revealed that we could go to mahara.org on an iPhone and with 'device detection' disabled, we were able to go to the files section of mahara and download all the files as a .zip folder onto the phone. We should be able to import/ export on mobile's now. The library can be decommissioned.

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/11473

Changed in mahara:
status: Triaged → In Progress
Lisa Seeto (lisaseeto)
Changed in mahara:
assignee: nobody → Lisa Seeto (lisaseeto)
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11473
Committed: https://git.mahara.org/mahara/mahara/commit/5f233b5aba1de70fde95b1b613546614ca7f1fa0
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 5f233b5aba1de70fde95b1b613546614ca7f1fa0
Author: Lisa Seeto <email address hidden>
Date: Mon Nov 30 13:16:27 2020 +1300

Bug 1539322: Remove mobile device detection

- remove Mobile_Detect.php
- remove site/account options to disable device detection
- remove all references to hand_held/mobile devices set by
Mobile_Detect.php

Change-Id: I684f214963193526d34a5e7b0240e59c9e86050f
Signed-off-by: Lisa Seeto <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
tags: added: manualupdate newfeature
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/11744

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.