Skip to content

greedy-nav is not reliable on small devices #2664

Closed
@migupry

Description

@migupry

Environment

Expected behavior

Greedy nav is supposed to always show the same amount of visible-links and hidden-links, and it doesn't seem the case.
I've created two new repositories using the remote theme starter to demonstrate issues I've been having consistently using minimal mistakes. One of them (mmbasic) I've made no changes, and the other (mmlogo) I've added the bio-photo as the logo just to show another example which seem to be easier to reproduce the bug.

This is how the pages will load most of the time on my Android device, which is the expected behaviour:
mmbasic:
https://imgur.com/z5jEdB8
mmlogo:
https://imgur.com/ZAJCwVq

Steps to reproduce the behavior

This is how the pages are rendered sometimes, when opening the page for the first time:
mmbasic:
https://imgur.com/2BbpxzD (Notice "Categories" is gone)
https://imgur.com/0h1o70I (All links are visible, "Posts" is hidden because of overflow and "Categories" is hidden behind the title)
mmlogo:
https://imgur.com/n1jpuVV ("Posts" is hidden behind the title)

To reproduce it, simply open one of the pages on a mobile (android) device: https://www.miguel.dev.br/mmbasic/ or https://www.miguel.dev.br/mmlogo/

  • On Chrome mobile browser, this is mostly unreproduceable with page reloads, or even by clicking on the page links. It can only happen the first time you enter the page. So to reproduce, you need to go to another page, and come back, or close and reopen the tab. Some times you need to do this 5-10 times to reproduce, but sometimes, 1 or 2 times is enough.
  • This issue seems to be more easily reproduceable in the Logo version, than the basic version, and also seems to bother more in Instagram and Telegram's in-app browsers. I would guess it has to do with how those browsers handle cache, but i'm not sure. So sending this page's links via messaging on one of this apps, and opening on the same app, particularly the "mmlogo" version seem to be the easiest way to reproduce this. But I have to enforce this is not an issue exclusive to those browsers!

Other

  • I've tried messing with "jquery.greedy-navigation.js", and I've found the issue was mostly gone when I've changed the availableSpace = $vlinks.width() - 10; line to a calculation of the window's width decreased by some "rem" (font-size) value, which was obviously dumb and only viable with my particular setup of "logo + title".
  • As I've said on the previous item, by using that hack the issue was mostly gone, but not gone for good. It doesn't seem to have much effect for Instagram in-app browser. Most of the time, when opening the page via the instagram in-app browser, the navbar was messy (although it would get fixed with a reload). Since I was putting a page on production, and our main source of exposure for the page was instagram, I had to find a quick and dirty fix: I've ended up removing most of "greedynav" logic, duplicating the "visible" and "hidden" links on "masthead.html" and controlling the "display" attribute of "visible" and "hidden" links via media-queries. Dirty and dumb, but hey, at least it was reliable!

I'm about to get my hands dirty again trying to implement https://github.com/gijsroge/priority-navigation or one of the other alternatives listed there on one of my two projects that are using Minimal Mistakes to get a better fix for myself, and depending on my results I'll share here. Thought I would open this issue before though.

Needless to say, I'm in love with Minimal Mistakes, it's a really great job!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions