From ecea430ee2a1320633a1a563f1fad970872d8c77 Mon Sep 17 00:00:00 2001 From: william Date: Mon, 21 Sep 2026 11:57:49 +0200 Subject: [PATCH] =?UTF-8?q?Terminologie=20coherente=20dans=20le=20graphe?= =?UTF-8?q?=20du=20Scenario=20:=20Situation,=20pas=20N=C5=93ud?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Retour utilisateur : "il y a situation => choix => le choix devient la situation => avec des choix ... il faut bien choisir les termes". Le vocabulaire technique de graphe ("Nœud N", "Départ") ne correspond pas au modele mental du createur : chaque point du graphe EST une situation (initiale, ou atteinte via un choix precedent), qui a ses propres choix. Renomme dans toute l'UI (labels des cartes, bouton d'ajout, indices de la modale de connexion, etiquette de destination, etat vide de l'inspecteur, texte par defaut d'une nouvelle situation) - aucun changement de la structure de donnees (x/y/id/text/choices reste identique), uniquement la terminologie affichee. Verifie via simulation DOM reelle avec le VRAI sanitize_scenario_config Python (jamais une reimplementation JS approximative) que l'ajout d'une situation et l'ajout d'un choix fonctionnent bien de bout en bout : la fonctionnalite marchait deja (la modale transparente du commit precedent explique tres probablement le "ca ne marche pas" - aucun retour visuel rendait les clics invisibles). Co-Authored-By: Claude Sonnet 5 --- static/document/js/document-editor.js | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/static/document/js/document-editor.js b/static/document/js/document-editor.js index c8f987cc..4ced6558 100644 --- a/static/document/js/document-editor.js +++ b/static/document/js/document-editor.js @@ -1881,7 +1881,7 @@ function forgeDocScenarioNewScenario() { function forgeDocScenarioNewNode(id, x, y) { return { - id, text: 'Nouveau nœud', x, y, choices: [], + id, text: 'Nouvelle situation', x, y, choices: [], }; } @@ -1903,7 +1903,7 @@ function forgeDocRenderScenarioCardHtml(scenario, sIndex) { ${forgeDocEscapeHtml(scenario.title)} -
${nodeCount} nœud${nodeCount > 1 ? 's' : ''}
+
${nodeCount} situation${nodeCount > 1 ? 's' : ''}
`; @@ -1996,7 +1996,12 @@ function forgeDocScenarioGraphNextPosition(nodes) { } function forgeDocScenarioNodeLabel(nIndex) { - return nIndex === 0 ? 'Départ' : `Nœud ${nIndex + 1}`; + // Terminologie volontairement cohérente de bout en bout (retour + // utilisateur du 21/09/2026 : "il faut bien choisir les termes") : + // Situation -> Choix -> le choix MÈNE À une nouvelle Situation (avec + // ses propres choix), jamais un vocabulaire technique de graphe + // ("nœud") qui n'a pas de sens pour le créateur du scénario. + return nIndex === 0 ? 'Situation initiale' : `Situation ${nIndex + 1}`; } function forgeDocScenarioGraphPatch(partial) { @@ -2083,11 +2088,11 @@ function forgeDocScenarioGraphUpdateHint() { const hintEl = document.getElementById('docScenarioGraphHint'); if (!hintEl) return; if (gs.connecting) { - hintEl.textContent = 'Cliquez sur le nœud cible pour relier ce choix, ou appuyez sur Échap pour annuler.'; + hintEl.textContent = 'Cliquez sur la situation cible pour relier ce choix, ou appuyez sur Échap pour annuler.'; hintEl.classList.add('is-connecting'); gs.canvasEl.classList.add('is-connecting'); } else { - hintEl.textContent = 'Glissez un nœud pour le déplacer. Cliquez un nœud pour modifier son texte et ses choix.'; + hintEl.textContent = 'Glissez une situation pour la déplacer. Cliquez une situation pour modifier son texte et ses choix.'; hintEl.classList.remove('is-connecting'); gs.canvasEl.classList.remove('is-connecting'); } @@ -2217,7 +2222,7 @@ function forgeDocScenarioGraphRenderInspector() { const nIndex = gs.selectedNodeIndex; const node = gs.scenario.nodes[nIndex]; if (!node) { - inspector.innerHTML = '
Sélectionnez un nœud sur le graphe.
'; + inspector.innerHTML = '
Sélectionnez une situation sur le graphe.
'; return; } const isRoot = nIndex === 0; @@ -2237,7 +2242,7 @@ function forgeDocScenarioGraphRenderInspector() {
${targetIndex === -1 ? '— Fin de branche —' : `→ ${forgeDocEscapeHtml(forgeDocScenarioNodeLabel(targetIndex))}`} - + ${targetIndex === -1 ? '' : ``}
@@ -2247,10 +2252,10 @@ function forgeDocScenarioGraphRenderInspector() { inspector.innerHTML = `
${forgeDocScenarioNodeLabel(nIndex)} - ${isRoot ? '' : ''} + ${isRoot ? '' : ''}
- +
Choix
${choicesHtml || '
Aucun choix — fin de cette branche.
'}
@@ -2356,7 +2361,7 @@ function forgeDocRenderScenarioTreeModal() { placeholder="Nom du scénario">
- +