From 236abc9bb1280ce9be0763e909994be21500ef90 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Thu, 13 Aug 2026 14:29:35 +0200 Subject: [PATCH] Keep the ellipsis in RTL month chips (#164) softWrap=false makes Compose lay the line out at its full width and clip to the node's left edge, so an RTL title lost its beginning instead of its end. RTL keeps the old ellipsis, which truncates at the logical end. --- .../de/jeanlucmakiola/calendula/ui/month/MonthScreen.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/month/MonthScreen.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/month/MonthScreen.kt index 4698cdc..d207c51 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/month/MonthScreen.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/month/MonthScreen.kt @@ -2352,6 +2352,11 @@ private fun MonthBar( }, contentAlignment = Alignment.CenterStart, ) { + // Clipping only keeps the start of the title in an LTR layout: with + // softWrap off Compose lays the line out at its full width and clips to + // the chip's *left* edge, which in RTL is the end of the string. So RTL + // keeps the ellipsis, which truncates at the logical end either way. + val rtl = LocalLayoutDirection.current == LayoutDirection.Rtl Text( text = title, style = MaterialTheme.typography.labelSmall, @@ -2360,8 +2365,8 @@ private fun MonthBar( // couple of readable characters. softWrap is off with it — left on, // a clipped line breaks at the last whole word instead of running to // the chip's edge, which reads as *less* title, not more. - overflow = TextOverflow.Clip, - softWrap = false, + overflow = if (rtl) TextOverflow.Ellipsis else TextOverflow.Clip, + softWrap = rtl, color = eventInk(fill), ) }