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

Unexpected brief Flicker of Website Last Updated Text and Dark mode Icon on Page Load in 404 page #12505

Open
1 of 2 tasks
Codex-Bugmenot opened this issue Mar 19, 2024 · 5 comments
Assignees
Labels
bug 🐛 Something isn't working dev required help wanted Extra attention is needed or someone is needed to help low priority This has a low priority

Comments

@Codex-Bugmenot
Copy link

Describe the bug

When the 404 page loads after brief moment the website last updated text and the dark mode icon change(and the text ctrl +k in the search bar) .

To reproduce

  1. Go to an 404 page , i used "https://ethereum.org/en/1"
  2. Now click reload (keep an eye on either the website last updated text or dark mode sun/moon icon or the search bar)
  3. After a brief moment they change
  4. repeat step 2 again and again to see them change clearly

Expected behavior

1.Page should load with a single date format
2.Page should load with selected darkmode icon (either sun or moon)

Screenshots

1
2
3
4
5
6

Desktop (please complete the following information)

-Browser : Brave (Chromium build)

Smartphone (please complete the following information)

-Browser : Brave (Chromium build)

Additional context

observe that in the screen shots the date uses two different formats

month dd , year
dd month year
( two different formats used)

Would you like to work on this issue?

  • Yes
  • No
@Codex-Bugmenot Codex-Bugmenot added the bug 🐛 Something isn't working label Mar 19, 2024
@github-actions github-actions bot added the needs triage 📥 This issue needs triaged before being worked on label Mar 19, 2024
@Codex-Bugmenot Codex-Bugmenot changed the title Unexpected Automatic Transition of Website Last Updated Text and Dark mode Icon on Page Load in 404 page Unexpected brief Flicker of Website Last Updated Text and Dark mode Icon on Page Load in 404 page Mar 19, 2024
@tomasgrusz
Copy link
Contributor

Hey! Hmm, I'm not sure how this would be changed. I believe this happens on every page when you reload it. Cannot confirm for certain if that's the case for ethereum.org, but from my experience, what probably happens:

  1. pages are pre-generated during build, therefore the client is served HTML content
  2. Once loaded, the browser determines dark/light mode from browser prefer config or local storage
  3. Page updates icons (and maybe date) to correct option

This doesn't happen when you navigate through the page, because the navigation is taken care of by Next.js (no further calculations needed for dark mode/date format).

You can see the same on this page where ETH price is briefly in loading state after visit.
Screenshot 2024-03-19 at 21 53 21

Maybe someone from core devs could advise, but I don't think this behaviour can be stopped as it executes after the page is loaded.

One possible option would be to hide the date/icon until it's determined to be the correct format/option.

Happy to help with this depending on the comments from core devs.

@Codex-Bugmenot
Copy link
Author

The flicker for dark mode icon happens only if sun icon is the active one, if the moon is active there's no flicker for the icon.

@wackerow
Copy link
Member

Can confirm I'm getting the same behavior. And yes, this is likely related to how pages are built on the server and then sent to the user before it knows some details like color mode... cc @pettinarip Do you know if this is a known Chakra or Next.js bug? Can think about how we could solve this.

@Codex-Bugmenot I see you checked no for wanting to work on this.. @tomasgrusz any chance you'd like to give it a shot?

@wackerow wackerow added help wanted Extra attention is needed or someone is needed to help low priority This has a low priority dev required and removed needs triage 📥 This issue needs triaged before being worked on labels Mar 21, 2024
@tomasgrusz
Copy link
Contributor

@tomasgrusz any chance you'd like to give it a shot?

Yeah, I can take a look at it. 👍

@Codex-Bugmenot
Copy link
Author

Codex-Bugmenot commented Mar 21, 2024

@tomasgrusz i have found a website powered by "hashnode" which uses similar icons, want me to link it here?( it may be of help as a reference)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working dev required help wanted Extra attention is needed or someone is needed to help low priority This has a low priority
Projects
None yet
Development

No branches or pull requests

3 participants