[GH-ISSUE #2687] [Bug]: Chrome page translation jitters back to English - the web app rewrites the UI once a second by polling /metrics #1069

Closed
opened 2026-11-04 01:48:14 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @MrKop-git on GitHub (Oct 15, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2687

What happened

The Monitor tab (and the header pill) update by polling: serve/web/app.js runs async function poll() and re-arms itself with setTimeout(poll, 1000) (line 158-176), i.e. one GET /metrics per second; serve/web/monitor.js does the same every 2 s. Every tick replaces text that Google Chrome's built-in page translation is also rewriting.

With Chrome's translate feature on ("translate this page"), the UI text flips back and forth between the translated language and English — it "jitters"/flickers into English on every poll, one shift per second on the Monitor tab. The numbers on the Monitor are unreadable while it happens.

Expected: the page should keep the translated text stable while it updates its own values.

Steps: open http://127.0.0.1:<port> in Chrome with a UI language other than English, let Chrome translate the page (or right-click > "Translate to ..."), open the Monitor tab, watch the header pill and the metric cards.

Cause (as far as I can see in the source): Chrome's translation is a DOM mutation pass. Rewriting the same text nodes from a timer once per second makes Chrome's translation state and our own updates fight over the same nodes, so the freshly written English string shows before the translation pass re-applies. A push from the server (a single long-lived response the server writes to, e.g. SSE / a streamed /metrics), or updating only the parts that changed, removes the per-second full rewrite.

Strata version, GPU, OS

0.1.44.1 · GTX 1080 Ti 11GB (+ GT 710 for display) · CachyOS Linux 6.18.55 · Chromium 142 (Chrome's translate feature)

Engine log

(not engine-related — the web app's own polling; no engine log lines)

Originally created by @MrKop-git on GitHub (Oct 15, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/2687 ## What happened The Monitor tab (and the header pill) update by **polling**: `serve/web/app.js` runs `async function poll()` and re-arms itself with `setTimeout(poll, 1000)` (line 158-176), i.e. one `GET /metrics` per second; `serve/web/monitor.js` does the same every 2 s. Every tick replaces text that Google Chrome's built-in page translation is also rewriting. With Chrome's translate feature on ("translate this page"), the UI text flips back and forth between the translated language and English — it "jitters"/flickers into English on every poll, one shift per second on the Monitor tab. The numbers on the Monitor are unreadable while it happens. Expected: the page should keep the translated text stable while it updates its own values. **Steps:** open `http://127.0.0.1:<port>` in Chrome with a UI language other than English, let Chrome translate the page (or right-click > "Translate to ..."), open the Monitor tab, watch the header pill and the metric cards. **Cause (as far as I can see in the source):** Chrome's translation is a DOM mutation pass. Rewriting the same text nodes from a timer once per second makes Chrome's translation state and our own updates fight over the same nodes, so the freshly written English string shows before the translation pass re-applies. A push from the server (a single long-lived response the server writes to, e.g. SSE / a streamed `/metrics`), or updating only the parts that changed, removes the per-second full rewrite. ## Strata version, GPU, OS 0.1.44.1 · GTX 1080 Ti 11GB (+ GT 710 for display) · CachyOS Linux 6.18.55 · Chromium 142 (Chrome's translate feature) ## Engine log (not engine-related — the web app's own polling; no engine log lines)
Author
Owner

@MrKop-git commented on GitHub (Oct 15, 2026):

Correction to my own analysis in this issue (the fix is in PR #2692):

I wrote here that the cause was the per-second rewrite and that a push from the server "or updating only the parts
that changed" would remove it. The second half of that was wrong, and a fix built on it would not have worked:

  • I made GET /metrics/stream send an event only when a fingerprint of the payload changed. But the payload
    includes hardware, and the hardware sampler samples once a second - GPU load, temperature and VRAM change every
    tick. The fingerprint changed every second, so the throttle never engaged and the flicker stayed.
  • If it had engaged, it would have frozen an idle Monitor's curves, which is wrong for a live dashboard.

The rate was never the cause. Chrome translates a word by replacing it in the page; a script that writes the
English back a second later puts the original in its place, so the translation and the script fight over the same
node - one flip per second. Updating less often would only flip less often, not stop.

What the fix actually does:

  • The stream is one long-lived connection instead of one request per second, and it keeps sending on its own tick
    (measured 6 events in 5 s) - the Monitor scrolls exactly as before.
  • The flicker is fixed on the page: a node is written only when its text really changed. A number still updates
    every tick, because a number needs no translating; a word is written once and then left alone. Nothing competes
    with the translation, so there is nothing to flicker.
  • translate="no", and the page now brings its own translation (#2686), so the browser stops offering to
    translate it at all.
<!-- gh-comment-id:6202737999 --> @MrKop-git commented on GitHub (Oct 15, 2026): **Correction to my own analysis in this issue** (the fix is in PR #2692): I wrote here that the cause was the per-second rewrite and that a push from the server "or updating only the parts that changed" would remove it. The second half of that was wrong, and a fix built on it would not have worked: - I made `GET /metrics/stream` send an event only when a fingerprint of the payload changed. But the payload includes `hardware`, and the hardware sampler samples once a second - GPU load, temperature and VRAM change every tick. **The fingerprint changed every second, so the throttle never engaged and the flicker stayed.** - If it had engaged, it would have frozen an idle Monitor's curves, which is wrong for a live dashboard. The rate was never the cause. Chrome translates a word by replacing it in the page; a script that writes the English back a second later puts the original in its place, so the translation and the script fight over the same node - one flip per second. Updating less often would only flip less often, not stop. What the fix actually does: - The stream is one long-lived connection instead of one request per second, and it keeps sending on its own tick (measured 6 events in 5 s) - the Monitor scrolls exactly as before. - The flicker is fixed on the page: a node is written **only when its text really changed**. A number still updates every tick, because a number needs no translating; a word is written once and then left alone. Nothing competes with the translation, so there is nothing to flicker. - `translate="no"`, and the page now brings its own translation (#2686), so the browser stops offering to translate it at all.
Author
Owner

@Niko1221 commented on GitHub (Oct 19, 2026):

Thanks for taking the time to report this.

We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6271174316 --> @Niko1221 commented on GitHub (Oct 19, 2026): Thanks for taking the time to report this. We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1069
No description provided.