Problem Description
Upvote button waits for server response before updating the UI, causing perceived lag.
Context
Optimistic UI updates improve perceived performance by updating the UI immediately.
Files to Investigate
src/components/upvote-button.tsx - Upvote component
src/actions/events.ts - upvoteEvent action
Steps to Reproduce
- Click upvote on an event
- Notice delay before count updates
- UI should update immediately
Expected Behavior
UI should update immediately with rollback on error.
Acceptance Criteria
Suggested Approach
Use React 19's useOptimistic hook or implement custom optimistic state management.
Difficulty: Hard
Estimated time: 3-6 hours
Prerequisites: React hooks, state management
Learning outcomes: Optimistic UI patterns, React 19 features
Problem Description
Upvote button waits for server response before updating the UI, causing perceived lag.
Context
Optimistic UI updates improve perceived performance by updating the UI immediately.
Files to Investigate
src/components/upvote-button.tsx- Upvote componentsrc/actions/events.ts- upvoteEvent actionSteps to Reproduce
Expected Behavior
UI should update immediately with rollback on error.
Acceptance Criteria
Suggested Approach
Use React 19's useOptimistic hook or implement custom optimistic state management.
Difficulty: Hard
Estimated time: 3-6 hours
Prerequisites: React hooks, state management
Learning outcomes: Optimistic UI patterns, React 19 features