WIP: Améliorations UX et corrections de bugs avant création des épiques
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user