From d78823daf30d5ed132652ce546291c53c69b7d5f Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 12 Nov 2025 14:38:08 +0000 Subject: [PATCH 1/2] Feature: Refonte de l'interface des notes et limitation du calendrier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modifications : - Limitation du calendrier à 10 événements maximum - Suppression des onglets dans l'éditeur de notes - Tout intégré directement dans la note : * Boutons d'action en haut (Tâche, Image, Fichier, Tag) * Tags affichés directement sous les boutons * Todos affichés dans une card * Images en miniatures 4 par ligne, cliquables * Fichiers listés dans une card * Éditeur de texte riche ensuite - Modal plein écran pour visualiser les images en grand - Interface plus compacte et fluide - Suppression des inputs de fichiers visibles --- src/pages/Index.tsx | 363 +++++++++++++++++++++++--------------------- 1 file changed, 191 insertions(+), 172 deletions(-) diff --git a/src/pages/Index.tsx b/src/pages/Index.tsx index c7e2a39..70aef1b 100644 --- a/src/pages/Index.tsx +++ b/src/pages/Index.tsx @@ -77,6 +77,7 @@ const Index = () => { const [changePasswordModal, setChangePasswordModal] = useState<{open: boolean, userId?: number}>({open: false}); const [addNoteTodoModal, setAddNoteTodoModal] = useState(false); const [addTagModal, setAddTagModal] = useState(false); + const [selectedImage, setSelectedImage] = useState(null); // Debounce timer for auto-save const saveTimerRef = useRef(null); @@ -168,7 +169,7 @@ const Index = () => { const loadCalendarEvents = async () => { try { - const events = await CalendarService.getEvents(10); + const events = await CalendarService.getEvents(10); // Limité à 10 événements if (Array.isArray(events)) { setCalendarEvents(events); } @@ -905,56 +906,104 @@ const Index = () => { onChange={(e) => handleUpdateNote({ title: e.target.value })} /> - - - Contenu - - Tâches - {openNote.todos && openNote.todos.length > 0 && ( - {openNote.todos.length} - )} - - - Images - {openNote.images && openNote.images.length > 0 && ( - {openNote.images.length} - )} - - - Fichiers - {openNote.files && openNote.files.length > 0 && ( - {openNote.files.length} - )} - - - Tags - {noteTags.length > 0 && ( - {noteTags.length} - )} - - + {/* Action buttons */} +
+ - - - + + { + if (e.target.files && e.target.files[0] && openNote?.id) { + try { + const image = await NotesService.uploadImage(openNote.id, e.target.files[0]); + if (image) { + const updatedImages = [...(openNote.images || []), image]; + setOpenNote({ ...openNote, images: updatedImages }); + await handleUpdateNote({ images: updatedImages }); + showSuccess("Image ajoutée"); + } + } catch (error) { + showError("Erreur lors de l'upload de l'image"); + } + e.target.value = ''; + } + }} + /> - - + + -
- {openNote.todos && openNote.todos.length > 0 ? ( - openNote.todos.map((todo, index) => ( -
+ +
+ + {/* Tags */} + {noteTags.length > 0 && ( +
+ {noteTags.map((tag) => ( + + + {tag.tag} + tag.id && handleDeleteTag(tag.id)} + /> + + ))} +
+ )} + + {/* Todos */} + {openNote.todos && openNote.todos.length > 0 && ( + + +
+ {openNote.todos.map((todo, index) => ( +
{ @@ -963,123 +1012,94 @@ const Index = () => { await handleUpdateNote({ todos: updatedTodos }); }} /> - + {todo.text}
- )) - ) : ( -

Aucune tâche

- )} -
- + ))} +
+ + + )} - -
- { - if (e.target.files && e.target.files[0] && openNote.id) { - try { - const image = await NotesService.uploadImage(openNote.id, e.target.files[0]); - if (image) { - const updatedImages = [...(openNote.images || []), image]; - setOpenNote({ ...openNote, images: updatedImages }); - await handleUpdateNote({ images: updatedImages }); - showSuccess("Image ajoutée"); - } - } catch (error) { - showError("Erreur lors de l'upload de l'image"); - } - e.target.value = ''; - } - }} - className="cursor-pointer" - /> -
- -
- {openNote.images && openNote.images.length > 0 ? ( - openNote.images.map((image, index) => ( -
- {image.original_name} - -
- )) - ) : ( -

Aucune image

- )} -
-
+ } catch (error) { + showError("Erreur lors de la suppression"); + } + } + }} + > + + +
+ ))} + + )} - -
- -
- -
- {openNote.files && openNote.files.length > 0 ? ( - openNote.files.map((file: any, index: number) => ( -
- + {/* Files */} + {openNote.files && openNote.files.length > 0 && ( + + +
+ {openNote.files.map((file: any, index: number) => ( +
+
-

{file.original_name || file.filename}

+

{file.original_name || file.filename}

{file.size && ( -

+

{(file.size / 1024).toFixed(2)} KB

)}
-
+
- )) - ) : ( -

Aucun fichier

- )} -
- + ))} +
+
+
+ )} - - - -
- {noteTags.length > 0 ? ( - noteTags.map((tag) => ( - - - {tag.tag} - tag.id && handleDeleteTag(tag.id)} - /> - - )) - ) : ( -

Aucun tag

- )} -
-
- + {/* Rich text editor */} + {/* Note metadata */} @@ -1913,6 +1907,31 @@ const Index = () => {
+ + {/* Image modal for fullscreen view */} + {selectedImage && ( +
setSelectedImage(null)} + > +
+ + Preview e.stopPropagation()} + /> +
+
+ )}
); }; From 05955a949ef4b18268e88539c24993d01c2c310a Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 12 Nov 2025 14:40:43 +0000 Subject: [PATCH 2/2] Feature: Centrage de la date et l'heure dans le header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modification : - Layout header changé de flexbox à grid (3 colonnes) - Logo et titre à gauche - Date et heure centrées au milieu - Menu utilisateur et boutons à droite --- src/pages/Index.tsx | 47 ++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/src/pages/Index.tsx b/src/pages/Index.tsx index 70aef1b..c7b611c 100644 --- a/src/pages/Index.tsx +++ b/src/pages/Index.tsx @@ -619,34 +619,33 @@ const Index = () => { )}
-
-
-
-
- -
- NoteFlow +
+
+
+
-
-
- {currentDateTime.toLocaleDateString('fr-FR', { - weekday: 'long', - year: 'numeric', - month: 'long', - day: 'numeric' - })} -
-
- {currentDateTime.toLocaleTimeString('fr-FR', { - hour: '2-digit', - minute: '2-digit', - second: '2-digit' - })} -
+ NoteFlow +
+ +
+
+ {currentDateTime.toLocaleDateString('fr-FR', { + weekday: 'long', + year: 'numeric', + month: 'long', + day: 'numeric' + })} +
+
+ {currentDateTime.toLocaleTimeString('fr-FR', { + hour: '2-digit', + minute: '2-digit', + second: '2-digit' + })}
-
+