Skip to content

fix(linux): empty window under the C locale; CLAUDE.md: read, probe, then implement - #16

Merged
chetto1983 merged 4 commits into
masterfrom
claude/modernizzazione-design-5y4lwf
Nov 6, 2026
Merged

chetto1983 merged 4 commits into
masterfrom
claude/modernizzazione-design-5y4lwf

Conversation

@chetto1983

Copy link
Copy Markdown
Owner

What & why

  • Empty window on Linux under the C locale
    • Trigger: LANG=C.UTF-8 or POSIX, as on WSL2, containers, cloud VMs and the CI runner.
    • Cause: WebKitGTK reports navigator.language = "C". uPlot 1.6.32 builds Intl.NumberFormat(navigator.language) when its module loads, so the bundle throws RangeError: invalid language tag: C and the app never mounts. This is what kept the Linux E2E red in CI.
    • Fix: in setup, when the first of g_get_language_names() is C or POSIX, the main webview gets en-US through webkit_web_context_set_preferred_languages. Any other language is left to WebKit.
    • Dependency: webkit2gtk 2.0, Linux only. It is the version Tauri already uses.
    • Spec: docs/superpowers/specs/2026-11-06-linux-locale-design.md. Verification: docs/superpowers/verification/2026-11-06-linux-locale.md.
  • CLAUDE.md: read, then probe, then implement
    • A new first behavioral rule: read the installed source and docs, reproduce the failure under the conditions where it fails, and measure the fix in a throwaway worktree before implementing.
    • For CI-only failures: list how the runner differs from the local run and test each difference locally. Diagnostic push loops are not allowed.

Measured on WebKitGTK 2.52.6, Ubuntu 24.04, Xvfb, as a non-root user:

LANG Before After
C.UTF-8 "C", RangeError, empty window "en-US", app mounts (3/3 runs)
POSIX "en-US", mounts "en-US", mounts
it_IT.UTF-8 "it-IT", mounts "it-IT" kept, mounts

Full E2E against pymodbus with the fix: 88/88 as a non-root user with LANG=C.UTF-8, and 88/88 as root.

Type

  • feat — new capability
  • fix — bug fix
  • refactor / perf
  • docs
  • test
  • chore / ci / build

Checklist

  • npm run check && npm run lint && npm run format:check && npm test pass. No frontend code changed.
  • cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test pass (in src-tauri/)
  • Coverage ≥ 85% (Rust and frontend), no test skipped to hide a failure. Rust: 93.7% of lines. apply() needs a real webview, so the E2E covers it.
  • No file exceeds 600 LOC (npm run file-size); touched files refactored on touch
  • Checked end to end against pymodbus (npm run e2e): 88/88 non-root with LANG=C.UTF-8, 88/88 as root
  • Spec / CHANGELOG.md updated if behaviour or interfaces changed, per CLAUDE.md. The fix is listed under v3.4.0 Fixed.
  • UI changes use the Aura tokens only (no hard-coded colours). N/A

Notes for reviewers

  • What is not shown: only WebKitGTK 2.52.6 under Xvfb was tested, not WSL2 or a real desktop session. cargo mutants was not run on webview_locale.rs: it is not protocol code, and its single decision is covered by the unit tests.
  • Release: v3.4.0 is not published yet. It follows this PR once CI, including both E2E jobs, is green.

Generated by Claude Code

A rule ahead of the others: read the installed source and the docs,
reproduce the failure under the conditions where it fails, and measure the
candidate fix in a throwaway worktree, before writing code. For CI-only
failures, list the runner's differences (user, locale, exported variables,
image, versions) and test them locally one at a time; a push is not an
experiment. Written after six diagnostic pushes on 2026-11-06 missed what
one local run as a non-root user with LANG=C.UTF-8 showed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Rdii6QU3MVeyCefPEk5AL
With LANG=C.UTF-8 WebKitGTK reports navigator.language "C", uPlot throws
building Intl.NumberFormat at load, and the window stays empty. The spec
records the inventory (wry and Tauri set no language; webkit2gtk exposes
set_preferred_languages), the measurement that a call in setup still
reaches the page, and that a fixed en-US would override Italian users, so
the language is set only when the locale names none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Rdii6QU3MVeyCefPEk5AL
Under the C or POSIX locale (WSL2, containers, cloud VMs, CI runners) the
window stayed empty: WebKitGTK reported navigator.language "C" and uPlot's
Intl.NumberFormat threw when its module loaded. In setup, when the first
of g_get_language_names() is C or POSIX, the main webview's context gets
en-US through webkit_web_context_set_preferred_languages; any other
language is left to WebKit. webkit2gtk is the version Tauri already uses.

Measured on WebKitGTK 2.52.6 as a non-root user: C.UTF-8 now gives en-US
and the app mounts (it did not before), it_IT.UTF-8 stays it-IT. The full
E2E passes 88/88 as that user with LANG=C.UTF-8 and 88/88 as root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Rdii6QU3MVeyCefPEk5AL
@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 16c51c39-2d59-422e-ac4d-8a0674cee45f
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

With the locale fix the app starts on the Linux runner, and the run then
stopped at the first Connect: "Disconnect" never appeared. pymodbus 3.16.2
needs pyserial for its serial server, which is an extra; without it the
ASCII serial reference server raises "Serial client requires pyserial",
and asyncio.gather in reference_servers.py takes the TCP servers down with
it, so the master's connection is refused. Locally pyserial happened to be
installed; Windows starts no serial server.

Reproduced locally with Python 3.12 and a clean pymodbus 3.16.2 in a
throwaway venv, LANG=C.UTF-8, fresh HOME: the same "Disconnect ... still
not existing after 5000ms". With pymodbus[serial]==3.16.2 the TCP ports
listen and the E2E passes 88/88. The README and run.mjs name the extra too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Rdii6QU3MVeyCefPEk5AL
@chetto1983
chetto1983 merged commit ad09637 into master Nov 6, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants