Detect image URLs in post composer and display previews + add carousel picture counter badge #3474
+483
−81
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
Detect image URLs in the post composer and display them as image previews. When users type or paste image URLs (jpg, jpeg, png, gif, webp, svg), the URLs are automatically detected and converted to image previews in the media carousel. The URL is removed from the post text to avoid duplication (it gets re-added when posting via the existing
build_post()logic).Features:
#) which don't return actual images (e.g., Wikipedia media viewer URLs)Checklist
Standard PR Checklist
Closes:orFixes:tags in the commit messages wherever applicable, or made sure those are not needed. See Submitting patchesTest report
Device: iPhone 17 Pro Simulator
iOS: 26
Damus: 2bcef51
Setup: Fresh install on simulator
Steps:
https://upload.wikimedia.org/wikipedia/commons/thumb/8/8a/Banana-Single.jpg/800px-Banana-Single.jpg) followed by a spacehttps://example.com/page#image.png) are not detectedResults:
Other notes