## Enhanced Mode v2 - Smart Section-Based Editing (routes/ai.js)
### Server-Side Section Replacement Architecture
- Add cleanMarkdownFromTitle() to normalize section titles for matching
- Add extractHeaders() to list all document sections for debugging
- Add replaceSection() to surgically replace only modified sections
- AI now returns ONLY the modified section, not entire document
- Server automatically replaces section in original document
- Automatic header level correction if AI changes ## to ### or vice versa
- Section boundary detection based on header hierarchy
### Enhanced Prompt and Response Format
- Modified prompt to explicitly request ONLY modified section
- New closing format: document (mandatory)
- Added fallback regex for old format with warnings
- Explicit rules: keep exact header level (## stays ##)
- Clear section boundary definition in prompt
- Examples with proper formatting guidelines
### Comprehensive Logging System
- Log all API requests with method, endpoint, payload size
- Log AI responses with length and preview
- Log section matching and replacement operations
- Log header level corrections
- Log section not found errors with available sections list
- Track modified sections across iterations
## AI Button Mutex and Preview Mode Controls (assets/js/app.js)
### AI Button Mutex (Prevent API Overload)
- Add disableAIButtons() to disable all AI buttons during operations
- Add enableAIButtons() to re-enable after completion or error
- Disable all AI buttons at start of any AI operation
- Re-enable in finally blocks to ensure cleanup even on errors
- Re-enable on validation failures (e.g., no text selected for rephrase)
- Re-enable when user clicks Apply/Cancel in rephrase mode
### Preview Mode Button Restrictions
- Disable Preview button during Enhanced Mode operation
- Disable all AI buttons in preview mode (rephrase, inconsistencies, duplications, advice, liberty)
- Disable Save and Load buttons in preview mode
- Re-enable all buttons when returning to edit mode
- Proper cleanup with finally blocks
## Mermaid Auto-Fix System - Complete Removal
### Removed from assets/js/app.js
- Remove mermaidFixAttempts Set from constructor
- Remove setupMessageListener() and postMessage handler
- Remove fixMermaidDiagramBackground() function
- Simplify Mermaid error display to inline messages only
- Remove hash-based tracking mechanism
### Removed from routes/index.js (Present Mode)
- Remove entire auto-fix fetch and retry logic
- Remove status div updates and fix notifications
- Remove postMessage to parent window
- Simplify to display styled error message only
### Current Behavior
- Preview mode: Shows inline error with simple message
- Present mode: Shows styled error box with instructions
- No automatic fix attempts - manual correction only
## Additional Improvements
- Clean markdown formatting (##, **, etc.) from section titles in UI badges
- Proper section title matching ignoring markdown syntax
- Enhanced error handling with detailed logging
- Better user feedback during Enhanced Mode iterations
This release improves Enhanced Mode reliability, prevents API overload through button mutex,
simplifies Mermaid error handling, and adds comprehensive logging for debugging.
- TOC: Ajout indentation par niveau et correction des puces sur h6+
- TOC: Correction navigation avec scroll précis (TreeWalker)
- TOC: Séparation scroll page/TOC avec position sticky
- Preview: Correction bug ** apparaissant au retour en mode édition
- Enhanced Mode: Nouveau format de réponse (blocs comment/document)
- API: Ajout timeouts 120s et agent HTTPS pour éviter erreurs réseau
- CSS: Ajout overflow-y sur sections pour scroll indépendant
Fichiers modifiés :
- assets/js/app.js (TOC, navigation, preview)
- assets/css/style.css (scroll, sticky positioning)
- routes/ai.js (timeouts, format réponse)
Major Changes:
- Remove all emojis from UI, code, and documentation for professional appearance
- Translate entire codebase from French to English (code, comments, strings, UI)
- Simplify template system: 18 templates → single default template
- Rename "Mode Liberté Total" to "Enhanced Mode" throughout
- Add comprehensive English README with installation and usage guides
- Add MIT License (open source, no attribution required)
- Update package.json with proper metadata and keywords
Breaking Changes:
- Template API endpoint changed from /api/templates/:domain/:level to /api/templates/default
- All French UI text and notifications replaced with English
- Template directory structure simplified
Technical Improvements:
- Cleaner, more maintainable codebase
- Improved internationalization
- Better developer experience with English documentation
- Professional appearance suitable for production use
## ✨ Mode Liberté Total Révolutionnaire
- Contrôle de précision : 30% (créatif) à 90% (précis)
- Streaming temps réel avec Server-Sent Events
- Interface progressive avec barre de progression
- Temperature dynamique selon la précision
- Enrichissement complet du document à chaque itération
## 📖 Documentation technique professionnelle
- Architecture détaillée avec diagrammes Mermaid
- Structure de projet complète et annotée
- Flux de données documentés (streaming, journaux)
- Stack technique avec versions et utilités
- Guide d'utilisation mis à jour
- 18 templates organisés par domaines
## 🎨 Interface améliorée
- Sélecteurs d'itérations (1-10) et précision (30-90%)
- Affichage temps réel des explications IA
- Feedback visuel avec progression et statut
- Mode streaming non-bloquant
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Scroll précis vers sections table des matières avec surbrillance
- Historique Ctrl+Z/Y fonctionnel pour toutes les actions IA
- Mode édition automatique lors du chargement de fichiers
- Support CSS GitHub Preview pour visualisation Markdown
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Intégration Marked.js pour rendu Markdown 100% compatible GitHub
- Support complet des diagrammes Mermaid (flux, séquence, classe, etc.)
- Styles CSS identiques à GitHub (polices, espacements, couleurs)
- Méthode togglePreview() asynchrone pour gestion optimale
- Détection automatique des blocs ```mermaid et rendu dynamique
- Fallback vers parseur maison si CDN indisponible
- Gestion d'erreurs robuste pour Mermaid
- Thème adaptatif (sombre/clair) pour les diagrammes
- TEST_MARKDOWN.md créé pour validation complète
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Suppression emojis superflus dans interface utilisateur
- Correction erreurs d'encodage UTF-8 (caractères corrompus)
- Fix erreur JavaScript : togglePreview() déplacé dans la classe ConceptionAssistant
- Fix erreur JavaScript : togglePanel accessible globalement avec window.togglePanel
- Interface plus sobre et professionnelle
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Refonte complète du design avec système de panneaux latéraux rétractables
- Ajout de templates de projets par domaine (recherche, informatique, mathématiques, etc.)
- Implémentation système d'export PDF avec Puppeteer
- Amélioration de l'API REST avec nouvelles routes d'export et templates
- Ajout de JavaScript client pour interactions dynamiques
- Configuration environnement étendue pour futures fonctionnalités IA
- Amélioration responsive design et expérience utilisateur
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>