-
Notifications
You must be signed in to change notification settings - Fork 743
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
Feature/aris/threads analytics #5378
Conversation
…/threads_analytics
…/threads_analytics # Conflicts: # vector/src/main/java/im/vector/app/features/analytics/plan/Interaction.kt
…/threads_analytics
@@ -188,6 +189,9 @@ class MessageComposerViewModel @AssistedInject constructor( | |||
|
|||
private fun handleSendMessage(action: MessageComposerAction.SendMessage) { | |||
withState { state -> | |||
analyticsTracker.capture(state.toAnalyticsComposer()).also { | |||
setState { copy(startsThread = 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.
I'm wondering if there's a way to avoid this mutable state but I guess we need to be sure we only track the first message
import im.vector.app.features.home.room.detail.composer.MessageComposerViewState | ||
import im.vector.app.features.home.room.detail.composer.SendMode | ||
|
||
fun MessageComposerViewState.toAnalyticsComposer(): Composer = |
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.
tiny formatting comment (ideally the formatter would do this for us), the kotlin convention is typically to move the closing )
to a new line
fun MessageComposerViewState.toAnalyticsComposer() = Composer(
inThread = isInThreadTimeline(),
isEditing = sendMode is SendMode.Edit,
isReply = sendMode is SendMode.Reply,
startsThread = startsThread
)
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! some tiny comments on formatting (until we have a way to enforce a convention or written examples it's not a blocker for me, but would be great to update)
will leave merging up to you @ariskotsomitopoulos
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.
💯
This PR add analytics support for threads and closes #4910
Note: This PR requires Live Threads PR to be merged first, let's make this PR draft until we merge the prerequisite PR