Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flash of unstyled content when selecting a menu item #228

Closed
yatil opened this issue Apr 18, 2018 · 5 comments
Closed

Flash of unstyled content when selecting a menu item #228

yatil opened this issue Apr 18, 2018 · 5 comments

Comments

@yatil
Copy link

yatil commented Apr 18, 2018

When selecting a menu item, the page sometimes only flashes unstyled content before loading all the surrounding data and CSS. That’s weird. (Observed in latest Safari on latest MacOS.

See video here: https://cl.ly/3a2O1h40133r

@tidoust
Copy link
Member

tidoust commented Apr 19, 2018

Thanks for the report (and video!), @yatil. That's a known and unfortunate consequence of the fact that the HTML page is assembled client-side for now: the browser first loads the raw content and then the right HTML template and CSS styles, which can take up to a few seconds and trigger the nasty flash.

That problem does not exist in published snapshots, which contain generated pages.

While the generation of a given page is automatic, the generation of an entire snapshot is still a manual process for now. What I'd like to do is to automate that generation so that the pages that get served on GitHub Pages can become the generated versions.

That supposes also fixing the content negotiation issue noted in #68 (comment) for translations though...

Anyway, we know the issue exists, and fixing it properly will take some time. I'll see if I can find a quick workaround in the meantime.

@tidoust
Copy link
Member

tidoust commented Apr 20, 2018

That supposes also fixing the content negotiation issue noted in #68 (comment) for translations though...

Actually, there should be no need to fix that issue for now. If we stick to current naming convention, we just won't do any content negotiation on the version published through GitHub Pages. People will just always get the English version, with a possibility to switch to existing translations from the footer.

@yatil
Copy link
Author

yatil commented Apr 20, 2018

Ah, OK, thanks for the clarification!

@yatil yatil closed this as completed Apr 20, 2018
@tidoust
Copy link
Member

tidoust commented Apr 20, 2018

My last comment may be a bit unclear. What I meant is that there is no need to fix the content negotiation issue, but the flashing effect should still be fixed, so keeping the issue open seems a good thing :)

@tidoust tidoust reopened this Apr 20, 2018
tidoust added a commit to tidoust/media-web-roadmap that referenced this issue Apr 20, 2018
This update adds a script that generates all roadmap pages to a `.out` folder
and copies relevant assets there as well. Addresses w3c#129 (and part of w3c#228 in
the sense that we'll be able to replace the `gh-pages` branch with the
generated pages).

Under the hoods, the script uses JSDOM to load HTML pages, run the generation
in individual pages, and save the generated HTML content.

Some bits of code were adjusted accordingly not to create absolute URLs for
translation links, and to respond to the right "load" event in generated
documents.
xfq pushed a commit that referenced this issue Apr 21, 2018
This update adds a script that generates all roadmap pages to a `.out` folder
and copies relevant assets there as well. Addresses #129 (and part of #228 in
the sense that we'll be able to replace the `gh-pages` branch with the
generated pages).

Under the hoods, the script uses JSDOM to load HTML pages, run the generation
in individual pages, and save the generated HTML content.

Some bits of code were adjusted accordingly not to create absolute URLs for
translation links, and to respond to the right "load" event in generated
documents.
tidoust added a commit to tidoust/media-web-roadmap that referenced this issue Apr 21, 2018
Fix for w3c#129.

The pages published on GitHub so far were the semi-generated pages: the feature
info and implementation info were generated after each push but the pages were
assembled on the client device.

With this update, pages in the `gh-pages` branch become the fully generated
pages, meaning pages that have already been assembled and that are mostly
static, except for a couple of scripts (one to handle the menu and one to
implement the browser filtering mechanism).

The update fixes the flickering issue (w3c#228) in published pages (technically,
that problem still exists in page authoring mode, but that seems acceptable).
xfq pushed a commit that referenced this issue Apr 22, 2018
Fix #129.

The pages published on GitHub so far were the semi-generated pages: the feature
info and implementation info were generated after each push but the pages were
assembled on the client device.

With this update, pages in the `gh-pages` branch become the fully generated
pages, meaning pages that have already been assembled and that are mostly
static, except for a couple of scripts (one to handle the menu and one to
implement the browser filtering mechanism).

The update fixes the flickering issue (#228) in published pages (technically,
that problem still exists in page authoring mode, but that seems acceptable).
@tidoust
Copy link
Member

tidoust commented Apr 22, 2018

Pages published on GitHub Pages now are the fully generated versions of the pages which:

  1. load faster (they don't need to fetch HTML templates and spec data)
  2. do not "flash"

Technically, the flashing effect still exists in development mode, meaning when a roadmap author edits the pages locally on her computer before committing a change. That's not fantastic, but I think we can live with it for now. Closing the issue accordingly.

@tidoust tidoust closed this as completed Apr 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants