-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: Enable navigation from NotificationsInbox to Discussion #84
base: 2U/develop
Are you sure you want to change the base?
Conversation
fa14fa1
to
06d81a9
Compare
06d81a9
to
3279131
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.
Just some coments
comments.remove(comment) | ||
comments.add(0, comment!!) | ||
} | ||
} |
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.
First: need to adjust formatting here
Second: comments.find {}
is running 2 times here is some cases
@@ -379,6 +397,10 @@ private fun DiscussionCommentsScreen( | |||
onUserPhotoClick = { | |||
onUserPhotoClick(comment.author) | |||
}) | |||
if (fromNotificationNavigation && commentId.isNotEmpty() && responseId == comment.id) { |
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 it's better to move this to Effect? It's strange for me to execute onCommentClick lambda inside the compose graph
val index = | ||
uiState.data.indexOfFirst { it.id == threadId } | ||
if (index != -1) { | ||
onItemClick(uiState.data[index]) |
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.
the same here, the onItemClick
is executed in the middle of the compose function
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.
-
Error handling needs to be considered part of this PR.
Error Handling:
Manage cases where a notification links to a deleted or unavailable discussion, with clear messaging to the user. This should be a toast message.
Error copy: “Unable to retrieve comment/response.” -
IMO, its better to add the following properties in
Notification:Notification Tapped
event.course_id
notification_id
topic_id
post_id
response_id
comment_id
.
-
Need to eliminate the flickering effect during navigation if feasible with minimal effort (can be considered in Notification V2).
-
IMO, its better to navigate in the following order if feasible with minimal effort (can be considered in Notification V2)
Notification Inbox -> Course Dashboard -> Course Discussion tab -> All posts -> Discussion Detail Screen -> Response Details screen.
Error Handing on Notification Inbox screen is already handled, for discussion module we can handle it in a separate ticket.
There is a ticket in a backlog for analytic improvement, we can cover these suggestions in that ticket.
Yes, we can improve this in V2.
|
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.
A few minor suggestions, otherwise, it looks good to me!
try { | ||
headers.forEach { | ||
val startIndex = text.indexOf(it) | ||
val endIndex = startIndex + it.length + 1 | ||
result = text.replaceRange(startIndex, endIndex, it + "\n") | ||
} | ||
} catch (e: Exception) { | ||
e.printStackTrace() |
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.
use case for this code change?
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.
The server was passing an incorrect HTML string, which caused the exception and prevented the app from parsing the data.
mutableStateOf(threadId.isNotEmpty()) | ||
} | ||
|
||
LaunchedEffect(uiState is DiscussionThreadsUIState.Threads) { |
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.
IMO better to use LaunchedEffect(uiState)
.
var fromNotificationNavigation by rememberSaveable { | ||
mutableStateOf(viewModel.responseId.isNotEmpty() && viewModel.commentId.isNotEmpty()) | ||
} | ||
LaunchedEffect(uiState is DiscussionCommentsUIState.Success) { |
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.
IMO better to use LaunchedEffect(uiState).
- Allows users to move from the NotificationsInbox screen to the Discussion component fix: LEARNER-10373
8f4a00e
to
e84a72d
Compare
Description:
fix: LEARNER-10373
PushNotificationsFlow.webm