? PR-4.3-dev Pending

User tests: Successful: Unsuccessful:

avatar obuisard
obuisard
8 Mar 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

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar joomla-cms-bot joomla-cms-bot - change - 8 Mar 2023
Category Repository NPM Change
avatar obuisard obuisard - open - 8 Mar 2023
avatar obuisard obuisard - change - 8 Mar 2023
Status New Pending
avatar obuisard obuisard - change - 8 Mar 2023
Labels Added: NPM Resource Changed PR-4.3-dev
avatar sandewt
sandewt - comment - 8 Mar 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.]

avatar sandewt
sandewt - comment - 8 Mar 2023

Related #40046

avatar dgrammatiko
dgrammatiko - comment - 8 Mar 2023

(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

avatar laoneo
laoneo - comment - 8 Mar 2023

This one here is CSS only ?

avatar brianteeman brianteeman - test_item - 8 Mar 2023 - Tested successfully
avatar brianteeman
brianteeman - comment - 8 Mar 2023

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.

avatar sandewt sandewt - test_item - 9 Mar 2023 - Tested successfully
avatar sandewt
sandewt - comment - 9 Mar 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.

avatar khu5h1 khu5h1 - test_item - 9 Mar 2023 - Tested successfully
avatar khu5h1
khu5h1 - comment - 9 Mar 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.

avatar alikon alikon - change - 9 Mar 2023
Status Pending Ready to Commit
avatar alikon
alikon - comment - 9 Mar 2023

RTC


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

avatar Quy Quy - change - 9 Mar 2023
Labels Added: ?
avatar Quy
Quy - comment - 9 Mar 2023

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

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

avatar brianteeman
brianteeman - comment - 9 Mar 2023

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

avatar Quy
Quy - comment - 9 Mar 2023

Yes a different solution without the additional css.

avatar obuisard
obuisard - comment - 9 Mar 2023

Yes a different solution without the additional css.

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

avatar obuisard obuisard - change - 9 Mar 2023
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 9 Mar 2023
Category Repository NPM Change Modules Administration
avatar obuisard obuisard - change - 9 Mar 2023
Labels Added: ?
avatar Quy Quy - test_item - 9 Mar 2023 - Tested successfully
avatar Quy
Quy - comment - 9 Mar 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.

avatar sandewt sandewt - test_item - 9 Mar 2023 - Tested successfully
avatar sandewt
sandewt - comment - 9 Mar 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.

avatar obuisard obuisard - change - 9 Mar 2023
Labels Removed: NPM Resource Changed
avatar obuisard obuisard - close - 9 Mar 2023
avatar obuisard obuisard - merge - 9 Mar 2023
avatar obuisard obuisard - change - 9 Mar 2023
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2023-03-09 23:01:00
Closed_By obuisard
avatar obuisard obuisard - change - 9 Mar 2023
The description was changed
avatar obuisard obuisard - edited - 9 Mar 2023

Add a Comment

Login with GitHub to post a comment