## 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.
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
- 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>
- Express server with routes for index and API endpoints
- CRUD operations for markdown journals via REST API
- Modular view components (header, main, footer, page)
- UUID-based file management system for journals
- Content-editable journal editor with AI assistant features
- Package.json with express and uuid dependencies
- Basic project structure with assets, config, tests, views directories
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>