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 ->
|
||||
android.util.Log.d("ChatDetail", "🔍 scrollToMessage called for: $messageId")
|
||||
android.util.Log.d("ChatDetail", " - Total messages: ${messagesWithDates.size}")
|
||||
scope.launch {
|
||||
// Находим индекс сообщения в списке
|
||||
val messageIndex = messagesWithDates.indexOfFirst { it.first.id == messageId }
|
||||
android.util.Log.d("ChatDetail", " - Found at index: $messageIndex")
|
||||
if (messageIndex != -1) {
|
||||
// Скроллим к сообщению
|
||||
listState.animateScrollToItem(messageIndex)
|
||||
android.util.Log.d("ChatDetail", " ✅ Scrolled to message")
|
||||
// Подсвечиваем на 2 секунды
|
||||
highlightedMessageId = messageId
|
||||
delay(2000)
|
||||
highlightedMessageId = null
|
||||
} else {
|
||||
android.util.Log.d("ChatDetail", " ❌ Message not found")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1832,7 +1838,10 @@ private fun MessageBubble(
|
||||
replyData = reply,
|
||||
isOutgoing = message.isOutgoing,
|
||||
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)) // Меньше отступ
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user