feat: implement offline synchronization with mutation queue and background sync

- Created useOfflineSync hook for connectivity detection and sync management
- Implemented localStorage-based mutation queue for offline operations
- Added background sync support in service worker
- Created OfflineIndicator component to show connection status
- Added offline-aware action wrappers for seamless offline/online transitions
- Implemented conflict handling with retry logic (up to 3 retries)
- Auto-sync when connection is restored
- Validates Requirements 4.5
This commit is contained in:
2025-12-01 20:34:21 +00:00
parent ef6a0bf5af
commit 9726f3a9e1
8 changed files with 716 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
import type { Metadata } from 'next'
import './globals.css'
import ServiceWorkerRegistration from '@/components/ServiceWorkerRegistration'
import OfflineIndicator from '@/components/OfflineIndicator'
export const metadata: Metadata = {
title: 'Ultimate Lists',
@@ -36,6 +37,7 @@ export default function RootLayout({
</head>
<body className="bg-gray-50 min-h-screen">
<ServiceWorkerRegistration />
<OfflineIndicator />
{children}
</body>
</html>