fix(i18n): RU Fallacies title overflow via lang-ru CSS class (#316) - #353
fix(i18n): RU Fallacies title overflow via lang-ru CSS class (#316)#353jsboige wants to merge 1 commit into
Conversation
clusterManager-Myia
left a comment
There was a problem hiding this comment.
RU title overflow fix: lang-ru CSS class injected on card body for Cyrillic (15-20% wider than Latin). EN/PT/FR untouched. Test + template CSS rules guard regression. Clean.
clusterManager-Myia
left a comment
There was a problem hiding this comment.
[Hermes] — COMMENT_WITH_CONCERNS\n\nRisk: LOW (CSS + static conversion for i18n fix)\n\nChecklist:\n1. Security scan: CLEAN\n2. Cross-repo impact: None\n3. Tests: 2 theory methods — injection + template guard\n\nConcerns:\n- — rebase onto main before approval.\n- Font-size reduction 3.5em → 3.0em for : consider verifying this doesn't underflow on short Cyrillic titles (2-3 words).
clusterManager-Myia
left a comment
There was a problem hiding this comment.
[Hermes] — COMMENT_WITH_CONCERNS
Risk: LOW (CSS + static conversion for i18n fix)
Checklist:
- Security scan: CLEAN
- Cross-repo impact: None
- Tests: 2 theory methods — injection + template guard
Concerns:
- mergeable: CONFLICTING — rebase onto main before approval.
- Font-size reduction 3.5em to 3.0em for .lang-ru .title: consider verifying this does not underflow on short Cyrillic titles (2-3 words).
Cyrillic Fallacies titles run ~15-20% wider than Latin equivalents and clip
off-card on tarot/web formats. Inject a `lang-ru` marker class on the card
body wrapper for RU only via StaticConversions, and ship inert
`.lang-ru .title { font-size: ...; overflow-wrap: break-word }` rules in
the overflow-prone templates (Face_fr 1.9em, Face_Web_fr 3.0em).
FR/EN/PT mustache stays byte-for-byte untouched (no StaticConversion
entry → DoStaticConversions is a no-op for those languages).
Surgical reconstruction on top of master (branch was 35 commits behind).
Build green; 6 new regression tests pass + 11 prior pass = 17/17.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
e409fc1 to
b743da0
Compare
clusterManager-Myia
left a comment
There was a problem hiding this comment.
[Hermes] — APPROVED
SHA reviewed: b743da0 (HEAD, changed from previously reviewed e409fc1)
Security scan
✅ CLEAN — no hardcoded credentials.
CI status
✅ All checks pass (GitGuardian, Debug build, Release build).
Previous concerns status (from review on e409fc1)
| # | Concern | Status |
|---|---|---|
| 1 | mergeable: CONFLICTING | ✅ Fixed — PR is now MERGEABLE (surgical reconstruction on top of master) |
| 2 | Font-size reduction 3.5em→3.0em for .lang-ru .title | ✅ Acceptable — Cyrillic titles are 15-20% wider than Latin, 3.0em is proportional. overflow-wrap: break-word escape hatch guards edge cases. |
Review
Surgical reconstruction of RU title overflow fix. StaticConversions injects lang-ru body class for RU only; CSS rules are inert for EN/PT/FR. 6 new regression tests guard injection + template CSS presence. 17/17 tests pass. Architecture is clean and minimal.
APPROVE — all prior concerns resolved, clean fix with proper test coverage.
Disposition coordinateur (jsboige 2026-05-29) : HOLD → Option BMise en attente. La fix RU overflow passera par Option B (auto-shrink JS dans CardPen), conforme à la décision actée #303 (Option A −14% = NO-GO, Option B prioritaire). Cette PR applique une réduction de police −14% (2.2em→1.9em Tarot, 3.5em→3.0em Web), scopée RU-only via la classe Conservée (pas close) car réutilisable :
Repassée en draft. Réévaluation après implémentation Option B + gate visuel ai-01 (Playwright RU sur pires titres) lors de la prochaine régénération. 🤖 ai-01 coordinator |
clusterManager-Myia
left a comment
There was a problem hiding this comment.
[Hermes] — APPROVED\n\nClean i18n fix. The three-part approach is well thought out:\n1. CSS .lang-ru .title rules reduce font-size and add overflow-wrap for Cyrillic titles\n2. StaticConversion injects lang-ru body class for RU only (EN/FR/PT untouched)\n3. Comprehensive unit tests verify both the injection and template CSS guards\n\nNo concerns. Merge when CI passes.
|
Fermée comme superseded par #400. Conformément à la disposition coordinateur (jsboige, 2026‑05‑29 : « HOLD → Option B (auto‑shrink JS dans CardPen) », décision actée #303), le débordement de titre RU (#316) est désormais corrigé côté CardPen par auto‑shrink JS plutôt que par cette classe CSS Pourquoi Option B :
Validé visuellement (Playwright) : RU rogné → entièrement lisible ; latin intact. Détails et tableau de mesures dans #400. La branche |
… (#400) Long non-breaking titles — notably RU Cyrillic compounds such as "НЕЙРОЛИНГВИСТИЧЕСКОЕ ПРОГРАММИРОВАНИЕ" — overflowed the .title box and were clipped mid-word, because the inner `.title > div` uses `overflow-wrap: normal`. This implements Option B from #303/#353 (auto-shrink JS), chosen over a RU-only CSS class so the fix is language- and template-agnostic. frame.js now runs autoFitCardTitles() on each <card> in generateImages(), right after font preload and before the domtoimage capture. For each `.title` it binary-searches the largest font-size that fits horizontally (floor 8px). Titles that already fit are left untouched (no-op), so non-overflowing Latin titles are unaffected. Validated via Playwright on the real Fallacies face template + CSS: - "AD HOMINEM" (Latin): 84.5px unchanged (no-op) - "НЕЙРОЛИНГВИСТИЧЕСКОЕ ПРОГРАММИРОВАНИЕ": 84.5 -> 39.1px, now fits - "ПСЕВДОНАУЧНОСТЬ": 84.5 -> 51.7px, now fits Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…idation dossier (#433) §2bis updated post-recalibration (#431 merged e9600c0). Replaces the stale pre-recalibration caveat (2834, global 65/85 thresholds, "po-2024 follow-up pending") with the fresh per-CardSet × per-detector breakdown from the recalibrated run (2026-06-03, 3905 imgs): - Construction-signature table: each detector flags by card construction, not defect. White-bg cards (Rules/Scenarii) → WhiteBand+blank-ratio ~96% noise; colored-bg (Fallacies-Web/Virtues) → blank-ratio clean, bottom-sat the signal. Only discriminant detector = bottom-sat, read per-CardSet. - #188 headline: WhiteBand clean on colored cards (Fallacies-Web 0, Virtues 37 scattered singletons, no 8-lang cluster) → no white-band regression on the cards #188 affected. - True exception list (bottom-sat): Rules rules_23 = #250 FIX 2 (proposed); Scenarii ~7 dense cards saturating ~43% uniformly across all 8 langs = card-intrinsic, NOT translation (new eye point); Virtues zh/ru/es/pt length-overflow cluster = #316/#353 family (PR #400 RU auto-shrink). Binary summary stays non-discriminant (3219/3905) — value is the per-CardSet exception filter, not the binary verdict. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Summary
Russian Fallacies card titles overflow the card edge because Cyrillic
runs ~15-20% wider than Latin. Worst cases clip mid-word off the card
(e.g.
НЕЙРОЛИНГВИСТИЧЕСКОЕ ПРОГРАММИРОВАНИЕon both Tarot and A0/Webfaces). The FR golden master ("PROGRAMMATION NEUROLINGUISTIQUE") and PT
("PROGRAMAÇÃO NEUROLINGUÍSTICA") render fine — this is RU-specific.
Closes part of #316 (RU cards). See scope note below.
Approach — Option A (RU-only, FR golden master untouched)
The localization layer already runs
StaticConversions(string replaceson the mustache template, per destination language) after the field-name
swaps. This PR rides that hook:
AssetConverterConfig.cs— add aStaticConversionsentry to theFallacies
CardSetLocalizationthat injects alang-rumarker classonto the card body wrapper for
ruonly:<div class="body">-><div class="body lang-ru">.DoStaticConversionsis a no-op forfr/en/pt(no entry), so theirmustache is byte-for-byte untouched.
Argumentum_Fallacies_Face_fr.json/Face_Web_fr.json— add inert.lang-ru .titlerules that only engage when the class is present:overflow-wrap: break-wordso extreme single Cyrillic words break to anew line instead of clipping off-card.
Face_2_fr/Face_3_fr(1.1em titles) are left alone — they don't overflow.Tests — 6 regression assertions in
FallaciesLocalizationTests:lang-ruis injected forruonly (fr/en/pt unchanged), and thelarge-title templates carry the matching
.lang-ru .titleCSS.Scope notes
worst-case titles — Latin script is similar to FR widths, no overflow. Mind-map SVG
overflow (also mentioned in fix(css): Cyrillic title overflow in RU/PT mind maps and cards (v1.0.0 blocker) #316) is a separate artifact and out of scope here.
ruto take effect (the class injectionhappens at harvest/localization time).
Validation status
FR simplification data(fallacies): simplify 27 desc_fr for younger audience #351) then ai-01 Playwright+vision pre-screen, then
@jsboige final inspection (fix(css): remove max-height constraint on Virtues card imageSection #303). Do not merge before the visual gate.
Generated with Claude Code