Implemented comprehensive markdown export for notes and todos with automatic HTML to Markdown conversion.
New Features:
- Export single note to Markdown file
- Export all notes to combined Markdown
- Export todos list to Markdown
- Smart HTML to Markdown conversion
- Preserves formatting, links, lists, and code blocks
Files Created:
- src/utils/markdownExport.ts - Complete export utilities
Desktop (Index.tsx):
- Added FileDown icon to imports
- New export button in note editor toolbar
- Downloads note as .md file with one click
Mobile (NoteDetailPage.tsx):
- Added "Exporter en Markdown" to dropdown menu
- Same functionality as desktop version
Markdown Export Features:
✅ Converts HTML formatting to Markdown syntax
✅ Includes note metadata (creation date, tags, priority)
✅ Exports todos as checkboxes [ ] or [x]
✅ Includes image references
✅ Automatic filename generation
✅ One-click download
Export includes:
- Note title as H1
- Creation date and metadata
- Tags with # prefix
- Priority indicator ⭐
- Full content with formatting preserved
- Todo items with completion status
- Image links
Perfect for:
- Backing up notes
- Sharing notes externally
- Version control (git)
- Using notes in other markdown editors
Added client-side image compression to improve upload speed and reduce storage.
New Features:
- Created imageCompression utility (src/utils/imageCompression.ts)
* Automatically compresses images larger than 1MB
* Resizes to max 1920x1080px while preserving aspect ratio
* Uses 80% JPEG quality by default
* Preserves PNG transparency when present
* Falls back to 60% quality if still over 2MB
Mobile (NoteDetailPage.tsx):
- Integrated compression before upload
- Shows compression stats to user (e.g., "5.2 MB → 1.1 MB")
- Better error messages with specific details
Desktop (Index.tsx):
- Same compression integration as mobile
- Consistent user experience across platforms
Benefits:
✅ Users can upload large photos from cameras/phones
✅ Faster uploads (smaller files)
✅ Reduced server storage requirements
✅ Better mobile experience (photos often 5-10MB)
✅ Transparent to user (happens automatically)
Technical Details:
- Uses HTML5 Canvas API for processing
- Client-side compression (no server load)
- Maintains image quality while reducing size
- Handles JPEG, PNG, WebP, and GIF formats
- Smart transparency detection for PNGs
Fixed image upload issues by improving error handling and validation:
Mobile (NoteDetailPage.tsx):
- Added file size validation (5MB max) before upload
- Added error message when upload returns null
- Specified exact image types in accept attribute
- Better user feedback for all error cases
Desktop (Index.tsx):
- Added file size validation (5MB max) before upload
- Added error message when upload returns null
- Specified exact image types in accept attribute
- Removed unnecessary handleUpdateNote call (backend ignores images field)
- Fixed state update to only update local state, not call backend
Both versions now:
- Show clear error messages to users when upload fails
- Validate file size before attempting upload
- Accept only supported formats: JPEG, PNG, WebP, GIF
- Handle null responses from upload service properly
This fixes the silent failure issue where images would not upload but no error was shown to the user.
Fixed critical bug where todos added on mobile or desktop were being silently lost.
Root cause:
- Mobile and desktop were sending todos via the generic PUT /api/notes/:id endpoint
- Backend ignored the 'todos' field in this endpoint (only processes title and content)
- Users saw success messages but todos were never saved to database
- On reload, todos disappeared
Solution:
- Added dedicated todo management methods to NotesService:
* addTodo() - POST /api/notes/:id/todos
* updateTodo() - PUT /api/notes/todos/:todoId
* toggleTodo() - PUT /api/notes/todos/:todoId
* deleteTodo() - DELETE /api/notes/todos/:todoId
- Updated NoteDetailPage.tsx (mobile) to use proper API methods
- Updated Index.tsx (desktop) to use proper API methods
- Both versions now correctly persist todos to the database
Files modified:
- src/services/NotesService.ts - Added todo management methods
- src/pages/mobile/NoteDetailPage.tsx - Fixed todo handlers
- src/pages/Index.tsx - Fixed todo handlers in note detail view
- Création de 3 composants UI mobile réutilisables (MobileHeader, MobileFAB, MobileCard)
- Création du layout MobileDashboard avec sidebar navigation
- Implémentation de 6 pages mobiles :
* CalendarPage : gestion des événements avec pagination
* NotesPage : liste des notes avec recherche et filtres
* NoteDetailPage : édition complète de notes en fullscreen
* TodosPage : gestion des tâches actives/complétées
* RssPage : affichage des flux RSS avec actualisation
* SettingsPage : paramètres de l'application
- Configuration du routing automatique mobile/desktop dans App.tsx
- Détection automatique du device avec redirection intelligente
- Tous les services backend réutilisés sans modification
- Build testé et fonctionnel