-
Notifications
You must be signed in to change notification settings - Fork 3
feat: implement optimistic UI updates for upvotes #25
Copy link
Copy link
Open
Labels
advancedComplex challenge (3-6 hours)Complex challenge (3-6 hours)enhancementNew feature or requestNew feature or request
Description
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 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
- Implement useOptimistic or custom hook
- Immediate UI feedback
- Rollback on server error
- Handle concurrent upvotes correctly
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
advancedComplex challenge (3-6 hours)Complex challenge (3-6 hours)enhancementNew feature or requestNew feature or request