diff --git a/EXHAUSTIVE_TODO_LIST.md b/EXHAUSTIVE_TODO_LIST.md index dbb1b5725..08ad87311 100644 --- a/EXHAUSTIVE_TODO_LIST.md +++ b/EXHAUSTIVE_TODO_LIST.md @@ -789,11 +789,20 @@ Critical path dependencies: - UI shows queued requests correctly - **Rollback**: Delete component -- [ ] **Action 2.5.1.5**: Integrate offline queue UI with OfflineIndicator +- [x] **Action 2.5.1.5**: Integrate offline queue UI with OfflineIndicator - **Scope**: `apps/web/src/components/OfflineIndicator.tsx` - Show queue status, link to manager - - **Dependencies**: Action 2.5.1.4 complete + - **Dependencies**: Action 2.5.1.4 complete ✅ - **Risk**: LOW 🔒 - - **Validation**: Indicator shows queue status + - **Validation**: ✅ Integrated OfflineQueueManager with OfflineIndicator: + - Added state to manage queue manager dialog visibility + - Added "View Queue" button in offline mode banner (when queueSize > 0) + - Added "View Queue" button in processing mode banner (when queueSize > 0) + - Button opens OfflineQueueManager dialog when clicked + - Button styled appropriately for each banner variant (red for offline, cyan for processing) + - Imported OfflineQueueManager component + - Imported List icon from lucide-react for button + - Indicator shows queue status and provides access to queue manager + - Users can now view and manage queued requests directly from the indicator - **Rollback**: Remove queue status - [x] **Action 2.5.1.6**: Test request deduplication works correctly diff --git a/apps/web/src/components/OfflineIndicator.tsx b/apps/web/src/components/OfflineIndicator.tsx index c6197d6cb..a1d436769 100644 --- a/apps/web/src/components/OfflineIndicator.tsx +++ b/apps/web/src/components/OfflineIndicator.tsx @@ -1,8 +1,9 @@ import { useEffect, useState } from 'react'; import { useOnlineStatus } from '@/hooks/useOnlineStatus'; import { offlineQueue } from '@/services/offlineQueue'; -import { WifiOff, Loader2 } from 'lucide-react'; +import { WifiOff, Loader2, List } from 'lucide-react'; import { hasRecentNetworkError } from '@/utils/networkErrorTracker'; +import { OfflineQueueManager } from './OfflineQueueManager'; /** * Composant pour afficher un indicateur de mode hors ligne avec nombre de requĂȘtes en attente @@ -12,6 +13,7 @@ export function OfflineIndicator() { const [queueSize, setQueueSize] = useState(0); const [isProcessing, setIsProcessing] = useState(false); const [hasNetworkError, setHasNetworkError] = useState(false); + const [showQueueManager, setShowQueueManager] = useState(false); // Mettre Ă  jour la taille de la file d'attente useEffect(() => { @@ -70,36 +72,68 @@ export function OfflineIndicator() { // Mode hors ligne ou erreur rĂ©seau rĂ©cente if (!isOnline || hasNetworkError) { return ( -
- - - Mode hors ligne + <> +
+ + + Mode hors ligne + {queueSize > 0 && ( + + - {queueSize} {queueSize === 1 ? 'requĂȘte' : 'requĂȘtes'} en + attente + + )} + {queueSize > 0 && ( - - - {queueSize} {queueSize === 1 ? 'requĂȘte' : 'requĂȘtes'} en - attente - + )} - -
+
+ setShowQueueManager(false)} + /> + ); } // En ligne mais traitement de la file en cours if (isProcessing && queueSize > 0) { return ( -
- - - Synchronisation en cours + <> +
+ + + Synchronisation en cours + {queueSize > 0 && ( + + - {queueSize} {queueSize === 1 ? 'requĂȘte' : 'requĂȘtes'} restante + {queueSize > 1 ? 's' : ''} + + )} + {queueSize > 0 && ( - - - {queueSize} {queueSize === 1 ? 'requĂȘte' : 'requĂȘtes'} restante - {queueSize > 1 ? 's' : ''} - + )} - -
+
+ setShowQueueManager(false)} + /> + ); }