Skip to content

feat: add share image to diary entry #340#351

Open
wellorbetter wants to merge 1 commit intoDemizo:masterfrom
wellorbetter:feat/share-image-to-diary
Open

feat: add share image to diary entry #340#351
wellorbetter wants to merge 1 commit intoDemizo:masterfrom
wellorbetter:feat/share-image-to-diary

Conversation

@wellorbetter
Copy link
Copy Markdown

Description

Add "Share to Daily You" to the Android share sheet. When triggered, a new page opens allowing the user to add the shared image to a diary entry — either today's or a date they pick.

Closes #340

Reasoning

Used an Android intent-filter with ACTION_SEND + image/* MIME type to receive shares. A MethodChannel in MainActivity
passes the content URI to Flutter. ShareIntentService converts the URI to a local file path, and ShareToEntryPage handles UI
for date selection and saving to the entry via the existing EntriesProvider / EntryImagesProvider pattern.

Testing

  1. Long-press an image in the gallery → share → select "Daily You" → verify page opens with image preview
  2. Select today → tap "Add to Entry" → verify image appears in today's diary entry
  3. Select a past date → tap "Add to Entry" → verify image is appended to that date's entry
  4. Share to a date with an existing entry → verify image is appended (not replaced)
  5. Tap back/cancel → verify no entry is created
  6. Test with app not running → verify app launches directly to the share page

Type of change

Bug fix
New feature (A non-breaking change that adds functionality)
Breaking change
Refactor
Performance
Style
Docs
Chore

@wellorbetter wellorbetter force-pushed the feat/share-image-to-diary branch 4 times, most recently from 25abcbc to 2a30b45 Compare April 6, 2026 11:01
Copy link
Copy Markdown
Author

@wellorbetter wellorbetter left a comment

Choose a reason for hiding this comment

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

This PR implements receive-share for images (issue #340) — users can share images from gallery/other apps directly into a diary entry.

How it works:

  • Android intent-filter registers the app as a share target for image/*
  • MainActivity handles both cold-start (stores URIs until Flutter is ready) and warm-start (pushes URIs via MethodChannel stream)
  • ShareIntentService bridges Android → Flutter, reads content:// URIs and compresses images
  • ShareToEntryPage lets the user pick today or a custom date, then saves via the existing EntryImagesProvider — no changes to
    existing save logic

What was changed:

  • AndroidManifest.xml — added intent-filter (2 actions)
  • MainActivity.kt — added MethodChannel + intent handling
  • 3 new Flutter files: share_intent_service.dart, share_to_entry_page.dart, share_image_preview.dart
  • Minimal changes to home_page.dart, mobile_scaffold.dart, launch_page.dart, main.dart, launch_intent.dart (routing only)
  • l10n: all 31 languages translated

@wellorbetter wellorbetter marked this pull request as ready for review April 6, 2026 11:09
@wellorbetter wellorbetter force-pushed the feat/share-image-to-diary branch from 2a30b45 to 4ba126c Compare April 13, 2026 07:13
Add 'Share to Daily You' to the Android share sheet. When triggered,
a new page opens allowing the user to add the shared image(s) to a
diary entry — either today's or a date they pick.

- AndroidManifest: intent-filter for ACTION_SEND / ACTION_SEND_MULTIPLE
- MainActivity: MethodChannel bridge for content:// URI reading
- ShareIntentService: cold-start pull + warm-start push handling
- ShareToEntryPage: date selection UI + image compression + save
- ShareImagePreview: content:// aware image preview widget
- LaunchIntent: new ShareFilesIntent variant
- English l10n keys only (translations via Weblate)

Closes Demizo#340
@wellorbetter wellorbetter force-pushed the feat/share-image-to-diary branch from 4ba126c to fe56f9b Compare April 14, 2026 11:44
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.

[Feature Request] Share images to the app itself

1 participant