Add share habits streak feature#36
Open
AlexGladkov wants to merge 4 commits into
Open
Conversation
Defines the approach for sharing habit streaks as image cards via the platform's native share sheet, including streak calculation, card rendering, and cross-platform share service. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add ability for users to share their habit streak as text via the platform's native share sheet. Users can share from the habit detail screen, including the habit name, current streak count, and completion rate. Key changes: - Add CalculateStreakUseCase to calculate consecutive days habit streak - Create StreakCard composable for future visual streak card - Implement ShareService with platform-specific implementations: * Android: Intent.ACTION_SEND with FileProvider * iOS: UIActivityViewController * Desktop: Clipboard copy * Web: Web Share API with clipboard fallback - Add share button to DetailView - Update DetailViewModel to handle share events and calculate streak - Configure Android FileProvider for future image sharing - Register ShareService and CalculateStreakUseCase in DI modules The implementation currently shares text content. Image generation from the StreakCard composable can be added as a future enhancement. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Fix streak calculation logic to properly handle days not tracked - Add ShareDismissed event to properly reset sharing state - Add comprehensive error handling to all ShareService implementations - Add file cleanup for Android to prevent cache bloat - Add fallback to text-only sharing when image is empty or fails - Improve error messages and logging across all platforms Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Key Changes
CalculateStreakUseCasecomputes current streak and max streak from habit historyStreakCardcomposable for rendering shareable streak cardsTechnical Details
🤖 Generated with Claude Code