From d4b629bfae5d91d2c1e2fd40dc1cce94f26b4f5a Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Thu, 17 Sep 2026 22:48:56 +0200 Subject: [PATCH] Fix Roll20 worker compatibility and combat targeting --- AGENTS.md | 6 +++--- README.md | 9 +++++---- TASKS.md | 44 +++++++++++++++++++++++++++++-------------- src/ravenous.css | 1 - src/ravenous.html | 16 ++++++++-------- tests/test_build.py | 19 ++++++++++++------- tests/test_worker.mjs | 16 ++++++++++++---- tools/build.py | 16 +++++++++++++--- 8 files changed, 83 insertions(+), 44 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index b517dd2..7188374 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -64,7 +64,7 @@ the default is selected by `data/config/build.yaml`. For a Roll20 test, copy the generated HTML, CSS, and translation JSON into a custom sheet or sheet sandbox. Use current CSE mode with Legacy Sanitization disabled. The editor preview is insufficient for sheet workers and repeating -sections. Test with two characters and a selected defender token when checking +sections. Test with two characters and a targeted defender token when checking the attack card's **Défendre** and **Subir** actions. ## How the sheet works @@ -78,7 +78,7 @@ the attack card's **Défendre** and **Subir** actions. persistent values are Roll20 attributes. Keep attribute names and generated option values stable when possible because existing characters store them. - Skill and attack rolls use the `ravenous` roll template and `startRoll` / - `finishRoll`. Attack follow-ups use the selected defender token. The attack + `finishRoll`. Attack follow-ups prompt for a defender token. The attack result cache (`attackRolls`) lives only in worker memory, so test follow-up behavior after reopening a sheet as well as immediately after rolling. - **Subir** displays calculated DMG and AB after checked resistances and @@ -108,7 +108,7 @@ the attack card's **Défendre** and **Subir** actions. Roll20 interaction. 4. For interactive changes, manually exercise the affected flow in Roll20: open and reopen the sheet, change inputs, add and reorder repeating rows, - roll from chat, and check results on a selected defender token. Record what + roll from chat, and check results on a targeted defender token. Record what was actually tested and what could not be tested. ## Known gaps and priorities diff --git a/README.md b/README.md index 3d2f07b..4f48c76 100644 --- a/README.md +++ b/README.md @@ -218,19 +218,20 @@ prévisualisation intégrée de Roll20 ne simule pas complètement les sheet workers ni les sections répétables : validez les imports et les jets dans le bac à sable de feuille ou dans une partie de test. -Pour utiliser **Défendre** depuis la carte d'une attaque, sélectionnez d'abord -le token du défenseur. La macro utilise alors sa compétence d'Esquive ou de +Pour utiliser **Défendre** ou **Subir** depuis la carte d'une attaque, cliquez +le token du défenseur lorsque Roll20 affiche le ciblage « Défenseur ». +La macro utilise alors sa compétence d'Esquive ou de Parade et son modificateur temporaire, sans ajouter la caractéristique associée. Le bouton **Jets secrets** dans l'en-tête envoie les jets du personnage uniquement au maître de jeu. Les actions Défendre et Subir suivent le réglage -du token défenseur sélectionné. +du token défenseur ciblé. Avant d'utiliser **Subir** depuis une attaque, cochez dans l'onglet Santé les résistances applicables et, dans l'onglet Combat, les protections couvrant la localisation. Les résistances cochées se cumulent et retirent chacune deux DMG par point. Une protection cochée ne compte que si son intégrité est supérieure à zéro ; le calcul retire alors sa Protection ainsi que la Force finale du -défenseur sélectionné. +défenseur ciblé. Le menu Protection de **Subir** permet d'utiliser les protections cochées ou la protection d'une localisation fixe/personnalisée. Pour l'AB, les résistances diff --git a/TASKS.md b/TASKS.md index 91caf87..e234e0b 100644 --- a/TASKS.md +++ b/TASKS.md @@ -35,37 +35,53 @@ parser, browser, or chat. monster and check each mapped row and any worker recalculations. **2026-09-17:** user reports this workflow completed successfully in Roll20; `local_exports/character.json` is the local saved export and is excluded from Git. -- [ ] Load `build/ravenous.html`, `build/ravenous.css`, and +- [x] Load `build/ravenous.html`, `build/ravenous.css`, and `build/translation.json` into a Custom Sheet Sandbox with Legacy Sanitization disabled. Record the date, browser, and any console or worker errors. **2026-09-17 attempt:** user supplied a Firefox console log (browser inferred from Firefox-specific messages). It shows `Starting up WEB WORKER`, CSP warnings for inline scripts/event handlers, Sentry CDN CORS/integrity errors, and `Uncaught SyntaxError: missing ] after element list` in `vtt.bundle`. - The log does not confirm the Legacy Sanitization setting or whether the sheet - itself loaded and its workers ran; the syntax error needs a reproduction. + **Follow-up, 2026-09-17:** user confirms all Legacy Sanitization is disabled. + A new Firefox log reports `SyntaxError: "" string literal contains an unescaped + line break` from `sheetsandbox.bundle.js` after sheet worker startup. The + generated worker parses and passes local Node tests. Generated data was split + into shorter source lines (the longest is now under 3.5 KB instead of 128 KB) + as a compatibility attempt. **Final retest, 2026-09-17:** user reports the + sheet now works with Legacy Sanitization disabled. The supplied console log + shows sheet worker startup and no worker syntax error; only VTT startup, + a CSP frame notice, and a layout warning remain. - [x] Load one alternate theme (for example `build-steel/`) and inspect the sheet and chat cards for legibility and contrast in Roll20. **2026-09-17:** user reports that the themes work perfectly. - [ ] Create an attacker and defender, plus a token representing the defender. Open both sheets; switch every tab; add, edit, delete, and reorder a repeating - row. Reopen each sheet and confirm values persist. -- [ ] Change base and temporary characteristics, stage, a skill rank, and a + row. Reopen each sheet and confirm values persist. **2026-09-17:** user reports + values appear to persist; repeating row reorder still needs explicit confirmation. +- [x] Change base and temporary characteristics, stage, a skill rank, and a custom skill. Confirm the displayed totals update and that derived stats use - the permanent characteristic as intended. -- [ ] Add one technique, attempt to add it again, and activate its chat card. - Check that text is readable and free of raw Typst markup. -- [ ] Select an origin, add one stage of powers, try adding it again, then add + the permanent characteristic as intended. **2026-09-17:** user reports + calculations done in Roll20. +- [x] Add one technique, attempt to add it again, and activate its chat card. + Check that text is readable and free of raw Typst markup. **2026-09-17:** + user reports techniques work in Roll20. +- [x] Select an origin, add one stage of powers, try adding it again, then add another stage and a custom power. Change origin and reopen the sheet. Confirm existing rows persist and selection alone adds no rows. + **2026-09-17:** user reports powers work in Roll20. - [ ] Roll a skill at the threshold boundary and on a natural 1. Check chat - outcome and margin. Try public and secret rolls. + outcome and margin. Try public and secret rolls. **2026-09-17:** user reports + rolls generally work but CF was marked one above the die maximum. The worker + now marks the maximum face as critical failure; retest in Roll20. - [ ] Roll an attack, use its **Défendre** chat button with the defender token - selected, then use **Dégâts** and **Subir**. Test zero successes, more successes + targeted when prompted, then use **Dégâts** and **Subir**. Test zero successes, more successes than RMax, multiple checked resistances, one active protection, depleted integrity, and a fixed location. Confirm DMG and AB against hand calculations. + **2026-09-17:** user reports repeated missing-selected-token warnings when + clicking without a token. The worker now requests one named target; retest. - [ ] Repeat an attack follow-up after closing and reopening the sheet. Record whether the attack context survives; the current worker stores it in memory. + **2026-09-17:** user believes it works; verify damage values after reopening. ## After smoke test @@ -76,8 +92,8 @@ parser, browser, or chat. deviation before changing mechanics. - [x] Decide whether HP should update automatically. **2026-09-17:** user decided to keep HP updates manual for now. -- [ ] Decide whether armor integrity, technique costs, and temporary effects - should update automatically. Record each decision before adding automation - or UI controls. +- [x] Decide whether armor integrity, technique costs, and temporary effects + should update automatically. **2026-09-17:** user wants all these updates + manual for now. - [ ] Add local worker tests to Jenkins only after confirming Node is installed on its build agent, or provision a pinned Node runtime there. diff --git a/src/ravenous.css b/src/ravenous.css index 0d8a42e..a1b70dd 100644 --- a/src/ravenous.css +++ b/src/ravenous.css @@ -17,7 +17,6 @@ .identity-grid { display:grid; grid-template-columns:2fr 2fr 1fr; gap:8px; margin-top:6px; } .identity-grid label,.ravenous-sheet label { color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.05em; } .motto { color:var(--dark-gold); font-style:italic; text-align:center; } -.motto>span { display:block; } .secret-rolls { display:flex; justify-content:center; align-items:center; gap:6px; margin-top:7px; color:var(--blood)!important; font-style:normal; } .secret-rolls input { margin:0; } .tabs { display:flex; margin:14px 0; border-bottom:2px solid var(--gold); } diff --git a/src/ravenous.html b/src/ravenous.html index b81348c..4b565e9 100644 --- a/src/ravenous.html +++ b/src/ravenous.html @@ -11,7 +11,7 @@ -
La chasse laisse des marques.
+