From ea2472468bc7f468d22c2adf51f3dce5dc7c55a9 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 30 Jul 2026 15:11:56 +0000 Subject: [PATCH] feat: share images, shorts and videos straight into their feeds Adds three share targets next to "New Post", "Send as DM" and "New Highlight": - New Picture (image/*) -> the picture feed's composer, publishing a NIP-68 kind 20 picture post - New Short (video/*) -> the Shorts feed's composer, publishing a NIP-71 kind 22 short - New Video (video/*) -> the Video feed's composer, publishing a NIP-71 video event Until now every SEND intent landed in the kind-1 composer, so a shared picture became a text note with a link instead of a post in the feed the user was aiming for. Each alias resolves to MainActivity like the existing ones, so ShareIntentRouting now maps the launching component class to a ShareTarget enum instead of a growing chain of isShareAsX() booleans. The media targets navigate to the destination feed carrying the shared content URI, and the feed's existing composer button opens on it. Video kind is no longer guessed from orientation alone in feeds that only read one of the two kinds: the Shorts composer always publishes kind 22 and the Longs composer always publishes kind 21, so a post lands in the feed it was composed from whatever the footage's shape. The mixed Video feed and the picture feed keep the automatic choice. Also fixes the New Post launch path passing the literal string "null" as the attachment when a share carried no media. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01R4WsYWaNMPD34SBc6Ej6hx --- amethyst/src/main/AndroidManifest.xml | 51 +++++++ .../vitorpamplona/amethyst/model/Account.kt | 6 +- .../amethyst/model/VideoPostKind.kt | 53 ++++++++ .../amethyst/ui/actions/NewMediaModel.kt | 7 + .../amethyst/ui/actions/NewMediaView.kt | 6 +- .../amethyst/ui/navigation/AppNavigation.kt | 125 ++++++++++-------- .../ui/navigation/ShareIntentRouting.kt | 59 ++++++++- .../ui/navigation/bottombars/NavBarItem.kt | 6 +- .../amethyst/ui/navigation/routes/Routes.kt | 24 +++- .../loggedIn/longs/NewLongVideoButton.kt | 6 + .../loggedIn/pictures/NewPictureButton.kt | 14 ++ .../loggedIn/pictures/PicturesScreen.kt | 9 +- .../loggedIn/shorts/NewShortVideoButton.kt | 18 +++ .../ui/screen/loggedIn/shorts/ShortsScreen.kt | 9 +- .../screen/loggedIn/video/NewImageButton.kt | 17 +++ .../ui/screen/loggedIn/video/VideoScreen.kt | 9 +- amethyst/src/main/res/values/strings.xml | 3 + .../amethyst/model/VideoPostKindTest.kt | 56 ++++++++ .../navigation/ShareIntentRoutingTest.kt | 36 +++-- 19 files changed, 424 insertions(+), 90 deletions(-) create mode 100644 amethyst/src/main/java/com/vitorpamplona/amethyst/model/VideoPostKind.kt create mode 100644 amethyst/src/test/java/com/vitorpamplona/amethyst/model/VideoPostKindTest.kt diff --git a/amethyst/src/main/AndroidManifest.xml b/amethyst/src/main/AndroidManifest.xml index 7ef7b9f0c9..4ab04778a6 100644 --- a/amethyst/src/main/AndroidManifest.xml +++ b/amethyst/src/main/AndroidManifest.xml @@ -295,6 +295,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +