Mentor d'écriture (M1-M3) : coach dans les champs, relecture d'éditeur, méthode guidée « Donjon en 5 salles »
Qualité & Sécurité / MegaLinter (PMD · Ruff · Bandit · gitleaks · hadolint) (push) Successful in 13m48s
Qualité & Sécurité / Web (ESLint · angular-eslint + sonarjs) (push) Successful in 13m16s
Qualité & Sécurité / Trivy (CVE dépendances Maven / pip / npm) (push) Failing after 3m3s
Build & Push Images / build (core) (push) Successful in 4m50s
Build & Push Images / build (web) (push) Successful in 3m26s
Build & Push Images / build-switcher (push) Successful in 26s
Build & Push Images / build (brain) (push) Canceled after 1m5s

- M1 coach : bouton ampoule sur 17 champs narratifs (scène, chapitre, arc),
  panneau de conseils (à quoi ça sert, questions, exemple, piège classique).
  Contenu statique i18n fr/en, sans IA ; ampoule aussi dans l'en-tête des
  sections repliables (input coachTopic d'expandable-section).
- M2 relecture d'éditeur : WritingReviewService + GET
  /api/campaigns/{id}/writing-review, 10 règles déterministes WRITE-001 à 010
  (couloir, faux choix, révélation à chemin unique, rythme monotone, enjeux
  absents, narration trop longue ou qui décide à la place des PJ, combat sans
  but, fin unique, scènes non typées). Le back renvoie ruleId + params, les
  textes fr/en sont dans l'i18n. Panneau sur le hub, encart dans les éditeurs,
  liens « Voir » avec ?focus= (nouveaux focus : narration, choices, stakes).
- M3 méthode guidée : POST /api/campaigns/{id}/guided-skeleton (arc existant
  ou nouveau, chapitre, scènes typées, chaînage optionnel, transactionnel)
  + assistant pas à pas générique /campaigns/:id/guided/:method, première
  méthode « Donjon en 5 salles ». Entrées sur le hub de campagne.
- Garde-fous vitest : complétude des textes fr/en du coach, de la relecture
  (règles lues dans le Java) et des méthodes guidées.

Vérifié : core clean verify (1182 tests), web build + 299 tests vitest, lint
sans erreur, parcours testés dans l'appli (back Postgres de dev).
À redéployer : core (2 endpoints, aucune migration) + web.
This commit is contained in:
2026-10-17 11:58:26 +02:00
parent ad3ea0e9e6
commit c2f162d823
59 changed files with 5533 additions and 40 deletions
@@ -30,6 +30,9 @@
est dans des sections repliables avec pastille « rempli ». -->
<p class="optional-hint">{{ 'sceneEdit.optionalHint' | translate }}</p>
<!-- Mentor d'écriture (M2) : conseils de relecture qui concernent cette entité. -->
<app-writing-review-hints [campaignId]="campaignId" entityType="SCENE" [entityId]="sceneId"></app-writing-review-hints>
<!-- Co-création (Pilier A) : le co-MJ propose, l'utilisateur valide champ par champ.
Les champs retenus remplissent le formulaire ; rien n'est enregistré avant la sauvegarde. -->
<app-entity-assist-panel
@@ -49,7 +52,10 @@
</div>
<div class="field">
<label for="scene-edit-description">{{ 'sceneEdit.descriptionLabel' | translate }}</label>
<div class="field-label-row">
<label for="scene-edit-description">{{ 'sceneEdit.descriptionLabel' | translate }}</label>
<app-writing-coach-trigger topic="scene.description"></app-writing-coach-trigger>
</div>
<textarea
id="scene-edit-description"
formControlName="description"
@@ -65,7 +71,10 @@
<!-- Type narratif du nœud (Niveau 2 — graphe de nœuds typés) -->
<div class="field">
<label for="scene-edit-type">{{ 'sceneEdit.nodeTypeLabel' | translate }}</label>
<div class="field-label-row">
<label for="scene-edit-type">{{ 'sceneEdit.nodeTypeLabel' | translate }}</label>
<app-writing-coach-trigger topic="scene.nodeType"></app-writing-coach-trigger>
</div>
<select id="scene-edit-type" formControlName="type">
@for (opt of sceneTypeOptions; track opt) {
<option [value]="opt">{{ 'sceneType.' + opt | translate }}</option>
@@ -181,7 +190,10 @@
<app-expandable-section [title]="'sceneEdit.contextSectionTitle' | translate" icon="📍" [initiallyOpen]="true" [filled]="contextFilled">
<div class="field-row">
<div class="field">
<label for="scene-edit-location">{{ 'sceneEdit.locationLabel' | translate }}</label>
<div class="field-label-row">
<label for="scene-edit-location">{{ 'sceneEdit.locationLabel' | translate }}</label>
<app-writing-coach-trigger topic="scene.setting"></app-writing-coach-trigger>
</div>
<input id="scene-edit-location" type="text" formControlName="location" [placeholder]="'sceneEdit.locationPlaceholder' | translate" />
</div>
<div class="field">
@@ -190,7 +202,10 @@
</div>
</div>
<div class="field">
<label for="scene-edit-atmosphere">{{ 'sceneEdit.atmosphereLabel' | translate }}</label>
<div class="field-label-row">
<label for="scene-edit-atmosphere">{{ 'sceneEdit.atmosphereLabel' | translate }}</label>
<app-writing-coach-trigger topic="scene.atmosphere"></app-writing-coach-trigger>
</div>
<textarea
id="scene-edit-atmosphere"
formControlName="atmosphere"
@@ -201,7 +216,7 @@
</app-expandable-section>
<!-- Section : Narration pour les joueurs -->
<app-expandable-section [title]="'sceneEdit.narrationSectionTitle' | translate" icon="📖" [filled]="narrationFilled">
<app-expandable-section [title]="'sceneEdit.narrationSectionTitle' | translate" coachTopic="scene.narration" icon="📖" [initiallyOpen]="focusSection === 'narration'" [filled]="narrationFilled">
<div class="field">
<textarea
formControlName="playerNarration"
@@ -213,7 +228,7 @@
</app-expandable-section>
<!-- Section : Notes et secrets du MJ (privé) -->
<app-expandable-section [title]="'sceneEdit.gmNotesSectionTitle' | translate" icon="🔒" variant="private" [filled]="gmNotesFilled">
<app-expandable-section [title]="'sceneEdit.gmNotesSectionTitle' | translate" coachTopic="scene.gmNotes" icon="🔒" variant="private" [filled]="gmNotesFilled">
<div class="field">
<textarea
formControlName="gmSecretNotes"
@@ -225,7 +240,7 @@
</app-expandable-section>
<!-- Section : Choix et conséquences -->
<app-expandable-section [title]="'sceneEdit.choicesSectionTitle' | translate" icon="🔀" [filled]="choicesFilled">
<app-expandable-section [title]="'sceneEdit.choicesSectionTitle' | translate" coachTopic="scene.choices" icon="🔀" [initiallyOpen]="focusSection === 'choices'" [filled]="choicesFilled">
<div class="field">
<textarea
formControlName="choicesConsequences"
@@ -236,7 +251,7 @@
</app-expandable-section>
<!-- Section : Branches narratives (graphe intra-chapitre) -->
<app-expandable-section [title]="'sceneEdit.branchesSectionTitle' | translate" icon="🌿" [initiallyOpen]="focusSection === 'branches'" [filled]="branchesFilled">
<app-expandable-section [title]="'sceneEdit.branchesSectionTitle' | translate" coachTopic="scene.branches" icon="🌿" [initiallyOpen]="focusSection === 'branches'" [filled]="branchesFilled">
@if (siblingScenes.length === 0) {
<div class="branches-hint">
<small class="field-hint">
@@ -307,7 +322,7 @@
</app-expandable-section>
<!-- Section : Combat ou rencontre -->
<app-expandable-section [title]="'sceneEdit.combatSectionTitle' | translate" icon="⚔️" [initiallyOpen]="focusSection === 'combat'" [filled]="combatFilled">
<app-expandable-section [title]="'sceneEdit.combatSectionTitle' | translate" coachTopic="scene.combat" icon="⚔️" [initiallyOpen]="focusSection === 'combat'" [filled]="combatFilled">
<div class="field">
<label for="scene-edit-combat-difficulty">{{ 'sceneEdit.combatDifficultyLabel' | translate }}</label>
<input id="scene-edit-combat-difficulty" type="text" formControlName="combatDifficulty" [placeholder]="'sceneEdit.combatDifficultyPlaceholder' | translate" />
@@ -31,6 +31,8 @@ import { FieldProposal } from '../../../services/entity-assist.model';
import { FileDropDirective } from '../../../shared/file-drop.directive';
import { CAMPAIGN_ICON_OPTIONS } from '../../campaign-icons';
import { ConfirmDialogService } from '../../../shared/confirm-dialog/confirm-dialog.service';
import { WritingCoachTriggerComponent } from '../../../shared/writing-coach/writing-coach-trigger.component';
import { WritingReviewHintsComponent } from '../../../shared/writing-review/writing-review-hints.component';
/**
* État d'édition d'UNE battlemap de la scène (une carte par variante : Jour, Nuit,
@@ -63,7 +65,7 @@ interface BattlemapEdit {
*/
@Component({
selector: 'app-scene-edit',
imports: [ReactiveFormsModule, LucideAngularModule, ExpandableSectionComponent, LoreLinkPickerComponent, EnemyLinkPickerComponent, AiChatDrawerComponent, ImageGalleryComponent, IconPickerComponent, RoomsEditorComponent, EntityAssistPanelComponent, FileDropDirective, TranslatePipe],
imports: [ReactiveFormsModule, LucideAngularModule, ExpandableSectionComponent, LoreLinkPickerComponent, EnemyLinkPickerComponent, AiChatDrawerComponent, ImageGalleryComponent, IconPickerComponent, RoomsEditorComponent, EntityAssistPanelComponent, FileDropDirective, TranslatePipe, WritingCoachTriggerComponent, WritingReviewHintsComponent],
templateUrl: './scene-edit.component.html',
styleUrls: ['./scene-edit.component.scss']
})
@@ -95,7 +97,7 @@ export class SceneEditComponent implements OnInit {
scene: Scene | null = null;
/**
* Section à déplier d'office (query param `?focus=combat|branches|rooms`) — posé par
* Section à déplier d'office (query param `?focus=combat|branches|rooms|narration|choices`) — posé par
* le bouton « Corriger » du guidage pour atterrir directement sur l'outil fautif.
*/
focusSection: string | null = null;