docs: add complete guide, env files, fix docker-compose
- Add GUIDE.md: complete user documentation covering installation, Docker deployment, AI providers, MCP server, N8N integration, email config, admin panel, env var reference, troubleshooting - Add mcp-server/.env.example with all MCP-specific variables - Update .env.docker.example with all 42 environment variables - Fix docker-compose.yml: parameterize PostgreSQL credentials, add missing env vars (CUSTOM_OPENAI, AI_PROVIDER_CHAT, ALLOW_REGISTRATION, RESEND_API_KEY) - Track memento-note/.env.example
This commit is contained in:
@@ -15,14 +15,14 @@ export function useAutoTagging({ content, notebookId, enabled = true }: UseAutoT
|
||||
const [isAnalyzing, setIsAnalyzing] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
// Debounce le contenu de 1.5s
|
||||
// Debounce content by 1.5s
|
||||
const debouncedContent = useDebounce(content, 1500);
|
||||
|
||||
// Track previous notebookId to detect when note is moved to a notebook
|
||||
const previousNotebookId = useRef<string | null | undefined>(notebookId);
|
||||
|
||||
const analyzeContent = async (contentToAnalyze: string) => {
|
||||
// CRITICAL: Don't suggest labels in "Notes générales" (notebookId is null)
|
||||
// CRITICAL: Don't suggest labels in "General Notes" (notebookId is null)
|
||||
// Labels should ONLY appear within notebooks, not in the general notes section
|
||||
if (!notebookId) {
|
||||
setSuggestions([]);
|
||||
@@ -49,13 +49,13 @@ export function useAutoTagging({ content, notebookId, enabled = true }: UseAutoT
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error('Erreur lors de l\'analyse');
|
||||
throw new Error('Error during analysis');
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
setSuggestions(data.tags || []);
|
||||
} catch (err) {
|
||||
setError('Impossible de générer des suggestions');
|
||||
setError('Failed to generate suggestions');
|
||||
} finally {
|
||||
setIsAnalyzing(false);
|
||||
}
|
||||
@@ -78,7 +78,7 @@ export function useAutoTagging({ content, notebookId, enabled = true }: UseAutoT
|
||||
const prev = previousNotebookId.current;
|
||||
previousNotebookId.current = notebookId;
|
||||
|
||||
// Detect when note is moved FROM "Notes générales" (null) TO a notebook
|
||||
// Detect when note is moved FROM "General Notes" (null) TO a notebook
|
||||
const wasMovedToNotebook = (prev === null || prev === undefined) && notebookId;
|
||||
|
||||
if (wasMovedToNotebook && content && content.length >= 10) {
|
||||
|
||||
@@ -17,7 +17,7 @@ export function useTitleSuggestions({ content, enabled = true }: UseTitleSuggest
|
||||
const [isAnalyzing, setIsAnalyzing] = useState(false)
|
||||
const [error, setError] = useState<string | null>(null)
|
||||
|
||||
// Debounce le contenu de 2s pour éviter trop d'appels
|
||||
// Debounce content by 2s to avoid excessive API calls
|
||||
const debouncedContent = useDebounce(content, 2000)
|
||||
|
||||
useEffect(() => {
|
||||
@@ -28,7 +28,7 @@ export function useTitleSuggestions({ content, enabled = true }: UseTitleSuggest
|
||||
|
||||
const wordCount = debouncedContent.split(/\s+/).length
|
||||
|
||||
// Il faut au moins 10 mots
|
||||
// Need at least 10 words
|
||||
if (wordCount < 10) {
|
||||
setSuggestions([])
|
||||
return
|
||||
@@ -49,14 +49,14 @@ export function useTitleSuggestions({ content, enabled = true }: UseTitleSuggest
|
||||
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json()
|
||||
throw new Error(errorData.error || 'Erreur lors de la génération des titres')
|
||||
throw new Error(errorData.error || 'Error generating title suggestions')
|
||||
}
|
||||
|
||||
const data = await response.json()
|
||||
setSuggestions(data.suggestions || [])
|
||||
} catch (err) {
|
||||
console.error('❌ Title suggestions error:', err)
|
||||
setError('Impossible de générer des suggestions de titres')
|
||||
setError('Failed to generate title suggestions')
|
||||
} finally {
|
||||
setIsAnalyzing(false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user