Problem/Motivation

I cache is disabled, every time the page loads the items on the Navigation flickr briefly (text disappears). It all happens in milliseconds, but it's perceptible and it makes it feel the Navigation as not stable or "not finished".

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Issue fork navigation-3423020

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ckrina created an issue. See original summary.

ckrina’s picture

KeyboardCowboy’s picture

Priority: Normal » Major
finnsky’s picture

This is controlled here.
https://git.drupalcode.org/project/navigation/-/blob/1.x/css/components/...

It was added to:
When label is `collapse-sidebar` and localstorage setting is collapsed then we hide label until js loaded.

We need to add it only for buttons which are sidebar collapse/expand triggers.

finnsky’s picture

Status: Active » Needs work

Added few optimisations.
Top level menu items looks much better now.

Problem still exists with child menus.

probably we need to move this from js `if (document.URL === link.href) {` to some PHP trick?

Work still needed here.

finnsky’s picture

Status: Needs work » Needs review

Removed behaviours usage. now works faster. Please review

kanchan bhogade’s picture

StatusFileSize
new191.88 KB
new1.18 MB

Hi
I've tested MR !187 on Drupal 11.x

Test Result: No flickering effect after adding the patch

Adding videos for reference

Keeping in "needs review" for code verification and more reviews

Sanjeev P’s picture

Reviewed the issue. Now the sidebar reloads faster and no flicker found. It looks fixed.

Can be moved to RTBC++

Keeping in Needs Review for further review.

ckrina’s picture

Status: Needs review » Needs work

Moving this to NW to get visibility on my comments about the font rendering and font weight changes.

finnsky’s picture

Status: Needs work » Needs review

starshaped made their first commit to this issue’s fork.

starshaped’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me, tested in Firefox, Chrome, and Safari. The JS looks good to me too, always nice to shave off a few ms!

kostyashupenko’s picture

Status: Reviewed & tested by the community » Needs work

Added comment in MR, please check

finnsky’s picture

I would better reopen follow up for this. Because this MR contains more than this font-display.

ckrina’s picture

I just opened #3432097: Decide font-display strategy to leave the conversation about the font strategy out of this so we don't block the improvements this is introducing.

Also i found another problem is that "Shortcuts" menu button is not clickable anymore (but contains child menu items, i have checked in devtools). Not sure if it's related to the js rework in this MR. Maybe a follow-up can be opened?

I've just tested this and found the same error, that doesn't happen in 1.x, so the regression is being introduced here. So leaving this as to Needs work to fix that.

finnsky’s picture

it happends because of big-pipe replacement.
shortcut link is initially just link. and child items attached later. but when i removed behaviours this big-pipe replacement happends but no behaviours attached.

you can disable behaviours and check

so question is. revert behaviours or disable big-pipe for navigation somehow?

finnsky’s picture

I've added reattach with behaviours. it works but not sure about it.

finnsky’s picture

Status: Needs work » Needs review

Cleaned this a bit more. Now only Big Pipe replaced items became problem. But works.

m4olivei made their first commit to this issue’s fork.

finnsky’s picture

Alright added extra care about behaviours in case of BigPipe replacements. It is ready to go.

ckrina’s picture

Status: Needs review » Fixed

Merged, thanks everybody! This is a great improvement 🎉

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.