feat: diary entry export functionality and settings integration#32
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.
This pull request introduces diary entry export functionality and refines the handling of local file URIs for image loading. The main changes are the addition of diary entry export (with Android implementation), improvements to the
LocalFileFetcherto enforce stricter URI validation and enhance security, and updates to UI and tests to support these features.Diary Entry Export Functionality:
DiaryEntryExport.kt, including result types and logic for exporting diary entries as files.DiaryEntryExport.android.kt, which writes exported files to a cache directory and launches the Android share sheet. [1] [2]SettingsScreen, which invokes the export functionality and displays results to the user. [1] [2] [3]Local File URI Handling and Security:
LocalFileFetcher.Factoryto only accept canonical, safe URIs of the formlocalfile:///filename, rejecting URIs with authorities, nested paths, or directory traversal attempts. Updated documentation and logic accordingly.EntryDetailsScreento match the stricter URI format.Repository and Sync Improvements:
DiaryRepositoryto accept aSettingsRepositoryand pass it to sync tombstone recording, improving dependency management. [1] [2] [3]Test and Documentation Updates:
LocalFileFetcherto ensure only valid URIs are accepted and unsafe or malformed URIs are rejected. [1] [2]These changes collectively add user-facing diary export capabilities, harden file loading security, and improve code clarity and maintainability.