Problem/Motivation
The navigation toolbar is very efficiently cached, but when it's not it gets rendered by big pipe. This creates jank (content layout shift) as the main page content gets pushed sideways after the navigation bar is rendered.
#3505610: Add a placeholder preview for the navigation toolbar would use a render placeholder to reserve the space, but this is apparently hard to make work - two of us failed on there.
A quick fix is to use the placeholder strategy deny list - this could mean slightly slower rendering of the rest of the page, but much less content layout shift as it renders. Overall to me at least, it feels less noticeable than the jank.
Steps to reproduce
Install Umami, as user one clear the cache on admin/config/development/performance - notice that the side bar loads with the rest of the page content and doesn't push it sideways (compared to HEAD). Refresh the page or visit a different page and it should be just as snappy.
Proposed resolution
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #26 | judder.mov | 44.93 KB | godotislate |
Issue fork drupal-3585957
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
Comment #2
catchPut up an MR. This might affect cold cache performance slightly because order of things will be different, we'll find out..
Comment #4
catchResults in a very tiny improvement in performance tests too, navigation css/js is loaded with the assets from the main request instead of separately (as it would be on a render cache hit), and slightly less processing which is probably also the asset system not having to calculate anything.
Comment #5
catchComment #6
catchComment #7
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #8
catchRebased.
Comment #9
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #12
catchRebased.
Comment #13
smustgrave commented#3618256: Adjust tests using olivero_test test module is in review should we try and push that one forward first?
Comment #14
catch@smustgrave I don't think that has anything to do with this issue does it?
Comment #15
smustgrave commentedThat’s the link in the todo
Comment #16
catchThe link in the todo is #3505610: Add a placeholder preview for the navigation toolbar.
Comment #17
smustgrave commentedDisregard my last comment some reason my clipboard wasn't clearing on my macbook. Sorry for the noise, this looks fine.
Comment #19
godotislateI'm actually seeing an issue on HEAD where on Umami, after clearing cache from
admin/config/development/performanceper IS, the navigation does not appear at all, and there's a browser console error:This might be another symptom of the race condition @berdir alluded to in #3566843-27: Navigation module results in unintended caching
MR changes fix this.
Comment #21
godotislateCommitted 9afec8f and pushed to main. Thanks!
Need an 11.x MR for conflicts in the performance tests. Should this go to 11.4.x as well?
Comment #22
godotislateDid the same cache-clear test on Umami 11.4.x. I'm not seeing the JS error, but preventing big pipe rendering of navigation does fix the sideways layout shift seen on HEAD. There's a vertical layout shift that I haven't looked into and assume is from something else.
Race condition could still be an issue on 11.4.x, but it hasn't presented itself in my local tests as obviously.
Comment #23
catchI can't actually see the vertical layout shift on 11.x, there's a bit of flicker when the main content loads but the header and navigation sidebar both look static.
Cherry-picked to a new 11.x branch and updated performance tests.
If this was only fixing the layout shift I wouldn't have any interest in an 11.4 backport but we might want to for the js errors / race condition that are so-far unexplained. Not sure if it will need a separate backport MR or not yet.
Comment #26
godotislateTried again today on 11.4.x with fix applied, and it was reproducing far less frequently than yesterday, like 1 in 20, if that. The "flicker" you described might be what I'm seeing. Attached screen recording: https://www.drupal.org/files/issues/2026-09-09/judder.mov.
Committed 37e2cf3 and pushed to 11.x. Thanks!
Doesn't apply to 11.4.x because the performance test conversion using YAML files wasn't backported there.
Comment #28
godotislate11.4 MR: https://git.drupalcode.org/project/drupal/-/merge_requests/17261
Comment #29
berdirMR looks ok.
Comment #31
catchCommitted/pushed to 11.4.x, thanks!