-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add developer setting to hide images in the timeline #3592
Conversation
f6466a1
to
dd8a6d5
Compare
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
b598afe
to
057943b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once Konsist tests pass, I added a couple of suggestions too.
By the way, this feature seems more like something that would fit in the advanced settings since some users may want this as the default instead. I saw it was decided to add it in developer settings instead, but maybe we'll iterate on that in the future?
timelineController.invokeOnCurrentTimeline { | ||
val replyToDetails = loadReplyDetails(draftType.eventId).map(permalinkParser) | ||
run { messageComposerContext.composerMode = MessageComposerMode.Reply(replyToDetails) } | ||
run { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this run
needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was needed, but not anymore with 6ee0dd32c32f49f1f3fcbc3277efbc01f6fc9d4f.
@@ -35,6 +35,8 @@ import io.element.android.libraries.architecture.Presenter | |||
@Composable | |||
fun TimelineItemEventContentView( | |||
content: TimelineItemEventContent, | |||
hideContent: Boolean, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hideMediaContent
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better, yes: 0bb2fee3fb523664bd052979f937e9a2b7f2899d.
) : Presenter<TimelineProtectionState> { | ||
@Composable | ||
override fun present(): TimelineProtectionState { | ||
val hideContent by appPreferencesStore.doesHideImagesAndVideosFlow().collectAsState(initial = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hideMediaContent
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better, yes: 0bb2fee3fb523664bd052979f937e9a2b7f2899d.
@Composable | ||
override fun present(): TimelineProtectionState { | ||
val hideContent by appPreferencesStore.doesHideImagesAndVideosFlow().collectAsState(initial = false) | ||
var allowedEvents by remember { mutableStateOf<Set<EventId>>(setOf()) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be an immutable Set? I'm not sure if it might affect recompositions in any way, probably not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is simpler to leave it like that.
@@ -72,6 +74,7 @@ import kotlinx.coroutines.launch | |||
@Composable | |||
fun TimelineView( | |||
state: TimelineState, | |||
timelineProtectionState: TimelineProtectionState, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this could be used as a CompositionLocalProvider
? This way we don't have it to explicitly pass it around through so many classes and functions, but it's ok as it is too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add it to TimelineRoomInfo
as it's already passed everywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not easy at the state is computed in MessagesPresenter as I need the state for the MessageComposer. I may revisit this later.
Hide images, videos and stickers in the timeline. Disable click on hidden content. It must be revealed first. Add preview without BlurHash. Also hide image in thumbnails.
… remove `run` block.
c9ef67d
to
1fad4d4
Compare
Quality Gate passedIssues Measures |
Content
Add a switch to the developer settings screen to prevent preview of images, videos and sticker to be rendered automatically in the timeline.
When enabled:
Motivation and context
Closes #3386
Screenshots / GIFs
Waiting for the final design before recording the screenshot.
Tests
Tested devices
Checklist