Skip to content

feat: diary entry export functionality and settings integration#32

Merged
SmilingPixel merged 11 commits into
mainfrom
feat/file_export_0614
Jul 5, 2026
Merged

feat: diary entry export functionality and settings integration#32
SmilingPixel merged 11 commits into
mainfrom
feat/file_export_0614

Conversation

@SmilingPixel

Copy link
Copy Markdown
Owner

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 LocalFileFetcher to enforce stricter URI validation and enhance security, and updates to UI and tests to support these features.

Diary Entry Export Functionality:

  • Added a cross-platform diary entry export API in DiaryEntryExport.kt, including result types and logic for exporting diary entries as files.
  • Implemented Android-specific export logic in DiaryEntryExport.android.kt, which writes exported files to a cache directory and launches the Android share sheet. [1] [2]
  • Added an "Export Diary Entries" button to the SettingsScreen, which invokes the export functionality and displays results to the user. [1] [2] [3]

Local File URI Handling and Security:

  • Refined LocalFileFetcher.Factory to only accept canonical, safe URIs of the form localfile:///filename, rejecting URIs with authorities, nested paths, or directory traversal attempts. Updated documentation and logic accordingly.
  • Updated regular expressions and usages in EntryDetailsScreen to match the stricter URI format.
  • Improved error logging to avoid exceptions if logging fails.
  • Updated comments and test cases to reflect the new URI requirements. [1] [2] [3]

Repository and Sync Improvements:

  • Updated DiaryRepository to accept a SettingsRepository and pass it to sync tombstone recording, improving dependency management. [1] [2] [3]
  • Renamed and documented the sync entry file name builder for consistency and reuse across export and sync features. [1] [2] [3]

Test and Documentation Updates:

  • Expanded test coverage for LocalFileFetcher to ensure only valid URIs are accepted and unsafe or malformed URIs are rejected. [1] [2]
  • Updated documentation and comments throughout the codebase for clarity and accuracy regarding URI formats and export behavior. [1] [2]

These changes collectively add user-facing diary export capabilities, harden file loading security, and improve code clarity and maintainability.

@SmilingPixel SmilingPixel requested a review from Copilot June 29, 2026 02:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@SmilingPixel SmilingPixel requested a review from Copilot June 30, 2026 22:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

@SmilingPixel SmilingPixel merged commit 820cf14 into main Jul 5, 2026
3 checks passed
@SmilingPixel SmilingPixel deleted the feat/file_export_0614 branch July 5, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants