[PR #8716] [MERGED] fix(client): stop Chromium dropping Mari rules lowered to :lang() lists #8762

Closed
opened 2026-11-07 17:39:31 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8716
Author: @SpicyMarinara
Created: 11/3/2026
Status: ✅ Merged
Merged: 11/3/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/8709-css-lang-selectors


📝 Commits (2)

  • 41ba7ea fix(client): stop Chromium dropping Mari rules lowered to :lang() lists
  • f3d4796 fix(client): let rtl:/ltr: variants build and flip Mari's narrow sprite gap

📊 Changes

7 files changed (+186 additions, -11 deletions)

View changed files

📝 packages/client/.instructions.md (+1 -0)
📝 packages/client/scripts/build-multiplayer-guest.mjs (+2 -1)
➕ packages/client/scripts/css-lang-selectors.mjs (+59 -0)
📝 packages/client/src/styles/globals.css (+3 -1)
📝 packages/client/src/styles/mari.css (+33 -9)
📝 packages/client/vite.config.ts (+4 -0)
➕ scripts/regressions/client-css-lang-selectors.regression.mjs (+84 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #8709

Why this change

build.cssTarget: "safari14" makes Lightning CSS fake the logical properties Safari 14.0 lacks: inset-inline-* and the logical corner radii. It does this with :lang(ae,ar,…) selector lists, and Chromium rejects a comma list inside :lang(), so it silently dropped all nine of those rules. The most visible one: Prof. Mari's reply sprite lost its -3.75rem offset and covered the first paragraph of her reply.

What changed

  • CSS: cssTarget stays at safari14. The built CSS's 18 :lang() lists came from 7 source declarations in mari.css and globals.css, the ones the issue names. Each now uses physical sides:
    • The reply sprite, the two-column list divider and the Chats hairline get physical left plus a :where([dir="rtl"]) flip to right. i18n.ts sets dir on <html>, and :where() adds no specificity, so container-query layout rules still win.
    • The edit-group corner radii and the centred resize grip stay physical with no flip, because they look the same in either direction.
    • The code block language label stays right: 0, because code blocks render dir="ltr".
    • The narrow-layout sprite margin is now margin-block/margin-inline, so its gap stays on the text side in right-to-left locales. Before, the gap fell on the outer side and the text touched her.
  • Build guard: a new Vite plugin, cssLangSelectorGuard (packages/client/scripts/css-lang-selectors.mjs), follows the existing bundleBudget pattern.
    • It fails the build when an emitted stylesheet has a :lang() comma list in a position Chromium drops: top level, :not(), :has().
    • It allows lists inside a forgiving :where()/:is(), which Chromium keeps. That is what Tailwind's rtl:/ltr: variants produce.
    • It is wired into the app build and the multiplayer guest build, so pnpm check and CI enforce it.
  • packages/client/.instructions.md gets a one-line note on which declarations to avoid.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

What the agent ran:

  • pnpm check passes (exit 0), including the full build.
  • Built CSS from the app and the guest build: no :lang() lists.
  • With staging's CSS restored, the real build fails and the guard names every offending selector.
  • scripts/regressions/client-css-lang-selectors.regression.mjs runs real Lightning CSS at a Safari 14 target. It covers the issue's declaration, Tailwind rtl:/ltr: shapes (allowed), :not()/:has() lists (rejected) and the narrow sprite margin. A mutation check shows it fails with the guard disabled.
  • In headless Chromium 156: the wide sprite sits 60px outside the reply in both directions, and the narrow layout's text gap is 9.6px in LTR and RTL.
  • Related regressions pass: multiplayer-control-security (real guest build), launcher client builds, command-center, music-dj.
  • open-issues.regression.ts failed on a turn-game prompt-logging check that this PR doesn't touch. #8710 has since repaired staging's node regressions.
  • An independent review confirmed two findings (the Tailwind rtl:/ltr: false failure and the narrow-layout RTL gap). Both are fixed, and a second pass verified the fixes.

Manual verification notes

  • Manually verify in Chrome (or the Windows app) in a window wider than about 52rem: Prof. Mari's sprite hangs in the margin left of her newest reply. Drag her and release, and she springs back beside the text, not over it.
  • Manually verify in a narrow Mari window: she floats at the start of the reply and the text wraps around her with a gap.
  • Manually verify the other affected spots look right: the two-column list divider, the edit-group menu corners, the Chats hairline in the omnibar header, the companion resize grip, and the code block language label.
  • Manually verify on Safari 14 or an older iPhone if one is available.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/8716 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 11/3/2026 **Status:** ✅ Merged **Merged:** 11/3/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/8709-css-lang-selectors` --- ### 📝 Commits (2) - [`41ba7ea`](https://github.com/Pasta-Devs/Marinara-Engine/commit/41ba7ead1eb63c26a9ef5b2991d84e1013aa17fb) fix(client): stop Chromium dropping Mari rules lowered to :lang() lists - [`f3d4796`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f3d479698163783c29e11e08bba7f04870d1c704) fix(client): let rtl:/ltr: variants build and flip Mari's narrow sprite gap ### 📊 Changes **7 files changed** (+186 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/.instructions.md` (+1 -0) 📝 `packages/client/scripts/build-multiplayer-guest.mjs` (+2 -1) ➕ `packages/client/scripts/css-lang-selectors.mjs` (+59 -0) 📝 `packages/client/src/styles/globals.css` (+3 -1) 📝 `packages/client/src/styles/mari.css` (+33 -9) 📝 `packages/client/vite.config.ts` (+4 -0) ➕ `scripts/regressions/client-css-lang-selectors.regression.mjs` (+84 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #8709 ## Why this change `build.cssTarget: "safari14"` makes Lightning CSS fake the logical properties Safari 14.0 lacks: `inset-inline-*` and the logical corner radii. It does this with `:lang(ae,ar,…)` selector lists, and Chromium rejects a comma list inside `:lang()`, so it silently dropped all nine of those rules. The most visible one: Prof. Mari's reply sprite lost its `-3.75rem` offset and covered the first paragraph of her reply. ## What changed - **CSS:** `cssTarget` stays at safari14. The built CSS's 18 `:lang()` lists came from 7 source declarations in `mari.css` and `globals.css`, the ones the issue names. Each now uses physical sides: - The reply sprite, the two-column list divider and the Chats hairline get physical `left` plus a `:where([dir="rtl"])` flip to `right`. `i18n.ts` sets `dir` on `<html>`, and `:where()` adds no specificity, so container-query layout rules still win. - The edit-group corner radii and the centred resize grip stay physical with no flip, because they look the same in either direction. - The code block language label stays `right: 0`, because code blocks render `dir="ltr"`. - The narrow-layout sprite margin is now `margin-block`/`margin-inline`, so its gap stays on the text side in right-to-left locales. Before, the gap fell on the outer side and the text touched her. - **Build guard:** a new Vite plugin, `cssLangSelectorGuard` (`packages/client/scripts/css-lang-selectors.mjs`), follows the existing `bundleBudget` pattern. - It fails the build when an emitted stylesheet has a `:lang()` comma list in a position Chromium drops: top level, `:not()`, `:has()`. - It allows lists inside a forgiving `:where()`/`:is()`, which Chromium keeps. That is what Tailwind's `rtl:`/`ltr:` variants produce. - It is wired into the app build and the multiplayer guest build, so `pnpm check` and CI enforce it. - `packages/client/.instructions.md` gets a one-line note on which declarations to avoid. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` What the agent ran: - `pnpm check` passes (exit 0), including the full build. - Built CSS from the app and the guest build: no `:lang()` lists. - With `staging`'s CSS restored, the real build fails and the guard names every offending selector. - `scripts/regressions/client-css-lang-selectors.regression.mjs` runs real Lightning CSS at a Safari 14 target. It covers the issue's declaration, Tailwind `rtl:`/`ltr:` shapes (allowed), `:not()`/`:has()` lists (rejected) and the narrow sprite margin. A mutation check shows it fails with the guard disabled. - In headless Chromium 156: the wide sprite sits 60px outside the reply in both directions, and the narrow layout's text gap is 9.6px in LTR and RTL. - Related regressions pass: multiplayer-control-security (real guest build), launcher client builds, command-center, music-dj. - `open-issues.regression.ts` failed on a turn-game prompt-logging check that this PR doesn't touch. #8710 has since repaired staging's node regressions. - An independent review confirmed two findings (the Tailwind `rtl:`/`ltr:` false failure and the narrow-layout RTL gap). Both are fixed, and a second pass verified the fixes. ### Manual verification notes - Manually verify in Chrome (or the Windows app) in a window wider than about 52rem: Prof. Mari's sprite hangs in the margin left of her newest reply. Drag her and release, and she springs back beside the text, not over it. - Manually verify in a narrow Mari window: she floats at the start of the reply and the text wraps around her with a gap. - Manually verify the other affected spots look right: the two-column list divider, the edit-group menu corners, the Chats hairline in the omnibar header, the companion resize grip, and the code block language label. - Manually verify on Safari 14 or an older iPhone if one is available. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 17:39:31 +07:00
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
Pasta-Devs/Marinara-Engine#8762
No description provided.