Browse Source

User display name overflows in timeline messages (#2767)

* User display name overflows in timeline messages

* Update screenshots

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
pull/2771/head
Jorge Martin Espinosa 5 months ago committed by GitHub
parent
commit
eaeebf9e75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      changelog.d/2761.bugfix
  2. 2
      features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/sender/SenderName.kt
  3. 1
      features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemEventRow.kt
  4. BIN
      tests/uitests/src/test/snapshots/images/ui_S_t[f.messages.impl.timeline.components_TimelineItemEventRowLongSenderName_null_TimelineItemEventRowLongSenderName_0_null,NEXUS_5,1.0,en].png
  5. 4
      tests/uitests/src/test/snapshots/images/ui_S_t[f.messages.impl.timeline.components_TimelineItemEventRow_null_TimelineItemEventRow-Day-17_17_null,NEXUS_5,1.0,en].png
  6. 4
      tests/uitests/src/test/snapshots/images/ui_S_t[f.messages.impl.timeline.components_TimelineItemEventRow_null_TimelineItemEventRow-Night-17_18_null,NEXUS_5,1.0,en].png

1
changelog.d/2761.bugfix

@ -0,0 +1 @@ @@ -0,0 +1 @@
User display name overflows in timeline messages when it's way too long.

2
features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/sender/SenderName.kt

@ -93,6 +93,7 @@ private fun RowScope.MainText( @@ -93,6 +93,7 @@ private fun RowScope.MainText(
text = text,
style = style,
color = color,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
}
@ -117,6 +118,7 @@ private fun RowScope.SecondaryText( @@ -117,6 +118,7 @@ private fun RowScope.SecondaryText(
text = text,
style = style,
color = MaterialTheme.colorScheme.secondary,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
}

1
features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemEventRow.kt

@ -701,6 +701,7 @@ internal fun TimelineItemEventRowPreview() = ElementPreview { @@ -701,6 +701,7 @@ internal fun TimelineItemEventRowPreview() = ElementPreview {
sequenceOf(false, true).forEach { isMine ->
ATimelineItemEventRow(
event = aTimelineItemEvent(
senderDisplayName = "Sender with a super long name that should ellipsize",
isMine = isMine,
content = aTimelineItemTextContent().copy(
body = "A long text which will be displayed on several lines and" +

BIN
tests/uitests/src/test/snapshots/images/ui_S_t[f.messages.impl.timeline.components_TimelineItemEventRowLongSenderName_null_TimelineItemEventRowLongSenderName_0_null,NEXUS_5,1.0,en].png (Stored with Git LFS)

Binary file not shown.

4
tests/uitests/src/test/snapshots/images/ui_S_t[f.messages.impl.timeline.components_TimelineItemEventRow_null_TimelineItemEventRow-Day-17_17_null,NEXUS_5,1.0,en].png

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:38d438ae9245b5e7819c3f8c741f89b395956fbb357ddf7570bc457a88a36739
size 183329
oid sha256:6a221ada168ff38af4e6227170ed42e3765d7fdc99f410f72a30680f006cd7f7
size 187751

4
tests/uitests/src/test/snapshots/images/ui_S_t[f.messages.impl.timeline.components_TimelineItemEventRow_null_TimelineItemEventRow-Night-17_18_null,NEXUS_5,1.0,en].png

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cf66a1b76b39b8055875344db3aee4a638df738cb8f6991b55f057c7da05a1be
size 180936
oid sha256:57f411b632ea16f41e56eefbc6f37059f8053469fecfa4f5aaccc6edd467c10b
size 185075

Loading…
Cancel
Save