code
Clone this repository
https://tangled.org/bretton.dev/coves-mobile
git@knot.bretton.dev:bretton.dev/coves-mobile
For self-hosted knots, clone URLs may differ based on your setup.
Comment creation feature with backend integration:
- CommentService for API calls
- Shared auth interceptor (401 retry)
- Input validation (10k chars, emoji-aware)
- Tap-to-reply UI for nested comments
- 22 new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
CommentService tests (10 tests):
- Successful comment creation
- Auth failure when no session
- Network error handling
- 401 response handling
- Invalid responses (null data, missing uri, empty uri)
- Server error handling
- Nested reply request format
CommentsProvider.createComment tests (12 tests):
- Validation: empty content, whitespace-only, exceeds limit
- Emoji counting with grapheme clusters
- Error states: no post loaded, no CommentService
- Top-level comment (reply to post)
- Nested comment (reply to comment)
- Content trimming
- Refresh after success
- Exception propagation
- Boundary testing at max length
All 52 tests pass.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Pass postCid to loadComments for reply reference support
- Add onReplyTap callback to CommentThread and CommentCard
- Tapping reply icon on a comment navigates to ReplyScreen
- ReplyScreen receives parent comment for nested replies
- Show "Replying to @handle" context in reply screen
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add CommentService dependency to CommentsProvider
- Add createComment() method supporting both post and comment replies
- Store postCid alongside postUri for proper reply references
- Add input validation: 10k char limit using grapheme clusters
- Proper emoji counting (🎉 = 1 char, not 2)
- Wire up CommentService in main.dart
Reply reference logic:
- Reply to post: root=post, parent=post
- Reply to comment: root=post, parent=comment
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Create auth_interceptor.dart with reusable createAuthInterceptor()
- Handles 401 responses by refreshing token and retrying once
- Sign out user if refresh fails to prevent infinite loops
- Refactor VoteService to use shared interceptor
- CommentService already uses it (from previous commit)
Eliminates ~130 lines of duplicated interceptor code.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add CommentService with createComment() method that calls backend API
- Backend handles PDS writes via OAuth/DPoP (sealed token architecture)
- Add ValidationException to api_exceptions for client-side validation
- Add characters package for proper Unicode grapheme cluster counting
The comment creation flow:
Mobile → Coves Backend (sealed token) → User's PDS (DPoP)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Update mock providers to remove VoteService dependency
- Add ViewerState to test fixtures for feed and comments
- Update FeedProvider tests for vote state initialization
- Update CommentsProvider tests for recursive vote state init
- Update VoteProvider tests for extractRkeyFromUri utility
- Remove obsolete vote service test methods (deleteVote, getUserVotes)
- Add generated mock files for auth service tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>