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.
99 lines
3.5 KiB
TypeScript
99 lines
3.5 KiB
TypeScript
import { Component, Input, OnChanges, SimpleChanges, inject } from '@angular/core';
|
|
import { TranslatePipe } from '@ngx-translate/core';
|
|
import { LucideAngularModule, ChevronDown, ChevronRight, Lightbulb } from 'lucide-angular';
|
|
|
|
import { ReadinessEntityType } from '../../services/readiness.model';
|
|
import { WritingRemark } from '../../services/writing-review.model';
|
|
import { WritingReviewService } from '../../services/writing-review.service';
|
|
import { WritingRemarkCardComponent } from './writing-remark-card.component';
|
|
|
|
/**
|
|
* Encart « Conseils de relecture » d'un éditeur (scène / chapitre / arc) : les remarques
|
|
* de la relecture d'éditeur qui concernent l'entité ouverte. Invisible s'il n'y en a pas.
|
|
*
|
|
* La relecture porte sur la version ENREGISTRÉE : après une sauvegarde, l'encart se met
|
|
* à jour au prochain chargement de l'éditeur.
|
|
*/
|
|
@Component({
|
|
selector: 'app-writing-review-hints',
|
|
imports: [TranslatePipe, LucideAngularModule, WritingRemarkCardComponent],
|
|
template: `
|
|
@if (remarks.length > 0) {
|
|
<section class="hints">
|
|
<button type="button" class="hints-header" (click)="open = !open" [attr.aria-expanded]="open">
|
|
<lucide-icon [img]="open ? ChevronDown : ChevronRight" [size]="15"></lucide-icon>
|
|
<lucide-icon [img]="Lightbulb" [size]="15" class="hints-icon"></lucide-icon>
|
|
<span>{{ 'writingReview.hintsTitle' | translate: { n: remarks.length } }}</span>
|
|
</button>
|
|
@if (open) {
|
|
<div class="hints-list">
|
|
@for (remark of remarks; track remark.ruleId) {
|
|
<app-writing-remark-card [remark]="remark" [campaignId]="campaignId" [showLink]="false">
|
|
</app-writing-remark-card>
|
|
}
|
|
</div>
|
|
}
|
|
</section>
|
|
}
|
|
`,
|
|
styles: [`
|
|
.hints {
|
|
background: rgba(251, 191, 36, 0.04);
|
|
border: 1px solid rgba(251, 191, 36, 0.25);
|
|
border-radius: 8px;
|
|
}
|
|
.hints-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
width: 100%;
|
|
padding: 0.7rem 0.95rem;
|
|
background: transparent;
|
|
border: none;
|
|
border-radius: 8px;
|
|
color: #fde68a;
|
|
font-size: 0.88rem;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
text-align: left;
|
|
}
|
|
.hints-header:hover { background: rgba(251, 191, 36, 0.06); }
|
|
.hints-header:focus-visible { outline: 2px solid #6c63ff; outline-offset: -2px; }
|
|
.hints-icon { color: #fbbf24; }
|
|
.hints-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.5rem;
|
|
padding: 0 0.95rem 0.95rem;
|
|
}
|
|
`]
|
|
})
|
|
export class WritingReviewHintsComponent implements OnChanges {
|
|
readonly ChevronDown = ChevronDown;
|
|
readonly ChevronRight = ChevronRight;
|
|
readonly Lightbulb = Lightbulb;
|
|
|
|
private readonly reviewService = inject(WritingReviewService);
|
|
|
|
@Input({ required: true }) campaignId = '';
|
|
@Input({ required: true }) entityType: ReadinessEntityType = 'SCENE';
|
|
@Input({ required: true }) entityId = '';
|
|
|
|
remarks: WritingRemark[] = [];
|
|
open = true;
|
|
|
|
ngOnChanges(changes: SimpleChanges): void {
|
|
if (!this.campaignId || !this.entityId) return;
|
|
if (changes['campaignId'] || changes['entityId'] || changes['entityType']) {
|
|
this.remarks = [];
|
|
const { entityType, entityId } = this;
|
|
this.reviewService.getReview(this.campaignId).subscribe({
|
|
next: report => {
|
|
this.remarks = report.remarks.filter(r => r.entityType === entityType && r.entityId === entityId);
|
|
},
|
|
error: () => { this.remarks = []; }
|
|
});
|
|
}
|
|
}
|
|
}
|