fix(chat): 来源角标改挂到消息组末尾
角标应紧随它标注的那条消息(主人右下、昔涟左下),放在上方会显得在标注下一条。
This commit is contained in:
1 parent
6323f89b5b
commit
a8a422c4e1
1 file changed
+6
-6
@@ -54,7 +54,12 @@ fun MessageBubble(message: HistoryMessageDto) {
|
|||||||
horizontalAlignment = if (isUser) Alignment.End else Alignment.Start,
|
horizontalAlignment = if (isUser) Alignment.End else Alignment.Start,
|
||||||
verticalArrangement = Arrangement.spacedBy(6.dp),
|
verticalArrangement = Arrangement.spacedBy(6.dp),
|
||||||
) {
|
) {
|
||||||
// 来源角标放在消息组顶部,明确标注下面这一组气泡来自哪里
|
bubbles.forEach { bubble ->
|
||||||
|
AnnotationLine(bubble.head)
|
||||||
|
if (bubble.body.isNotEmpty()) BubbleBody(bubble.body, isUser)
|
||||||
|
AnnotationLine(bubble.tail)
|
||||||
|
}
|
||||||
|
// 来源角标挂在消息组末尾,紧随它标注的那条消息(主人右下、昔涟左下)
|
||||||
if (source != null) {
|
if (source != null) {
|
||||||
Text(
|
Text(
|
||||||
text = source,
|
text = source,
|
||||||
@@ -63,11 +68,6 @@ fun MessageBubble(message: HistoryMessageDto) {
|
|||||||
modifier = Modifier.padding(start = 6.dp, end = 6.dp),
|
modifier = Modifier.padding(start = 6.dp, end = 6.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
bubbles.forEach { bubble ->
|
|
||||||
AnnotationLine(bubble.head)
|
|
||||||
if (bubble.body.isNotEmpty()) BubbleBody(bubble.body, isUser)
|
|
||||||
AnnotationLine(bubble.tail)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user