Open
Conversation
Adds a "Low bandwidth mode on metered connections" toggle in Look and Feel. When enabled and the device is on a metered connection, images and videos are not loaded in post listings.
Image and video posts in card view now show a tappable outlined card with an icon where the expanded media would normally appear. Tapping opens the media viewer; long-pressing shows the link popup.
The post detail screen uses SmallCard mode with expandedImage=false, which skipped the placeholder. Now sets expandedImage=true when both fullBody and lowBandwidthMode are active so the placeholder renders.
Low bandwidth mode now also activates when Android's system-wide Data Saver is enabled and the app isn't whitelisted, even if the user setting is off. Still gated on a metered connection.
Adds a LocalLowBandwidthMode CompositionLocal and a second markwon instance without ClickableCoilImagesPlugin. Inline markdown images (comments, post bodies, private messages, etc.) render as their alt text instead of being fetched.
The alternate markwon parser still went through the default image visitor for markdown  syntax, so images kept loading. Preprocess the markdown source in low bandwidth mode to rewrite both markdown image syntax and HTML img tags as plain links.
MV-GH
reviewed
Apr 10, 2026
MV-GH
reviewed
Apr 10, 2026
MV-GH
reviewed
Apr 10, 2026
app/src/main/java/com/jerboa/ui/components/home/HomeActivity.kt
Outdated
Show resolved
Hide resolved
Collaborator
|
run the formatter If I understand correctly, the "low bandwith mode" just disables the images and videos? If so can you add a disable image setting and low band with mode. the low band mode then disables the images and video setting when enabled. Then use those settings to disable the features. For video it should already be there. Also remove the Also i think it would be better if setting was like this
|
Signed-off-by: cinereal <cinereal@riseup.net>
dessalines
reviewed
Apr 10, 2026
app/src/main/java/com/jerboa/ui/components/common/MarkdownHelper.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/jerboa/ui/components/community/CommunityScreen.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/jerboa/ui/components/home/BottomNavScreen.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/jerboa/ui/components/post/PostListingCard.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/jerboa/ui/components/post/PostListingCard.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/jerboa/ui/components/post/PostListingList.kt
Outdated
Show resolved
Hide resolved
Previously the SmallCard call site used `expandedImage = fullBody && lowBandwidthMode` as an indirect way to force the low-bandwidth media placeholder in the post detail view, which conflated two unrelated concepts. PostTitleBlock now takes fullBody explicitly and the placeholder branch checks `expandedImage || fullBody`, letting the SmallCard caller revert to `expandedImage = false`.
Extract the shared link/thumbnail rendering into a private ThumbnailBox helper so the low bandwidth path can reuse the same placeholder the normal path already falls back to when a thumbnail is absent. This drops the added mid-function `return` in favor of an if/else.
Replace the isVideo boolean parameter of PostTitleAndMediaPlaceholder with a PostLinkType directly, and swap the hard-coded 48.dp icon size for the existing LINK_ICON_SIZE constant.
Replace the regex-based stripInlineImages preprocessing with a small markwon plugin (LinkOnlyImagesPlugin) that installs a SpanFactory returning a URLSpan for commonmark Image nodes. Collapse the two markwon parser fields into one and pick the image plugin at init time based on lowBandwidthMode. Drop the LocalLowBandwidthMode CompositionLocal: MainActivity already computes the effective mode, and now passes it directly to MarkdownHelper.init and to BottomNavScreen so components just receive the boolean instead of recomputing it themselves or reading it from a CompositionLocal.
Introduces a LowBandwidthMode enum (Auto, Always, Never) to replace the previous boolean. Auto activates on metered connections or when Data Saver is enabled; the other states are unconditional. The LookAndFeel screen now exposes this as a dropdown, matching reviewer feedback on the PR.
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.
closes #1594.
disclaimer i used a coding agent in the creation of this patch.