Feat: fix delete and add image in timeline#97
Merged
destucr merged 4 commits intodevelopmentfrom Nov 30, 2025
Merged
Conversation
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
This PR introduces support for saving, syncing, and managing "Moments" (image-based records) alongside existing heartbeat recordings. It adds a new data model for moments, updates the audio manager to handle both heartbeats and moments, and ensures both types of data can be synced with Firebase and managed locally. Additionally, it enhances the heartbeat model with a custom display name and pregnancy week tracking, and adds robust deletion logic for both heartbeats and moments.
✨ Features/Changes
SavedMomentmodel for storing image-based moments with Firebase sync support and pregnancy week trackingSavedHeartbeatmodel with customdisplayNameproperty and automatic pregnancy week calculationdeleteRecordinganddeleteMomentmethods for robust deletion of heartbeats and moments with disk cleanupSavedHeartbeatandSavedMomentmodels📁 Files Changed
Tiny/Core/Models/SavedMomentModel.swift- New model for image moments with Firebase sync, pregnancy week, and metadata fieldsTiny/Core/Models/SavedHeartbeatModel.swift- AddeddisplayNameproperty and updated initializer and serialization logicTiny/App/tinyApp.swift- Updated SwiftData container to register bothSavedHeartbeatandSavedMomentmodelsTiny/Core/Services/Audio/HeartbeatSoundManager.swift- Added moment management, deletion methods, pregnancy week calculation, andsavedMomentsarray with Firebase syncTiny/Core/Services/Storage/FirebaseStorageService.swift- Fixed unused variable in Firebase URL parsing🔧 Usage Examples (if applicable)