Skip to content

Conversation

@baillyjamy
Copy link
Contributor

image
@baillyjamy baillyjamy requested a review from a team December 3, 2025 08:12
Comment on lines 701 to 706
data class CombineMessageToBuildMessageUi(
val mode: ThreadOpeningMode,
val featureFlags: Mailbox.FeatureFlagSet,
val fakeReactions: Map<String, Set<String>>,
val messageUidUnsubscribed: List<String>
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be private

snackbarManager.postValue(appContext.getString(R.string.snackbarUnsubscribeSuccess))
messageUidUnsubscribed.value += message.uid
} else {
snackbarManager.postValue(appContext.getString(R.string.snackbarUnsubscribeFailure))
Copy link
Contributor

Choose a reason for hiding this comment

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

When there's an error it'd be great to translate the error because I think this could return some generic errors already translate inside translateError() to the user. Maybe this needs to be looked into.

Right now, the wording seems off, if you simply timed out, we're saying to the user that unsubscribing from this email is not possible. I feel like unsubscribing is possible, we simply failed to unsubscribe. That's how I see it.

unsubscribeAlert.isVisible = true
unsubscribeAlert.setDescription(context.resources.getString(R.string.messageComesFromDiscussionList))
unsubscribeAlert.setAction1Text(context.resources.getString(R.string.unsubscribeButtonTitle))
unsubscribeAlert.onAction1 { threadAdapterCallbacks?.unsubscribeClicked?.invoke(messageUi.message) }
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to make the action button start loading while we make the api call so if you have a slow internet connection it will show you something is happening instead of letting you wondering if something is happening at all.

I think we already did the alert button loading using showAction1Progress() for the snooze scheduling alert for example

}

object MessageDiffAspect {
interface MessageDiffAspect {
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to make it an interface if you only did this to create a companion object because variables at the top level of an object are already static just like a companion object

message.shouldHideDivider == oldMessage.message.shouldHideDivider
})

data object Unsubscribe : DiffAspect<MessageUi>({ hasUnsubscribeButton == it.hasUnsubscribeButton })
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe keep "AnythingElse" as the last defined DiffAspect so "anything else" makes sense when you read it in order I think

navigateToDownloadProgressDialog(attachment, attachmentIntentType, ThreadFragment::class.java.name)
},
unsubscribeClicked = threadViewModel::unsubscribeMessage,
//unsubscribeClicked = { message -> threadViewModel.unsubscribeMessage(message) },
Copy link
Contributor

Choose a reason for hiding this comment

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

You probably don't need that one anymore

Suggested change
//unsubscribeClicked = { message -> threadViewModel.unsubscribeMessage(message) },
Comment on lines 591 to 592
unsubscribeAlert.setDescription(context.resources.getString(R.string.messageComesFromDiscussionList))
unsubscribeAlert.setAction1Text(context.resources.getString(R.string.unsubscribeButtonTitle))
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks useless, isn't setting this inside the xml enough?

Comment on lines 1 to 5
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:viewportHeight="16" android:viewportWidth="16" android:width="24dp">

<path android:fillColor="#666666" android:fillType="evenOdd" android:pathData="M5.066,2.16C4.219,2.16 3.407,2.499 2.81,3.101C2.212,3.703 1.877,4.518 1.877,5.368C1.877,6.217 2.212,7.033 2.81,7.635C3.217,8.045 3.723,8.332 4.272,8.474C3.266,8.641 2.329,9.12 1.6,9.855C0.681,10.78 0.166,12.033 0.166,13.34C0.166,13.473 0.219,13.6 0.312,13.694C0.406,13.787 0.533,13.84 0.666,13.84H9.466C9.599,13.84 9.726,13.787 9.82,13.694C9.913,13.6 9.966,13.473 9.966,13.34C9.966,12.033 9.451,10.78 8.532,9.855C7.803,9.12 6.866,8.641 5.86,8.474C6.409,8.332 6.915,8.045 7.322,7.635C7.92,7.033 8.255,6.217 8.255,5.368C8.255,4.518 7.92,3.703 7.322,3.101C6.724,2.499 5.913,2.16 5.066,2.16ZM12.033,4.62C11.365,4.62 10.724,4.888 10.253,5.363C9.781,5.838 9.517,6.481 9.517,7.151C9.517,7.821 9.781,8.464 10.253,8.939C10.556,9.245 10.929,9.464 11.335,9.582C11.048,9.636 10.769,9.723 10.503,9.841C10.377,9.897 10.279,10.002 10.234,10.133C10.188,10.264 10.199,10.407 10.263,10.53C10.707,11.379 10.961,12.367 10.961,13.34C10.961,13.616 11.185,13.84 11.461,13.84L15.334,13.84C15.466,13.84 15.594,13.787 15.687,13.694C15.781,13.6 15.834,13.473 15.834,13.34C15.834,12.327 15.434,11.355 14.722,10.638C14.176,10.089 13.481,9.723 12.733,9.582C13.138,9.464 13.511,9.245 13.814,8.939C14.286,8.464 14.55,7.821 14.55,7.151C14.55,6.481 14.286,5.838 13.814,5.363C13.343,4.888 12.702,4.62 12.033,4.62Z"/>

</vector>
Copy link
Contributor

Choose a reason for hiding this comment

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

You can reformat the file and add the copyright

Copy link
Contributor

@FabianDevel FabianDevel left a comment

Choose a reason for hiding this comment

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

Just blocking this because the api isn't ready yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants