Commit Graph

31 Commits

Author SHA1 Message Date
9a75965b2c Move permission badge and share button to list title line
- Created ListHeader component with permission and share on same line as title
- Permission badge and share button now appear to the right of the title
- Removed permission/share section from ListDetailView
- More compact header layout with better use of space
2025-12-03 00:52:33 +00:00
bdff38c9a5 Remove SyncIndicator to fix hydration errors
- Removed SyncIndicator component causing hydration issues
- Background polling still works for real-time updates
- Updates appear within 1 second without visual indicator
2025-12-03 00:45:51 +00:00
fc5ad9f7af Improve real-time sync with 1-second polling and visual indicator
- Reduced polling interval from 2s to 1s for near-instant updates
- Added SyncIndicator component to show sync status
- Added console logging to debug sync behavior
- Updates across devices now appear within 1 second
- Visual feedback shows when data is being refreshed
2025-12-03 00:29:24 +00:00
e6067e76cd Improve real-time sync speed and caching
- Reduced polling interval from 3s to 2s for faster updates
- Added revalidate = 0 to prevent Next.js caching
- Updates from other browsers now appear within 2 seconds
- Both home page and list detail pages sync faster
2025-12-02 14:38:01 +00:00
0fc8c719b9 Add real-time updates and fix delete button state
- Simplified useRealtimeSync to use router.refresh() polling
- Created RealtimeUpdater component for easy integration
- Added real-time updates to home page (3s polling)
- Fixed DeleteItemButton to properly reset state on error
- Updates now refresh every 3 seconds and on window focus
- Changes from other users/browsers will appear quickly
2025-12-02 14:29:28 +00:00
d7297248c1 Fix all NextAuth v4 imports across codebase 2025-12-02 14:03:13 +00:00
2f7bc4fe8e Fix NextAuth v4 imports and exports 2025-12-02 14:01:05 +00:00
fe783301e7 Downgrade to NextAuth v4 to fix constructor error 2025-12-02 13:56:57 +00:00
c0358d79d7 Fix Docker build and Next.js metadata configuration
- Move themeColor and viewport to separate viewport export in layout.tsx
- Improve Docker build process with npm ci and proper dependency handling
- Add Docker-friendly Next.js configuration settings
- Resolve constructor error and metadata warnings
2025-12-02 13:47:40 +00:00
855abb98b7 Re-add redirect for unauthenticated users on home page 2025-12-02 13:28:39 +00:00
f3d9ccde56 Remove manual redirect from home page - let middleware handle auth
- Middleware already handles authentication redirects
- Prevents error boundary from catching redirect errors
- Cleaner separation of concerns
2025-12-02 13:17:12 +00:00
92401c5324 Fix home page redirect for unauthenticated users
- Check session before calling getLists()
- Redirect to login page if not authenticated
- Prevents server component render error in production
2025-12-02 12:40:15 +00:00
b2a59eecf1 feat: implement real-time list synchronization
- Add useRealtimeSync hook for polling server updates every 3 seconds
- Create API endpoint to check last updated timestamp for lists
- Integrate real-time sync into ListDetailView component
- Automatically refresh when other users make changes to shared lists
- Poll on interval and when page becomes visible again
2025-12-02 10:06:49 +00:00
0e609af924 feat: Update PWA service worker for authentication
- Add authentication pages to static cache (/auth/login, /auth/register, /auth/error)
- Implement special handling for authentication API requests (network-only with offline error)
- Add authentication page caching strategy (cache-first with network fallback)
- Prevent caching of authentication errors (401, 403)
- Enhance offline page with online detection and auto-redirect
- Add authentication notice to offline page
- Update cache version to v2 for proper invalidation
- Create PWA_AUTH_GUIDE.md documentation

Task: 19. Update PWA service worker for authentication
Requirements: 4.4
2025-12-02 01:34:28 +00:00
54612a4782 feat: update components for multi-user support
- Add sharing indicator to ListCard showing collaborator count
- Add permission badge and share button to ListDetailView
- Disable editing in ItemForm for viewers with visual feedback
- Add permission checks to item detail and edit pages
- Hide edit/delete buttons for viewers on item detail page
- Pass permission and collaborator data through component hierarchy
- Update navigation to include profile and invitations links (already done in previous tasks)

Implements task 15 from user-auth-and-sharing spec
2025-12-02 01:14:21 +00:00
85c8a1650b Implement profile management (task 14)
- Add updateProfile and updatePassword server actions
- Add getUserProfile function with sensitive data protection
- Create ProfileForm component for name and email updates
- Create PasswordChangeForm component with current password verification
- Create profile page at /profile with all profile management features
- Add profile and invitations navigation links to main page
- Implement email uniqueness validation
- Implement password hashing on password change

Requirements: 7.1, 7.2, 7.3, 7.4, 7.5
2025-12-02 01:06:21 +00:00
b102e86b33 feat: create sharing UI components (task 13)
- Add PermissionBadge component to display owner/editor/viewer roles
- Add InvitationCard component for accepting/declining invitations
- Add CollaboratorList component to manage list collaborators
- Add ShareListModal component for inviting users and viewing access
- Add invitations page to view and manage pending invitations

Requirements: 5.1, 5.4, 8.1, 8.2
2025-12-02 01:02:33 +00:00
0bb293e101 feat: implement list ownership and access control
- Modified createList to assign ownerId to authenticated user
- Updated getLists to filter by user access (owner or collaborator)
- Added ownership checks to updateList (owner or editor can update)
- Added ownership checks to deleteList (only owner can delete)
- Implemented access control for all item operations (create, update, delete, toggle)
- Updated getItem, searchItems, and getItemsByFilter to enforce access control
- Added dynamic rendering to pages that use authentication
- Cascade deletion already handled by database schema (onDelete: Cascade)

Requirements: 4.1, 4.2, 4.3, 4.5
2025-12-02 00:48:47 +00:00
d4a5232e71 feat: implement authentication UI components
- Add LoginForm component with email/password validation
- Add RegisterForm component with password confirmation
- Create login page at /auth/login
- Create register page at /auth/register
- Create authentication error page at /auth/error
- Add loading states and error handling
- Implement inline validation with user feedback
- Follow existing component patterns from ListForm

Implements task 6 from user-auth-and-sharing spec
Requirements: 1.1, 2.1
2025-12-02 00:42:04 +00:00
2c3b66b085 feat: set up authentication infrastructure with NextAuth.js v5
- Install next-auth@beta, bcryptjs, zod, and @auth/prisma-adapter
- Create auth.ts with credentials provider and JWT session strategy
- Create auth.config.ts for edge-compatible middleware configuration
- Add NextAuth type extensions for session and JWT
- Create API route handler for authentication
- Configure environment variables for NextAuth
- Add AUTH_SETUP.md documentation

Task: 1. Set up authentication infrastructure
Requirements: 1.1, 2.1
2025-12-01 23:56:45 +00:00
12ce70e495 Implement comprehensive error handling
- Add try-catch blocks to all server actions with retry logic
- Implement exponential backoff retry mechanism for database operations
- Add input validation to all server actions
- Create ErrorBoundary component for React error handling
- Add page-level error handlers (error.tsx, global-error.tsx)
- Add route-specific error pages for list and item routes
- Enhance database connection with graceful error handling
- Add user-friendly error messages throughout the application
- Implement proper error logging for debugging

Task: 16. Implement error handling
Requirements: All (error handling is cross-cutting)
2025-12-01 21:18:57 +00:00
e51e88fddd feat: Add visual feedback and polish (Task 15)
- Implement toast notification system for success/error messages
- Add loading states with skeleton loaders for async operations
- Create smooth CSS transitions and animations
- Enhance empty states with EmptyState component
- Add loading.tsx files for Next.js loading states
- Integrate toast notifications across all CRUD operations
- Add fade-in and scale-in animations for better UX
- Improve visual feedback for user actions
2025-12-01 21:14:14 +00:00
a037117b15 feat: implement responsive design enhancements
- Add touch-optimized tap targets (44x44px minimum for iOS)
- Enhance mobile responsiveness across all components
- Improve button sizing and spacing for touch interactions
- Add responsive text sizing and layout adjustments
- Implement mobile-first modal behavior (bottom sheet on mobile)
- Enhance form controls with better touch targets
- Add active states for better touch feedback
- Improve grid layouts for various screen sizes
- Add smooth scrolling and better focus states
- Optimize FilterPanel for mobile with grid layouts
- Enhance all interactive elements with tap-target classes

Requirements: 7.1, 7.2
2025-12-01 20:54:54 +00:00
6cb9a593d4 feat: Add PWA assets and metadata for iOS Safari installation
- Generate app icons in multiple sizes (192x192, 512x512, 180x180, 32x32)
- Create favicon and apple-touch-icon SVG files
- Add comprehensive PWA meta tags in app layout
- Configure theme color (#3B82F6) and background color
- Update manifest.json with icon references (PNG and SVG)
- Create icon generation scripts (SVG and PNG conversion)
- Add browser-based PNG icon generator (HTML)
- Create comprehensive PWA testing guide
- Add icon setup documentation

Requirements: 4.1, 4.2
Task: 13. Add PWA assets and metadata
2025-12-01 20:39:11 +00:00
9726f3a9e1 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
2025-12-01 20:34:21 +00:00
ef6a0bf5af feat: Set up PWA infrastructure with service worker, offline support, and manifest
- Created service worker (public/sw.js) with caching strategies
  - Cache-first strategy for static assets
  - Stale-while-revalidate for API responses and pages
  - Network-first fallback strategy
- Implemented offline fallback page (/offline)
- Updated manifest.json with complete PWA metadata
- Added service worker registration in app layout
- Created ServiceWorkerRegistration component for client-side registration
- Generated SVG icons for PWA (192x192 and 512x512)
- Added PWA meta tags for iOS Safari support

Validates Requirements: 4.1, 4.3, 4.4
2025-12-01 20:30:07 +00:00
0143097e69 feat: Add search and filter UI components
- Created SearchBar component with debounced input
- Built FilterPanel component with controls for priority, completion, tags, and due date
- Added sort controls (field and direction)
- Implemented filter clear functionality
- Display search results with highlighted text
- Added GlobalSearch component for home page
- Integrated search and filter into list detail view
- Added CSS styles for search highlighting

Requirements: 6.1, 6.2, 6.3, 6.4, 8.1, 8.2, 8.3
2025-12-01 19:25:09 +00:00
477e378d08 feat: implement list detail page with item management
- Created /list/[id] page showing all items in a list
- Added ItemCard component with completion toggle, priority badge, and due date display
- Implemented InlineItemCreate component for quick task creation
- Enhanced ToggleItemButton with icon variant for compact display
- Enhanced DeleteItemButton with icon variant and improved event handling
- Added overdue indicators for past due dates
- Organized items into 'To Do' and 'Completed' sections
- Implemented empty state for lists with no tasks

Requirements: 1.3, 1.5, 2.3, 5.5
2025-12-01 19:21:42 +00:00
c1afb2cb6e feat: enhance list management UI with create, edit, and delete functionality
- Add ListForm component for creating and editing lists with color picker
- Add Modal component for reusable dialog functionality
- Add DeleteListButton with confirmation dialog
- Add NewListButton for creating new lists
- Update ListCard to show edit/delete buttons on hover
- Update home page to use new list creation flow
- All components include proper error handling and loading states

Requirements: 2.1, 2.2, 2.4, 2.5
2025-12-01 19:18:54 +00:00
282a0295ec feat: implement item detail page and form components
- Created ItemForm component with fields for all metadata (priority, due date, tags, notes)
- Created ItemDetail component to display all item information
- Built /list/[id]/item/[itemId] page for viewing full item details
- Built /list/[id]/item/[itemId]/edit page for editing items
- Added form validation for item inputs (title required, length limits)
- Created DeleteItemButton and ToggleItemButton helper components
- Enhanced createItem action to support full metadata on creation
- Added getItem action to fetch individual items with list data

Requirements: 1.1, 1.2, 5.1, 5.2, 5.3, 5.4
2025-12-01 19:16:37 +00:00
0cfcd05921 Connect app to MySQL database at 192.168.4.20 2025-12-01 18:45:48 +00:00