From b071c94cecbc6111ecd73f3e4bea11462d4b29ee Mon Sep 17 00:00:00 2001 From: Michael SCHAL Date: Mon, 8 Dec 2025 08:39:58 +0100 Subject: [PATCH] feat: implement core application dashboard with notes, todos, RSS, calendar, and AI chat, alongside a dedicated mobile notes page. --- src/pages/Index.tsx | 13 ++++++++++--- src/pages/mobile/NotesPage.tsx | 9 ++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/pages/Index.tsx b/src/pages/Index.tsx index 9a2eacf..d5b5edf 100644 --- a/src/pages/Index.tsx +++ b/src/pages/Index.tsx @@ -208,7 +208,7 @@ const Index = () => { const userFromAuth = AuthService.getUser(); if (userFromAuth) { setUser(userFromAuth); - loadNotes(); + loadNotes(); // Will use current showArchived state loadTodos(); loadRssFeeds(); loadRssArticles(); @@ -216,7 +216,14 @@ const Index = () => { } else { navigate("/login"); } - }, [navigate]); + }, [navigate]); // Keep this for auth check + + // Reload notes when showArchived changes + useEffect(() => { + if (user) { + loadNotes(); + } + }, [showArchived]); // Auto-refresh des articles RSS toutes les 2 minutes useEffect(() => { @@ -229,7 +236,7 @@ const Index = () => { const loadNotes = async () => { try { - const fetchedNotes = await NotesService.getNotes(); + const fetchedNotes = await NotesService.getNotes(showArchived); if (Array.isArray(fetchedNotes)) { setNotes(fetchedNotes); } diff --git a/src/pages/mobile/NotesPage.tsx b/src/pages/mobile/NotesPage.tsx index d42f085..6fc00ed 100644 --- a/src/pages/mobile/NotesPage.tsx +++ b/src/pages/mobile/NotesPage.tsx @@ -20,7 +20,7 @@ export default function NotesPage() { const loadNotes = async () => { try { - const data = await NotesService.getNotes(); + const data = await NotesService.getNotes(showArchived); setNotes(data); } catch (error) { showError("Erreur lors du chargement des notes"); @@ -29,7 +29,7 @@ export default function NotesPage() { useEffect(() => { loadNotes(); - }, []); + }, [showArchived]); const filteredNotes = notes .filter(note => { @@ -129,9 +129,8 @@ export default function NotesPage() {