From 1ae40ad84cb3bea911df890d9932610f77b36ae7 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 12 Nov 2025 14:53:10 +0000 Subject: [PATCH] =?UTF-8?q?Feature:=20Am=C3=A9liorations=20UI=20des=20boxe?= =?UTF-8?q?s=20Todo,=20RSS=20et=20Calendrier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modifications : 1. Box Flux RSS : - Correction du bug d'affichage de l'entête (boutons plus compacts) - Affichage de seulement 3 articles à la fois - Rotation automatique toutes les 20 secondes parmi les 15 derniers articles - Indicateurs de pagination (dots) pour visualiser la rotation - Taille de texte réduite pour plus de lisibilité 2. Box Todo List : - Interface plus compacte pour afficher plus de tâches - Padding réduit (p-2 au lieu de p-3) - Taille de texte réduite (text-sm) - Espacement vertical réduit (space-y-1.5 au lieu de space-y-3) - Hauteur maximale augmentée de 400px à 350px - Boutons et icônes plus petits 3. Box Calendrier : - Ajout d'une icône bleue animée (pulse) pour les RDV du jour - Meilleure identification visuelle des événements d'aujourd'hui --- src/pages/Index.tsx | 120 +++++++++++++++++++++++++++----------------- 1 file changed, 75 insertions(+), 45 deletions(-) diff --git a/src/pages/Index.tsx b/src/pages/Index.tsx index c7b611c..44bc1cd 100644 --- a/src/pages/Index.tsx +++ b/src/pages/Index.tsx @@ -56,6 +56,7 @@ const Index = () => { const [loadingModels, setLoadingModels] = useState(false); const [currentDateTime, setCurrentDateTime] = useState(new Date()); const [upcomingAlert, setUpcomingAlert] = useState(null); + const [rssDisplayOffset, setRssDisplayOffset] = useState(0); const [calendarAuthStatus, setCalendarAuthStatus] = useState<{ isAuthenticated: boolean; isExpired: boolean; @@ -109,6 +110,19 @@ const Index = () => { return () => clearInterval(timer); }, [calendarEvents]); + // RSS articles rotation every 20 seconds + useEffect(() => { + if (rssArticles.length > 3) { + const timer = setInterval(() => { + setRssDisplayOffset(prev => { + const maxOffset = Math.max(0, rssArticles.length - 3); + return (prev + 3) % (maxOffset + 3); + }); + }, 20000); // Rotate every 20 seconds + return () => clearInterval(timer); + } + }, [rssArticles.length]); + useEffect(() => { const userFromAuth = AuthService.getUser(); if (userFromAuth) { @@ -728,7 +742,12 @@ const Index = () => { >
-

{event.title}

+
+ {isToday && ( +
+ )} +

{event.title}

+

{isToday ? "Aujourd'hui" : startDate.toLocaleDateString('fr-FR', { day: '2-digit', month: '2-digit' })} à {startDate.toLocaleTimeString('fr-FR', { hour: '2-digit', minute: '2-digit' })}

@@ -1171,79 +1190,78 @@ const Index = () => {
{/* Todos Box */} - +
- + Tâches -
- - Actives ({todos.filter(t => !t.completed).length}) - Complétées ({todos.filter(t => t.completed).length}) + + Actives ({todos.filter(t => !t.completed).length}) + Complétées ({todos.filter(t => t.completed).length}) - -
+ +
{todos.filter(t => !t.completed).length > 0 ? ( todos.filter(t => !t.completed).map(todo => ( -
+
todo.id && handleToggleTodo(todo.id)} - className="h-5 w-5" + className="h-4 w-4" /> - + {todo.text}
)) ) : ( -

Aucune tâche active

+

Aucune tâche active

)}
- -
+ +
{todos.filter(t => t.completed).length > 0 ? ( todos.filter(t => t.completed).map(todo => ( -
+
todo.id && handleToggleTodo(todo.id)} - className="h-5 w-5" + className="h-4 w-4" /> - + {todo.text}
)) ) : ( -

Aucune tâche complétée

+

Aucune tâche complétée

)}
@@ -1253,59 +1271,71 @@ const Index = () => { {/* RSS Box */} - -
- - + +
+ + Flux RSS -
- -
-
+
{rssArticles.length > 0 ? ( - rssArticles.map(article => ( + rssArticles.slice(rssDisplayOffset, rssDisplayOffset + 3).map(article => (
article.link && window.open(article.link, '_blank')} > -
+
-

{article.title}

+

{article.title}

{article.description && ( -

+

{article.description.replace(/<[^>]*>/g, '')}

)}
- +
)) ) : ( -

+

Aucun article

)} + {rssArticles.length > 3 && ( +
+
+ {Array.from({ length: Math.ceil(rssArticles.length / 3) }).map((_, i) => ( +
+ ))} +
+
+ )}