Closed Bug 1799974 Opened 2 years ago Closed 1 year ago

New Tab Page has layout shift from article source appearing a bit later than other contnet

Categories

(Firefox :: New Tab Page, defect)

defect

Tracking

()

VERIFIED FIXED
109 Branch
Tracking Status
firefox109 --- verified
firefox110 --- verified

People

(Reporter: dholbert, Assigned: thecount, NeedInfo)

Details

Attachments

(5 files)

STR:

  1. Reload the new-tab page, and watch the layout afterwards.
  2. Repeat.

(Or equivalently: Open a new tab or new window, watch the layout, and then open a new tab/window again.)

ACTUAL RESULTS:
As the new tab page renders, the layout shifts a few times, which is a bit distracting & feels a bit broken.
The most noticeable (and avoidable) shift that I see is when the single-line domain name & reading-time-estimate appears, and the blurb shifts down (and the tile grows taller) to accommodate it.

EXPECTED RESULTS:
We should aim to avoid layout shift here. Specifically for the domain name & reading-time-estimate, we could just allocate some space there for that empty line, and populate it with text when the text is ready, without impacting the layout.

Attached image first non-blank paint

Here's the first non-blank paint from the video (before any of the pocket recommended tiles have rendered at all).

Here's the second non-blank paint. Notice that the domain-name & reading-time-estimates are not present yet on the articles, and no space has been left aside for them.

Here's the final paint, with the tiles fully loaded. If you compare this side-by-side to the previous one, you can see that the page-content jumps as the line is inserted for each tile's domain name and reading-time-estimate.

The severity field is not set for this bug.
:daleharvey, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(dharvey)

This one seem like possibly a P2 so pinging Scott just in case this needs fixed as a priority?

Flags: needinfo?(dharvey) → needinfo?(sdowne)

Yup, this is a bug, I'll see if it's easy and fix it today.

It also might be a regression, but I doubt it is a recent regression.

Assignee: nobody → sdowne
Flags: needinfo?(sdowne)

This doesn't happen without the read time, which I suspect is because it is going through fluent for that case.

I don't think we can make fluent faster than it already is, I don't think we can wait for it, and I also don't think we can easily start the fluent process sooner.

I suspect our best bet is that line to have a placeholder height to avoid the page shifting while fluent updates the string..

Looks like I can just modify the display of the span inside a couple translated elements so it retains the element line height while the text is being added, so the element is the same height before and after translation.

Pushed by sdowne@getpocket.com:
https://hg.mozilla.org/integration/autoland/rev/732eca22ad6f
Pocket newtab fixing loading of page to have less shifting. r=gvn

Backed out for causing node failures

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: TEST-UNEXPECTED-FAIL sasslint | content-src/components/DiscoveryStreamComponents/DSCard/_DSCard.scss(184, 1): Space expected between blocks (empty-line-between-blocks)
Flags: needinfo?(sdowne)
Pushed by sdowne@getpocket.com:
https://hg.mozilla.org/integration/autoland/rev/2d582652272c
Pocket newtab fixing loading of page to have less shifting. r=gvn
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
Flags: qe-verify+

Reproducible on a 2022-11-09 Nightly build on macOS 12.
Verified as fixed on Firefox 109.0b4(build ID: 20221218190303) and Nightly 110.0a1(build ID: 20221220093956) on macOS 12, Windows 10, Ubuntu 22.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: