feat: Add detailed logging for message scrolling and reply actions in ChatDetailScreen
This commit is contained in:
@@ -423,16 +423,22 @@ fun ChatDetailScreen(
|
|||||||
|
|
||||||
// 🔥 Функция для скролла к сообщению с подсветкой
|
// 🔥 Функция для скролла к сообщению с подсветкой
|
||||||
val scrollToMessage: (String) -> Unit = { messageId ->
|
val scrollToMessage: (String) -> Unit = { messageId ->
|
||||||
|
android.util.Log.d("ChatDetail", "🔍 scrollToMessage called for: $messageId")
|
||||||
|
android.util.Log.d("ChatDetail", " - Total messages: ${messagesWithDates.size}")
|
||||||
scope.launch {
|
scope.launch {
|
||||||
// Находим индекс сообщения в списке
|
// Находим индекс сообщения в списке
|
||||||
val messageIndex = messagesWithDates.indexOfFirst { it.first.id == messageId }
|
val messageIndex = messagesWithDates.indexOfFirst { it.first.id == messageId }
|
||||||
|
android.util.Log.d("ChatDetail", " - Found at index: $messageIndex")
|
||||||
if (messageIndex != -1) {
|
if (messageIndex != -1) {
|
||||||
// Скроллим к сообщению
|
// Скроллим к сообщению
|
||||||
listState.animateScrollToItem(messageIndex)
|
listState.animateScrollToItem(messageIndex)
|
||||||
|
android.util.Log.d("ChatDetail", " ✅ Scrolled to message")
|
||||||
// Подсвечиваем на 2 секунды
|
// Подсвечиваем на 2 секунды
|
||||||
highlightedMessageId = messageId
|
highlightedMessageId = messageId
|
||||||
delay(2000)
|
delay(2000)
|
||||||
highlightedMessageId = null
|
highlightedMessageId = null
|
||||||
|
} else {
|
||||||
|
android.util.Log.d("ChatDetail", " ❌ Message not found")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1832,7 +1838,10 @@ private fun MessageBubble(
|
|||||||
replyData = reply,
|
replyData = reply,
|
||||||
isOutgoing = message.isOutgoing,
|
isOutgoing = message.isOutgoing,
|
||||||
isDarkTheme = isDarkTheme,
|
isDarkTheme = isDarkTheme,
|
||||||
onClick = { onReplyClick(reply.messageId) }
|
onClick = {
|
||||||
|
android.util.Log.d("ChatDetail", "🖱️ Reply clicked: ${reply.messageId}")
|
||||||
|
onReplyClick(reply.messageId)
|
||||||
|
}
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(4.dp)) // Меньше отступ
|
Spacer(modifier = Modifier.height(4.dp)) // Меньше отступ
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user