From 3379c61ad1a59e68b099ac6a88d48725e17389de Mon Sep 17 00:00:00 2001 From: Kurban Sagitov <58472509+krbns@users.noreply.github.com> Date: Fri, 24 Apr 2026 15:20:24 +0300 Subject: [PATCH 1/2] PR:Fix mention pill cut off (#6622) * Fix mention pill cut off * trigger CI after screenshots * trigger CI after screenshots --- .../android/libraries/textcomposer/mentions/MentionSpan.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/mentions/MentionSpan.kt b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/mentions/MentionSpan.kt index b0f973b6b9..e2ae08c421 100644 --- a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/mentions/MentionSpan.kt +++ b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/mentions/MentionSpan.kt @@ -105,15 +105,12 @@ class MentionSpan( bottom: Int, paint: Paint ) { - // Extra vertical space to add below the baseline (y). This helps us center the span vertically - val extraVerticalSpace = y + paint.ascent() + paint.descent() - top - val availableWidth = (canvas.width - x).coerceAtLeast(0f) val measuredWidth = measuredTextWidth + startPadding + endPadding val pillWidth = minOf(availableWidth, measuredWidth.toFloat()) backgroundPaint.color = backgroundColor - val rect = RectF(x, top.toFloat(), x + pillWidth, y.toFloat() + extraVerticalSpace) + val rect = RectF(x, top.toFloat(), x + pillWidth, bottom.toFloat()) val radius = rect.height() / 2 canvas.drawRoundRect(rect, radius, radius, backgroundPaint) From a276e67ce60b2b3a62de0aacb89033626d2efa9c Mon Sep 17 00:00:00 2001 From: ElementBot Date: Fri, 24 Apr 2026 12:38:13 +0000 Subject: [PATCH 2/2] Update screenshots --- ...tcomposer.mentions_MentionSpanThemeInTimeline_Day_0_en.png | 4 ++-- ...omposer.mentions_MentionSpanThemeInTimeline_Night_0_en.png | 4 ++-- ...raries.textcomposer.mentions_MentionSpanTheme_Day_0_en.png | 4 ++-- ...ries.textcomposer.mentions_MentionSpanTheme_Night_0_en.png | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/uitests/src/test/snapshots/images/libraries.textcomposer.mentions_MentionSpanThemeInTimeline_Day_0_en.png b/tests/uitests/src/test/snapshots/images/libraries.textcomposer.mentions_MentionSpanThemeInTimeline_Day_0_en.png index 627828a287..3acdc88bea 100644 --- a/tests/uitests/src/test/snapshots/images/libraries.textcomposer.mentions_MentionSpanThemeInTimeline_Day_0_en.png +++ b/tests/uitests/src/test/snapshots/images/libraries.textcomposer.mentions_MentionSpanThemeInTimeline_Day_0_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8e171ced0a7f9994d1e9addb093959fb455727d81912aecb377742541181535a -size 35733 +oid sha256:c9e68f504334bf51de555c27936d2561f3def8c7920189512594b74ba9770105 +size 35720 diff --git a/tests/uitests/src/test/snapshots/images/libraries.textcomposer.mentions_MentionSpanThemeInTimeline_Night_0_en.png b/tests/uitests/src/test/snapshots/images/libraries.textcomposer.mentions_MentionSpanThemeInTimeline_Night_0_en.png index ee87ced6f5..ed7123fb14 100644 --- a/tests/uitests/src/test/snapshots/images/libraries.textcomposer.mentions_MentionSpanThemeInTimeline_Night_0_en.png +++ b/tests/uitests/src/test/snapshots/images/libraries.textcomposer.mentions_MentionSpanThemeInTimeline_Night_0_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ba17ec26a4807e2cad64769b98140e2d77f133e39be72090a1f44ca143427833 -size 34106 +oid sha256:7523890541aefd0f65533247e0bb0b5c306946b19ab7d27cc8ff0d6e69e85478 +size 34166 diff --git a/tests/uitests/src/test/snapshots/images/libraries.textcomposer.mentions_MentionSpanTheme_Day_0_en.png b/tests/uitests/src/test/snapshots/images/libraries.textcomposer.mentions_MentionSpanTheme_Day_0_en.png index 140398dcaa..aaabcd8f67 100644 --- a/tests/uitests/src/test/snapshots/images/libraries.textcomposer.mentions_MentionSpanTheme_Day_0_en.png +++ b/tests/uitests/src/test/snapshots/images/libraries.textcomposer.mentions_MentionSpanTheme_Day_0_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8366d3c9ea45d6b7e24184b5ba9756cfcfe8a592ec19b107be1168b307840192 -size 49433 +oid sha256:cc5c6f3dc41efa8c969c70ad36c1c4ada0feaf279767d0e2165a5837f568e2e7 +size 49441 diff --git a/tests/uitests/src/test/snapshots/images/libraries.textcomposer.mentions_MentionSpanTheme_Night_0_en.png b/tests/uitests/src/test/snapshots/images/libraries.textcomposer.mentions_MentionSpanTheme_Night_0_en.png index 0c0a38fbd5..508c21c942 100644 --- a/tests/uitests/src/test/snapshots/images/libraries.textcomposer.mentions_MentionSpanTheme_Night_0_en.png +++ b/tests/uitests/src/test/snapshots/images/libraries.textcomposer.mentions_MentionSpanTheme_Night_0_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:79cc95b3838f24e85a87d5f0116575ad74e2abc03b77a28464d7fa82fb357840 -size 47343 +oid sha256:d091d25da896e86e0851cd3d440f7b4b05dfaac6240d9639b06e9e362c20f5ca +size 47304