grav-plugin-admin icon indicating copy to clipboard operation
grav-plugin-admin copied to clipboard

Issue with responsive layout

Open flaviocopes opened this issue 8 years ago • 19 comments

When the browser window size is small enough to render the hamburger menu:

screen shot 2017-02-11 at 17 28 39

the sidebar menu is hidden, but still active. I cannot click any element on the page, but instead I click something and if I'm hovering one of the hidden menu items, one of them is clicked (e.g. I randomly clicked, and got logged out because I clicked the invisible "Logout" link.

Also happening when the text size is increased enough to trigger this layout.

Adding class="hidden" on #admin-sidebar works, need to find out if this can be added via JS or it's best to do it via CSS directly.

flaviocopes avatar Feb 11 '17 16:02 flaviocopes

What resolution does this occur at? Testing at 360x640 (portrait and landscape) with Chrome's Device Emulator, my biggest problem is that once the hamburger-menu is clicked, it cannot be hidden again - it pops back up, forcing me to navigate to Pages -> Home (edit) again, thus inevitably discarding any changes made (.gif).

I can, however, edit and format content without issue, apart from the Editor-toolbar flowing uncomfortably:

image

OleVik avatar Feb 24 '17 13:02 OleVik

Interesting, I cannot replicate it any more.

flaviocopes avatar Feb 24 '17 14:02 flaviocopes

I got this result with Grav v1.1.17 and Admin v1.2.14. Though admittedly Samsung S3 is a rather small viewport to emulate, but some newer phones appear to use roughly the same viewport dimensions.

OleVik avatar Feb 24 '17 14:02 OleVik

Oh I was referring to the original issue described.

I noticed some strange event handling with the hamburger icon, in the device emulation. Sometimes it's triggered 2 times, but not always.

flaviocopes avatar Feb 24 '17 15:02 flaviocopes

@OleVik Do you still have these issues?

mahagr avatar Dec 02 '20 06:12 mahagr

By and large, yes. On Core 1.7.0-rc.19, Admin v1.10.0-rc.19. the hamburger icon competes with the normal menu. They do not appear to operate from the same utility, so the hamburger-icon loads and the regular menu waits for the DOM to load before hiding:

image

This solves itself when the DOM loads, but they should be synchronous. The hamburger-icon also competes with the navigation-bar, though thankfully it's z-indexed above it. From a UI/UX-standpoint, a lot is lost from this, as I lose access to the three first buttons because the navigation-bar does not scale. The fourth and fifth is inaccessible behind the hamburger-icon, and also serves to obscure it. The title and path, and redundant "Save location", is also hidden.

image

It would be a better approach to tie them together, such that the entire navigation-bar is reduced at low widths and placed in dropdowns - or better yet, flexibly placed in a new row.

image

OleVik avatar Dec 06 '20 11:12 OleVik

You could tack onto this that on Core 1.7.10 with Admin 1.10.10, the login is still inaccessible. On a viewport of 673x608:

image

There is no scrollbar, because of overflow: hidden; applied to the body. Only keyboard-navigation works.

OleVik avatar Apr 11 '21 09:04 OleVik

@w00fz @rhukster I think that with the next version of admin we should take a mobile-first approach and make sure that the admin works from a modern phone/tablet. :)

mahagr avatar Apr 13 '21 07:04 mahagr

That's a given

w00fz avatar Apr 13 '21 19:04 w00fz

Until then, could we have overflow back, so it's at least possible to scroll through the interface? Not all viewports conform to 1920x1080 or higher, some are wonkier.

OleVik avatar Apr 13 '21 20:04 OleVik

@w00fz was this closed by a specific commit or release?

OleVik avatar May 27 '21 20:05 OleVik

By accident.

w00fz avatar May 27 '21 21:05 w00fz

I'll add to this. On mobile (on real device only, can't repro in devtools), the save button seem to disappear sometimes but I'm still not able to reproduce it. Here's a screenshot from a customer. Triggering a dialog (by switching to Expert mode), then canceling re-renders the page properly.

286891862_5028799143840324_3349581885640340522_n

I'd say most small entrepreneurs want to be able to edit content on the fly without having to actually go sit in front of a computer for an hour so responsiveness is critical (at least for my base).

vincentrouleau avatar Jun 13 '22 18:06 vincentrouleau

I took a peak and the whole thing is full of absolute positioning and translates. At that point, I think the best thing would be a redesign of that part. I ended up at least making the top buttons not overlap the burger and shrinking a bunch of things.

image

That's all the time I can spare today but I'd maybe like to try my hand at rewriting this part.

vincentrouleau avatar Jun 13 '22 18:06 vincentrouleau

any chance of a PR? :)

rhukster avatar Jun 13 '22 18:06 rhukster

any chance of a PR? :)

I simply added the CSS in the admin from the mytheme.php file for now. I can paste my stuff here when I'm done playing around. Could probably package everything into a PR sometimes this week.

vincentrouleau avatar Jun 13 '22 19:06 vincentrouleau

@rhukster If I have your permission to get rid of the weird burger and font-awesome icons, I'll block a whole day and rebuild the top bar. 😄

vincentrouleau avatar Jun 13 '22 19:06 vincentrouleau

the burger is to toggle the sidebar, so the functionality is not something we can lose. Same with the icons, we can't lose the functionality but if we can get them in some other way (dropdown, etc) then i'm fine with that.

rhukster avatar Jun 13 '22 20:06 rhukster

the burger is to toggle the sidebar, so the functionality is not something we can lose. Same with the icons, we can't lose the functionality but if we can get them in some other way (dropdown, etc) then i'm fine with that.

Of course! By "getting rid" I meant "redesign". Anyway, I'll try to squeeze this sometime this week.

vincentrouleau avatar Jun 13 '22 21:06 vincentrouleau