Now that confirmation dialogs have been removed, the UI feels sluggish waiting for API responses before updating. We need to implement optimistic updates to make the app feel fast and responsive.
Current State:
- Local database acts as a read-only mirror of the API
- UI updates only after successful API calls
- This creates perceived latency even for simple operations
Desired Behavior:
- Optimistic updates: Immediately update local DB with expected results when user performs an action
- Non-blocking UI: User can continue interacting while API calls happen in background
- Rollback on failure: If API call fails, revert local DB to previous state
- Error handling: Display error notification/dialog when rollback occurs
Technical Considerations:
- Need to track pending operations and their rollback data
- Consider implementing a command/action pattern with undo capability
- May need to differentiate between optimistic (unconfirmed) and confirmed data in the DB
- Handle edge cases like multiple rapid actions on the same item
- Consider conflict resolution if API state has changed since last sync
Now that confirmation dialogs have been removed, the UI feels sluggish waiting for API responses before updating. We need to implement optimistic updates to make the app feel fast and responsive.
Current State:
Desired Behavior:
Technical Considerations: