WIP: Améliorations UX et corrections de bugs avant création des épiques

This commit is contained in:
2026-01-17 11:10:50 +01:00
parent 772dc77719
commit ef60dafd73
84 changed files with 11846 additions and 230 deletions

View File

@@ -2,6 +2,7 @@
import { createContext, useContext, useState, useEffect, useMemo, useCallback } from 'react'
import type { Notebook, Label, Note } from '@/lib/types'
import { useNoteRefresh } from './NoteRefreshContext'
// ===== INPUT TYPES =====
export interface CreateNotebookInput {
@@ -77,6 +78,7 @@ export function NotebooksProvider({ children, initialNotebooks = [] }: Notebooks
const [currentNotebook, setCurrentNotebook] = useState<Notebook | null>(null)
const [isLoading, setIsLoading] = useState(true)
const [error, setError] = useState<string | null>(null)
const { triggerRefresh } = useNoteRefresh() // Get triggerRefresh from context
// ===== DERIVED STATE =====
const currentLabels = useMemo(() => {
@@ -219,7 +221,10 @@ export function NotebooksProvider({ children, initialNotebooks = [] }: Notebooks
// Reload notebooks to update note counts
await loadNotebooks()
}, [loadNotebooks])
// CRITICAL: Trigger UI refresh to update notes display
triggerRefresh()
}, [loadNotebooks, triggerRefresh])
// ===== ACTIONS: AI (STUBS) =====
const suggestNotebookForNote = useCallback(async (_noteContent: string) => {