Skip to content

Conversation

@obuisard
Copy link
Contributor

@obuisard obuisard commented Mar 8, 2023

Addresses issue #40011.

The guided tours are accessible throughout the administration.
However, on small devices, the tours cannot always run properly because some of the content is hidden from view and from the tours (targets are not found so the steps end up in the upper left corner of the window).

I am not sure this is the best approach, so please comment.

Summary of Changes

Add CSS to hide the tour dropdown on small viewports.

Testing Instructions

Make sure you see the 'Take a tour' button on the top toolbar of the administrator console.
Resize the window down. Around 576px, the dropdown should disappear.

Actual result BEFORE applying this Pull Request

You can take a tour on any screen size.

Expected result AFTER applying this Pull Request

'Take a tour' is not visible if the viewport is small or you are on a mobile device (tablets should be fine, but usually not smartphones).

This does not prevent the user to start a tour, resize the window down and continue the tour with possible 'failure' (no error or anything, just unexpected behavior in case an element is not 'visible').

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@joomla-cms-bot joomla-cms-bot added NPM Resource Changed This Pull Request can't be tested by Patchtester PR-4.3-dev labels Mar 8, 2023
obuisard added 3 commits March 8, 2023 00:09
Added Bootstrap mixins import
Missing variable
Added functions
@sandewt
Copy link
Contributor

sandewt commented Mar 8, 2023

I am not sure this is the best approach, so please comment.

I don't know either, but maybe you can do something with the following approach in case of mobile devices. These are often small. You don't need ccs.

Code in plugin, something like this:

use Joomla\CMS\Factory;

public function startTour(Event $event)
{
    if (Factory::getApplication()->client->mobile == true)
    {
	return;
    }

See for the devices:

if (
strpos($this->agent, 'MOT-') !== false
|| strpos($this->lowerAgent, 'j-') !== false
|| preg_match('/(mobileexplorer|openwave|opera mini|opera mobi|operamini|avantgo|wap|elaine)/i', $this->agent)
|| preg_match('/(iPhone|iPod|iPad|Android|Mobile|Phone|BlackBerry|Xiino|Palmscape|palmsource)/i', $this->agent)
|| preg_match('/(Nokia|Ericsson|docomo|digital paths|portalmmm|CriOS[\/ ]([0-9.]+))/i', $this->agent)
|| preg_match('/(UP|UP.B|UP.L)/', $this->agent)
|| preg_match('/; (120x160|240x280|240x320|320x320)\)/', $this->agent)
) {
$this->mobile = true;
}

[EDIT Sorry, my proposal doesn't work. Plugin does not behave what I expected.]

@sandewt
Copy link
Contributor

sandewt commented Mar 8, 2023

Related #40046

@dgrammatiko
Copy link
Contributor

(Factory::getApplication()->client->mobile == true)

That approach should never be used anymore as the UA string is deprecated from all the browsers as they start to roll out client hints

What would be a more solid solution is to have JS sniff the ACTUAL device (eg is it touch? has a small screen? etc) and then activate the dropdown button which by default should be disabled. Should be less than 5 lines of code and it works based on the actual data of the client not some sniffed dodgy data that could fail due to proxies, deprecated strings, etc

my 2c

@laoneo
Copy link
Member

laoneo commented Mar 8, 2023

This one here is CSS only 😏

@brianteeman
Copy link
Contributor

I have tested this item ✅ successfully on 7a8946c

does what it says


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40045.

@sandewt
Copy link
Contributor

sandewt commented Mar 9, 2023

I have tested this item ✅ successfully on 7a8946c


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40045.

1 similar comment
@khu5h1
Copy link
Contributor

khu5h1 commented Mar 9, 2023

I have tested this item ✅ successfully on 7a8946c


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40045.

@alikon
Copy link
Contributor

alikon commented Mar 9, 2023

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40045.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Mar 9, 2023
@Quy
Copy link
Contributor

Quy commented Mar 9, 2023

Would adding d-none d-sm-block be an option?

<div class="header-item-content dropdown header-tours">

@brianteeman
Copy link
Contributor

@Quy isn't that the functionaly the same as the code here?

@Quy
Copy link
Contributor

Quy commented Mar 9, 2023

Yes a different solution without the additional css.

@obuisard
Copy link
Contributor Author

obuisard commented Mar 9, 2023

Yes a different solution without the additional css.

It is actually much cleaner, I did not think about it.

@obuisard obuisard removed the RTC This Pull Request is Ready To Commit label Mar 9, 2023
@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Mar 9, 2023
@joomla-cms-bot joomla-cms-bot removed the NPM Resource Changed This Pull Request can't be tested by Patchtester label Mar 9, 2023
@Quy
Copy link
Contributor

Quy commented Mar 9, 2023

I have tested this item ✅ successfully on c4124df


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40045.

1 similar comment
@sandewt
Copy link
Contributor

sandewt commented Mar 9, 2023

I have tested this item ✅ successfully on c4124df


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40045.

@Quy Quy mentioned this pull request Mar 9, 2023
@obuisard obuisard added this to the Joomla! 4.3.0 milestone Mar 9, 2023
@obuisard obuisard merged commit 5cf3286 into joomla:4.3-dev Mar 9, 2023
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Mar 9, 2023
@obuisard obuisard deleted the guided-tours-mobile branch October 29, 2024 20:35
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.

10 participants