Project

General

Profile

Actions

Defect #41744

closed

flickering of the top menu on page refresh

Added by Tolga Uzun about 1 month ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
UI
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Cant reproduce
Affected version:

Description

I am trying the new version and experiencing a strange behavior. When the page refreshes, the top menu fonts change and there is an annoying flickering effect.
I captured the screen and added the video as an attachment.
I installed the new version on a server previously running Redmine 5.1.4 without problems. I only cloned the latest git repo, changed the config files and did the migrations.

Environment:
  • Redmine version 6.0.1.stable
  • Ruby version 3.2.4-p170 (2024-04-23) [x86_64-linux]
  • Rails version 7.2.2
  • Environment production
  • Database adapter Mysql2
Redmine settings:
  • Redmine theme Default
Redmine plugins:
  • no plugin installed

Is there anyone who knows why it happens and how to fix it?


Files

Flicker-On-Refresh.mp4 (149 KB) Flicker-On-Refresh.mp4 Tolga Uzun, 2024-11-13 19:37

Related issues

Related to Redmine - Feature #41748: Optimize font loading by replacing variable fonts with specific weights for Noto SansClosedGo MAEDA

Actions
Actions #1

Updated by Go MAEDA about 1 month ago

The phenomenon, known as FOUT (flash of unstyled text), occurs only when accessing the Redmine page for the first time or when performing a hard reload. It does not happen with subsequent accesses or regular reloads.

In Redmine 6.0.0, the font used on the screen has been changed to Noto Sans. Noto Sans is downloaded over the network from your Redmine server to the browser. Until the download is complete, the default font of the browser is displayed. Once the download is complete, it switches to Noto Sans. This is why the flash occurs when accessing the Redmine page for the first time or when performing a hard reload. However, for subsequent accesses, the font file is cached in the browser, so unless the cache expires or a hard reload is performed, the FOUT does not occur.

Actions #2

Updated by Tolga Uzun about 1 month ago

Thanks Maeda for the clarification.

I understand that FOUT might occur but this happens not only on the first load or hard reload but on the same page clicks too.

Now I tried other browsers and didn't see the same behavior. After some tests I figured out the Bitwarden extension on the Opera browser leads to it. (Bitwarden Extension Version: 2024.10.1)

Redmine 4, 5 on my servers and redmine.org does not do this behavior.

What could be the reason, any ideas? Is there anything I can do to figure out the root cause of it? It does not happen on other web sites, so can it be considered as a Redmine issue or not?

Actions #3

Updated by Go MAEDA about 1 month ago

Unfortunately, I am not sure why the issue occurs in Opera with the Bitwarden extension installed, but as a workaround, you could try disabling the use of the Noto Sans font.

To do this, open app/assets/stylesheets/application.css with a text editor, and delete two blocks that starts with @font-face at the beginning. Then, change the value assigned to --fonts-main from "Noto Sans", sans-serif to sans-serif.

diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css
index f1166cbe0..00d3393ea 100644
--- a/app/assets/stylesheets/application.css
+++ b/app/assets/stylesheets/application.css
@@ -4,26 +4,8 @@
  * This code is released under the GNU General Public License.
  */

-@font-face {
-  font-family: "Noto Sans";
-  src: url("/NotoSans-VariableFont_wdth,wght.woff2") format("woff2");
-  font-weight: 100 900;
-  font-stretch: 75% 125%;
-  font-style: normal;
-  font-display: swap;
-}
-
-@font-face {
-  font-family: "Noto Sans";
-  src: url("/NotoSans-Italic-VariableFont_wdth,wght.woff2") format("woff2");
-  font-weight: 100 900;
-  font-stretch: 75% 125%;
-  font-style: italic;
-  font-display: swap;
-}
-
 :root {
-  --fonts-main: "Noto Sans", sans-serif;
+  --fonts-main: sans-serif;
 }

 html, body { min-height: 100vh; }
Actions #4

Updated by Go MAEDA about 1 month ago

  • Related to Feature #41748: Optimize font loading by replacing variable fonts with specific weights for Noto Sans added
Actions #5

Updated by Tolga Uzun about 1 month ago

It is really strange that a password manager extension is causing this.

I didn't try the fix you provided, instead changed the extension to the Chrome one. (You can install Chrome extensions on Opera too.) Chrome extension on Opera browser doesn't cause the FOUT.

If it helps, i can try your fix and tell you the result.

Before realizing the forum i opened this issue as a defect so that is up to you to close this issue or not. I am not sure if it can be called as a defect or not.

Actions #6

Updated by Go MAEDA about 1 month ago

  • Status changed from New to Closed
  • Resolution set to Cant reproduce

Thank you for your feedback. I am closing this issue.

It is possible that the two font files, both exceeding 1MB in size, may have contributed to the issue.

While it is not certain whether this change will resolve the problem in your environment, #41748 improved the stylesheet to load four smaller font files, each around 200KB.

Actions #7

Updated by Tolga Uzun about 1 month ago

Sorry to say I tested the change proposed in #41748 but it did not change the behavior.

Actions

Also available in: Atom PDF