Supprime le type d'écran "document" et recentre le produit sur le jeu 2D
Build and deploy / test-python (push) Successful in 9m41s
Build and deploy / test-js (push) Successful in 1m0s
Build and deploy / build-and-push (push) Skipped
Build and deploy / deploy (push) Skipped

Le document de cadrage produit cible des formateurs non techniques créant
des serious games/quiz gamifiés — l'éditeur générique "document" (blocs de
logique en nœuds, timeline d'animation, définitions d'objets/relations,
templates réutilisables) est une complexité hors cible que l'effort
d'ingénierie récent avait déjà abandonnée au profit du jeu_2d.

- Onboarding : ne garde que le parcours "RPG" (jeu_2d), retire
  Quiz/Embranchement/Créer mon jeu de A à Z (tous document-only)
- Suppression en bloc des modules exclusifs au document : routes/elements,
  routes/element_types, routes/objects, routes/legacy_actions,
  screens/elements, screens/element_types, screens/widgets,
  screens/legacy_actions, le rendu render_element_html.py et son cluster,
  templates/screen_edit.html, templates/game_dashboard.html,
  flow-editor.js/tabs-and-blocks.js/animation-timeline.js
- Dashboard toujours simplifié (un seul mode possible désormais)
- Tests document-only supprimés, tests de logique partagée (flow,
  événements personnalisés, animations) retargetés sur des écrans jeu_2d
- Aucune régression jeu_2d : 299 tests passent

Carte d'onboarding retravaillée : argumentaire RH non technique (liste à
coche, badge "Compatible LMS"), taille et interaction de retournement
ajustées.
This commit is contained in:
william
2026-09-04 20:56:32 +02:00
parent 00f7191a8b
commit 50835a18e2
221 changed files with 1239 additions and 12245 deletions
+11 -31
View File
@@ -10,7 +10,7 @@ import json
import os
import re
from conftest import play_js_bundle, screen_edit_js_bundle
from conftest import play_js_bundle
import screens
@@ -24,9 +24,8 @@ def _create_screen(client, slug, name="Accueil"):
return int(re.search(r"/screens/(\d+)/edit", resp.headers["Location"]).group(1))
def _add_element(client, slug, screen_id, widget="image"):
resp = client.post(f"/game/{slug}/screens/{screen_id}/elements/add", data={"widget": widget}, follow_redirects=False)
return int(re.search(r"selected=(\d+)", resp.headers["Location"]).group(1))
def _add_element(client, slug, screen_id, forge_character=None):
return screens.add_scene_object(slug, screen_id, forge_character=forge_character)
def _add_flow_node(client, slug, screen_id, **fields):
@@ -45,11 +44,11 @@ def test_sprite_animation_action_node_persists(client, game):
data_value = json.dumps({"frames": ["/static/characters/zombie/walk0.png", "/static/characters/zombie/walk1.png"], "fps": 8, "loop": True})
node_id = _add_flow_node(
client, game, screen_id, node_type="action", action_type="jouer_animation_sprite",
target_element_id=el_id, data_value=data_value,
target_object_id=el_id, data_value=data_value,
)
node = screens.get_flow_node(game, node_id)
assert node["action_type"] == "jouer_animation_sprite"
assert node["target_element_id"] == el_id
assert node["target_object_id"] == el_id
assert json.loads(node["data_value"])["fps"] == 8
@@ -57,12 +56,13 @@ def test_orientation_action_node_persists(client, game):
screen_id = _create_screen(client, game)
el_id = _add_element(client, game, screen_id)
node_id = _add_flow_node(
client, game, screen_id, node_type="action", action_type="modifier_element",
target_element_id=el_id, element_property="orientation", element_value="gauche",
client, game, screen_id, node_type="action", action_type="modifier_objet_scene",
target_object_id=el_id, element_property="orientation", element_value="gauche",
)
node = screens.get_flow_node(game, node_id)
assert node["element_property"] == "orientation"
assert node["element_value"] == "gauche"
assert node["target_object_id"] == el_id
def test_sprite_timeline_clip_persists(client, game):
@@ -116,40 +116,20 @@ def test_swapping_forge_character_updates_already_configured_flow_action(client,
depuis gameData.personnage_animations, reconstruit à chaque
chargement de full_game_payload() à partir du personnage ACTUEL."""
screen_id = _create_screen(client, game)
resp = client.post(
f"/game/{game}/screens/{screen_id}/elements/add",
data={"widget": "personnage", "forge_character": "male-adventurer"},
follow_redirects=False,
)
el_id = int(re.search(r"selected=(\d+)", resp.headers["Location"]).group(1))
el_id = screens.add_scene_object(game, screen_id, forge_character="male-adventurer")
_add_flow_node(
client, game, screen_id, node_type="action", action_type="jouer_animation_sprite",
target_element_id=el_id, data_value=json.dumps({"animation": "walk", "fps": 8, "loop": True}),
target_object_id=el_id, data_value=json.dumps({"animation": "walk", "fps": 8, "loop": True}),
)
payload = screens.full_game_payload(game)
assert payload["personnage_animations"][str(el_id)]["walk"][0].startswith("/static/characters/male-adventurer/")
client.post(
f"/game/{game}/elements/{el_id}/personnage",
f"/game/{game}/scene-objects/{el_id}/personnage",
data=json.dumps({"source": "forge", "forge_character": "zombie"}),
content_type="application/json",
)
payload = screens.full_game_payload(game)
assert payload["personnage_animations"][str(el_id)]["walk"][0].startswith("/static/characters/zombie/")
def test_screen_edit_exposes_sprite_animation_editors(client, game):
screen_id = _create_screen(client, game)
html = client.get(f"/game/{game}/screens/{screen_id}/edit").get_data(as_text=True)
assert "nf-action-sprite-fields" in html
assert "nf-action-sprite-target-element" in html
assert "anim-clip-sprite-fields" in html
js = screen_edit_js_bundle()
assert "jouer_animation_sprite" in js
# Phase 8 — refonte visuelle : le sélecteur d'animation est un vrai
# sélecteur à miniatures scopé au personnage ciblé, plus un menu
# déroulant "Personnage Forge" global (voir test_personnage_widget.py).
assert "onSpriteTargetElementChange" in js
assert "populateAnimClipSpriteGrid" in js