feat: update vote lexicon and add optimistic vote updates master
This PR implements several improvements to the voting system: **1. Vote Lexicon Migration** - Migrate from social.coves.interaction.vote to social.coves.feed.vote - Aligns with backend migration (commit 7a87d6b) - Follows atProto conventions (like app.bsky.feed.like) **2. Optimistic Score Updates** - Vote counts update immediately when users vote - Score adjustments tracked per post: - Create upvote: +1 - Remove upvote: -1 - Create downvote: -1 - Remove downvote: +1 - Switch up→down: -2 - Switch down→up: +2 - Automatic rollback on API errors - 7 new tests covering all scenarios **3. Initial Vote State Loading** - Added VoteService.getUserVotes() to query PDS for user's votes - Added VoteProvider.loadInitialVotes() to bulk-load vote state - FeedProvider loads vote state after fetching posts - Hearts now fill correctly on app reload **4. Performance Optimization** (PR Review) - Added vote state cache to avoid O(n) PDS lookups - VoteProvider passes cached state (rkey + direction) to VoteService - Eliminates 5-10 API calls for users with many votes - Performance: O(1) instead of O(n) **5. Code Quality Improvements** (PR Review) - Fix: Unsafe force unwrap in Provider initialization (main.dart:57) - Fix: Added specific catch types (on Exception catch) - Fix: Reset score adjustments when loading votes (prevents double-counting) - All 119 tests passing ✅ **Breaking Changes:** None **Migration Required:** None (backward compatible) **Test Results:** - 119/119 tests passing - 0 errors, 0 warnings - Updated test mocks for new optional parameters 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>