Muyue 86eb68c0e6 feat: Enhanced mode v2 with Smart Adaptive strategy, comprehensive logging, and internationalization
Major Features:
  - Enhanced Mode v2: Smart Adaptive section selection strategy
    * AI automatically selects ONE optimal section per iteration
    * Intelligent selection based on quality assessment and strategic importance
    * Section tracking to avoid duplicate modifications
    * Fixed header level preservation (## stays ##, ### stays ###)
    * Updated document code block format (document)

  - Mermaid Auto-Fix System
    * New POST /api/ai/fix-mermaid endpoint for automatic diagram correction
    * Automatic error detection in preview and presentation modes
    * Inter-window communication for seamless editor updates
    * AI-powered syntax error resolution

  - Comprehensive Logging System
    * Centralized logger utility (utils/logger.js)
    * API request/response middleware logging
    * AI operations: rephrase, check-inconsistencies, check-duplications, give-advice, liberty-mode, fix-mermaid
    * Storage operations: create, read, update, delete journals
    * Export operations: PDF and Web ZIP generation
    * Structured logging with timestamps, levels, categories, and metadata

  Improvements:
  - Table of Contents: Clean display with markdown formatting stripped from titles
  - Section badges: Fixed visibility with hardcoded blue background (#2563eb)
  - Internationalization: Complete English translation (lang, UI text, placeholders, comments)
  - Code cleanup: Removed all emojis from codebase

  Technical Changes:
  - routes/ai.js: Enhanced mode implementation, Mermaid fix endpoint, comprehensive logging
  - routes/api.js: Storage operation logging
  - routes/export.js: Export operation logging
  - routes/index.js: Presentation mode Mermaid auto-fix
  - assets/js/app.js: TOC markdown stripping, Mermaid error handling, message listeners
  - assets/css/style.css: Dark mode comment, English placeholders, header icon
  - views/page.js: English lang attribute, favicon, scroll-to-top button
  - views/header.js: Theme toggle icon
  - utils/logger.js: New centralized logging system
  - app.js: API request/response logging middleware
2025-10-15 10:21:54 +02:00

47 lines
1.4 KiB
JavaScript

const { getHeader, getLeftPanel, getRightPanel, getPanelOverlay } = require('./header');
const { getMain } = require('./main');
const { getFooter } = require('./footer');
function getHead(){
return `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Conception-Assistant</title>
<link rel="stylesheet" href="/assets/css/style.css">
<link rel="stylesheet" href="/assets/css/github-preview.css">
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>📝</text></svg>">
<!-- Marked.js pour le rendu Markdown compatible GitHub -->
<script src="https://cdn.jsdelivr.net/npm/marked@9.1.6/marked.min.js"></script>
<!-- Mermaid pour les diagrammes -->
<script src="https://cdn.jsdelivr.net/npm/mermaid@10.6.1/dist/mermaid.min.js"></script>
</head>
`;
}
function getBody(){
return `
<body>`
+ getHeader()
+ getLeftPanel()
+ getRightPanel()
+ getPanelOverlay()
+ getMain()
+ getFooter() +
`
<!-- Bouton scroll to top -->
<button id="scroll-to-top" class="scroll-to-top" title="Back to top">↑</button>
<script src="/assets/js/app.js"></script>
</body>
</html>
`;
}
function getPage() {
return getHead() + getBody();
}
module.exports = { getPage };