refactor : IA éditeur — un seul bouton analyse+réécriture combinées

Un seul appel API retourne l'analyse critique ET la proposition d'article
via le séparateur ===CRITIQUE===/===REWRITE===. Le panneau affiche les deux
sections avec un bouton « Appliquer la proposition ».

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-16 13:06:23 +02:00
parent e03594c22e
commit c979238b0c
4 changed files with 134 additions and 71 deletions
+1 -1
View File
@@ -1698,7 +1698,7 @@ switch ($action) {
$_aiAction = trim($_POST['action'] ?? '');
$_aiTitle = trim($_POST['title'] ?? '');
$_aiContent = str_replace("\r\n", "\n", trim($_POST['content'] ?? ''));
if (!in_array($_aiAction, ['critique', 'rewrite'], true) || $_aiContent === '') {
if (!in_array($_aiAction, ['critique', 'rewrite', 'analyze'], true) || $_aiContent === '') {
echo json_encode(['ok' => false, 'error' => 'Paramètres invalides']);
exit;
}