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 loading pages #6790

Closed
JasonWeill opened this issue Mar 22, 2023 · 7 comments · Fixed by #6911
Closed

Flash of unstyled content when loading pages #6790

JasonWeill opened this issue Mar 22, 2023 · 7 comments · Fixed by #6911
Assignees
Labels
bug tag:Release Blocker A must-have bug for the milestone to which it is tagged
Milestone

Comments

@JasonWeill
Copy link
Collaborator

JasonWeill commented Mar 22, 2023

In Notebook 7.0.0a17, I am seeing a brief flash of unstyled content when loading pages.

image

This was found by @ellisonbg during a bug bash.

@JasonWeill JasonWeill added the bug label Mar 22, 2023
@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to issues that need triage label Mar 22, 2023
@RRosio RRosio added this to the 7.0 milestone Mar 28, 2023
@RRosio RRosio removed the status:Needs Triage Applied to issues that need triage label Mar 28, 2023
@andrii-i
Copy link
Contributor

Could you please record the video or describe the steps to reproduce the problem? @krassowski mentions that JupyterLab shows loading Jupyter logo animation until styles are fully loaded. We should check if problem has to do with that and potentially use the same solution.

@krassowski
Copy link
Member

Specifically one would need to implement a SplashScreen token - this is an optional token used by theme manager to update splash screen once the CSS of themes has fully loaded.

@jtpio
Copy link
Member

jtpio commented May 25, 2023

For reference the splash screen was deliberately not added to RetroLab / Notebook 7 to make notebooks and other pages open like regular page (and not like an "application").

@JasonWeill
Copy link
Collaborator Author

Example of this happening in tip-of-main for Jupyter notebook:

Screen.Recording.2023-05-30.at.2.59.51.PM.mov

Screen capture with a flash of unstyled text (FOUT):

image

@jtpio
Copy link
Member

jtpio commented May 31, 2023

This might also happen when switching themes.

Specifically one would need to implement a SplashScreen token - this is an optional token used by theme manager to update splash screen once the CSS of themes has fully loaded.

Maybe one way to mitigate this would be to provide a ISplashScreen in Notebook 7. But instead of having the animation like in JupyterLab, maybe a blank overlay which would then be removed when the application is ready?

@andrii-i andrii-i added tag:Release Blocker A must-have bug for the milestone to which it is tagged and removed status:Needs Info labels May 31, 2023
@andrii-i
Copy link
Contributor

Thank you @JasonWeill

@jtpio
Copy link
Member

jtpio commented Jun 1, 2023

Given that the splash screen is optional, maybe that's something that could be fixed in JupyterLab directly.

Looking at the code the previous theme is first unloaded here:

https://github.com/jupyterlab/jupyterlab/blob/e0b4de1eb37c9dd37c11e5319ed00cb8d37b8d92/packages/apputils/src/thememanager.ts#L405-L410

And then the new theme is loaded here by calling its load() method to bring the new CSS: https://github.com/jupyterlab/jupyterlab/blob/e0b4de1eb37c9dd37c11e5319ed00cb8d37b8d92/packages/apputils/src/thememanager.ts#L423

In JupyterLab this is "hidden" by the splash screen so it's not visible by default. But if we disable the plugin that provides the splash screen with jupyter labextension disable @jupyterlab/apputils-extension:splash then we can also notice the flash of unstyled content:

splash-screen-disabled.mp4

@andrii-i andrii-i self-assigned this Jun 7, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug tag:Release Blocker A must-have bug for the milestone to which it is tagged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants