fix(rules): remap Tarot Rules CSS to 24-card CSV layout — couleurs cassées (#250 pt 3) - #437
fix(rules): remap Tarot Rules CSS to 24-card CSV layout — couleurs cassées (#250 pt 3)#437jsboige wants to merge 1 commit into
Conversation
…ule colour breaks (#250) The Rules template CSS (Argumentum_Rules_fr.json, shared by all 8 langs) only mapped card indices 1-18 via [class~="N"] selectors, but the CSV holds 24 cards. Each game variant therefore lost its theme or inherited the wrong one past index 18: variant CSV cards old CSS mapping result L'école 1-6 1-6 ✓ ok Le Bingo 7-9 7-8 card 9 unthemed Dernier b. parleur 10-14 9-11 colour flips at 12 (blue→…) Moulin à baratin 15-19 12-14 colour flips at 15 (→green lost) Parlote coinchée 20-24 15-18 cards 20-24 fully colourless Remapped group colour blocks, h2/h3 heading colours and :before variant labels to the actual contiguous CSV boundaries. Each variant now carries one consistent --color-group-bg/--color-group-box theme across ALL its cards; covers (1/7/10/15/20) keep their standalone treatment. École per-family multicolour (content classes) untouched. Index-based CSS is language-independent → this single edit covers all 8 languages. Addresses #250 problem 3 (couleurs cassées). Visual validation pending a Rules régén. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
clusterManager-Myia
left a comment
There was a problem hiding this comment.
[NanoClaw] Review PR #437
Verified the CSS remapping in Cards/Rules/Argumentum_Rules_fr.json (1 insertion / 1 deletion — only the css value changes, all other keys byte-identical).
What changed: The old CSS mapped color selectors to card indices 1–18, but the CSV contains 24 cards across 5 variants. Cards 19–24 (Parlote coinchée) had zero styling, and cards 10–18 suffered color flips at wrong boundaries.
The fix remaps all selectors to the correct CSV boundaries:
- École: 2–6 (unchanged)
- Bingo: 7–9 (was 7–8, added 9)
- Beau parleur: 10–14 (was 9–11, shifted +1 and extended)
- Moulin à baratin: 15–19 (was 12–14, shifted +3 and extended)
- Parlote coinchée: 20–24 (was 15–18, shifted +5 and extended)
All three selector families (group fallback --color-group-bg/box, heading h2/h3 --color-box, heading backgrounds) are consistently remapped to the new ranges. Colors within each variant are homogeneous (single theme per variant). Title cards (7, 10, 15, 20) are included in the heading selectors. Card 1 (cover) and École's multi-color per-heading styling (cards 4–5) are preserved unchanged.
No secrets, no scope creep. JSON validity maintained. Since this CSS key is shared across all 8 language templates, this single edit covers the full localization set.
One note: the PR description mentions "validation visuelle via regén Rules (lane ai-01) before merge" — that visual sign-off should happen before considering this closed.
myia-po-2023
left a comment
There was a problem hiding this comment.
Review po-2023 — CSS remapping vérifié ✅ APPROVED
Scope : uniquement le problème 3 de #250 (couleurs cassées). Les 6 autres points restent à traiter dans une vague éditoriale séparée.
Vérifications techniques
| Check | Résultat |
|---|---|
| Indices 1-24 complets, pas de gap | ✅ Confirmé |
| 1 variante = 1 thème cohérent (contenu) | ✅ Bingo orange, Dernier bleu, Moulin vert, Parlote violet |
Labels :before correctement scoppés |
✅ Corrige un bug master (labels bavants entre variantes) |
| Covers exclus des labels | ✅ 1/7/10/15/20 pas de :before |
| Impact 8 langues (1 seul template) | ✅ CSS partagé |
| CI vert | ✅ Debug + Release + GitGuardian pass |
git diff --stat |
✅ 1 fichier, 1 insertion/1 suppression |
Notes non-bloquantes (pour QA visuelle)
- École multicolore : les heading boxes des cartes 2-6 restent intentionnellement multicolores (legacy per-index). Cest by design (PR body le mentionne), mais le résumé « un seul thème cohérent sur TOUTES ses cartes » est légèrement surdéclaré pour lÉcole.
- Covers secondaires (7/10/15/20) : leur
## <titre>est rendu en heading box colorée par la règlecard:not([class~="1"]) h2— pré-existant, non introduit ici. Potentiellement incohérent vis-à-vis de la cover 1 (full-bleed art). À confirmer en QA visuelle.
Conclusion
Le remapping est techniquement correct et résout le problème signalé par jsboige. Gate : merge après sign-off visuel #140.
ℹ️ Superseded par #438 (refonte éditoriale complète #250) — ta décision pour la fermetureMerci @jsboige d'avoir pris en main le problème couleurs (pt 3) ici. J'ai poussé une PR Pourquoi #438 rend ce CSS obsolète : la refonte éditoriale change le nombre de cartes. Correspondance des 7 problèmes :
Validé visuellement (CardPen/Playwright, lane ai-01) : 15 cartes, 0 px d'overflow, 1 thème par 🔒 #438 reste held (pas de merge avant ton sign-off #140). Comme c'est ta PR, je ne la ferme pas moi-même : je te recommande de fermer #437 au profit de #438 |
…SS remap (#250, supersedes #437) (#438) * fix(rules): editorial restructure Tarot Rules 24→15 cards + 15-card CSS remap (#250) Treats ALL #250 Rules layout problems in one pass; supersedes #437 (CSS-only, 24-card). Card model = 1 CSV row = 1 card, so rebalancing = restructuring rows. - #250.1 École: move 2 paragraphs so §5 décompte fits entirely on card 5 - #250.2 covers: merge cover+Matériel+Résumé+Installation into 1 setup card per variant (Bingo/DBP/Moulin/Parlote); École keeps full-page art cover - #250.3 colours: remap CSS [class~=N] selectors to real 15-card boundaries - #250.4 DBP: merge orphan "Fin de partie" into gameplay card - #250.5 Moulin: merge orphan "Fin de partie + Variantes" into gameplay card - #250.6 Parlote: move §3 "tours de jeu" to last Parlote card Content-preservation invariant proven: for every column the \n\n-join of non-empty cells is byte-identical before/after (no content lost/added). Peak card length reduced 1829→1573. Merges applied to all 8 langs; FR paragraph moves mirrored on 7 other langs by po-2023 (heading-anchored). CSS: indices now 1..15, only css value changed (34 non-css keys byte-identical). Visual validation by FR Rules régén pending before merge. Refs #250. Supersedes #437. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * @ fix(rules): tighten Argumentum H1 on variant setup cards so dense DBP setup fits (#250) The 4 merged variant setup cards (7/9/11/13) carry the full-size "Argumentum" H1 (32px, ~83px vertical footprint) plus 4 sections. The densest — DBP setup (card 9) — overflowed by 14px, clipping the last Installation line. Reducing the H1 vertical margins (21.44px -> 6px/8px) on those 4 cards frees ~28px; all 15 cards now fit with zero overflow (verified live + baked render). École cover (card 1) keeps its full-page art. Index-based selector => covers all 8 languages. Only the css value of Argumentum_Rules_fr.json changes (1 JSON line). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> @ * @ docs(rules): add #250 visual validation dossier (15-card layout, 0px overflow) (#250) CardPen render proof (ai-01 Playwright/IIS) for PR #438: 6 representative cards covering all 6 reported Rules layout problems + the card-9 fit fix. Pixel-measured 0px overflow on all 15 cards. Index-based CSS => FR render validates layout/colours for all 8 languages. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> @ * fix(rules): mirror 3 FR paragraph moves to 7 translation languages (#250) Mirror ai-01's editorial paragraph moves (commit 6fc3644) from FR Text to Text_en, Text_ru, Text_pt, Text_ar, Text_es, Text_zh, Text_fa: 1. École move 1: saynète continuation from card 5 → end of card 4 2. École move 2: tie-breaking paragraph from card 6 → end of card 5 3. Parlote move: 'tours de jeu' section from card 14 → beginning of card 15 Invariant verified: \n\n-join byte-identical before/after for all 7 columns. 1 file changed, 172 insertions, 172 deletions (moves only, no content change). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(rules): bound .texte so dense Rules cards auto-shrink instead of overflowing footer (#250) jsboige reported Rules card images with overflow regressions on the stylized bullet-point body running into the footer band. Root cause: the Rules body markdown was rendered in a bare <div> with no `.texte` wrapper, so CardPen's #190 autoFitBodyText (frame.js) never engaged — it bails early when `.texte` is absent and, even when present, only shrinks when `.texte` has a BOUNDED clientHeight. Dense cards therefore grew past the absolute footer band (.colorPalette / .pageNumber / variant labels). Fix (two surgical edits, source-of-truth JSON template): - mustache: wrap the body in `.texte > .desc_fr` so #190 sees the body and the localization field tokens resolve as before. - css: `card:not([class~="1"]) .texte { max-height: 390px; overflow: hidden; }` bounds the body height on every non-cover card so #190 binary-searches the font factor down to fit; the cover (variant 1) is excluded — its art lives on bleed/safe backgrounds, not in `.texte`. Validated on the live CardPen engine (Playwright harness, real engine #190 + domtoimage capture) against the canonical dataset CSV (Cards/Rules/Argumentum Rules - Cards.csv), 15 cards x 8 languages. BEFORE (footer collisions, body bottom under footer top): - FR #9 +20px, #15 +22px - RU #9 +12px, #12 +23px - PT #4 +31px, #9 +28px, #10 +39px, #12 +95px - EN none AFTER: zero non-cover collisions across fr/en/ru/pt/es/ar/zh/fa; cover unchanged. Worst case (PT #12, +95px) now renders cleanly with the body auto-shrunk above the footer (eyeballed PNGs). This is the check the #412/#431 mechanical harness missed (it never drove the live #190 engine), which is why the "0px overflow" claim in the #140 dossier was wrong; that claim is corrected in a follow-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * docs(rules): correct false "0px overflow" claim in #250 validation dossier The dossier README claimed "0 px d'overflow partout (scrollHeight == clientHeight)". That measured container auto-fit (trivially scroll==client when height is unbounded), not body-vs-footer collision. The live #190 engine check (real CSV, 8 langs) found residual collisions on the restructured template — FR/RU/PT, worst PT #12 +95px — now resolved by 74ef097 (.texte hook + bound). README updated with the corrected before/after data. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
|
Superseded par #438 (mergé, squash Ce qu'était #437Remapper le CSS des cartes Rules Tarot sur le layout 24 cartes pour réparer les couleurs cassées (#250 point 3, scope couleurs uniquement — pas le rééquilibrage éditorial). Pourquoi superseded (vérifié, pas supposé)#438 a traité tout le volet Rules de #250 en une passe : restructuration éditoriale 24→15 cartes + remap CSS complet sur le layout 15 cartes. Le diff de #438 sur
→ La prémisse de #437 (layout 24 cartes) est caduque : le layout est désormais 15 cartes. Son objectif (couleurs correctes) est livré par #438, validé visuellement dans le sign-off #140. Fermé comme superseded. |
#250 — problème 3 : couleurs cassées sur les cartes Rules (Tarot)
Scope : uniquement le problème de couleurs (#250 point 3). Les 6 autres points de #250 (rééquilibrage éditorial : §5 École coupé, pages-titre vides, orphelins Dernier beau parleur / Moulin, saturation Parlote) + les Mémos #435 sont traités dans une vague éditoriale séparée (restructuration du contenu CSV, validée par régén FR). Cette PR ne touche que le CSS.
Root cause (vérifié)
Le template Rules
Cards/Rules/Argumentum_Rules_fr.json(clécss, partagé par les 8 langues) ne mappait les couleurs que pour les indices de carte 1‑18 via les sélecteurs[class~="N"]. Or le CSVArgumentum Rules - Cards.csvcontient 24 cartes (1 ligne = 1 carte). Chaque variante perdait donc son thème — ou héritait du mauvais — au‑delà de l'indice 18 :C'est exactement le symptôme signalé : la couleur change au milieu d'une règle, et toute la Parlote coinchée sort en blanc.
Correctif
Remap des trois familles de sélecteurs vers les frontières CSV réelles et contiguës (36 occurrences) :
--color-group-bg/--color-group-box),h2/h3,:before.Résultat — chaque variante porte un seul thème cohérent sur TOUTES ses cartes :
#e7ceec#8605aa#fff3e6#ff6600#e6f2ff#0066cc#e6ffe6#228b22#f3e6ff#7b2d9eVérifications
1..24complet, aucun ≥ 25.csschange (clés non-css byte-identiques).git diff --stat= 1 fichier, 1 insertion / 1 suppression (zéro bruit de fins de ligne, CRLF préservé).Reste à faire
⏳ Validation visuelle via une régén Rules (lane ai-01) avant de considérer le point couleurs comme clos. PR ouverte pour revue ; pas de merge avant le sign-off visuel #140 (séquencement release).
Refs #250.