From 8c76cbdf5e9bd7974ca7c99ec9520b7462c36a8a Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Thu, 13 Aug 2026 15:26:31 +0200 Subject: [PATCH] Show as much of a month event title as fits (#164) (#183) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Month-view event titles no longer truncate with "…". `MonthBar` — the single chip renderer for every month style and for the drag's floating copy — now uses `TextOverflow.Clip` with `softWrap = false`, so a title runs to the chip's edge and clips mid-glyph instead of spending two characters' width on an ellipsis. `softWrap = false` is load-bearing: `Clip` on its own still breaks a `maxLines = 1` line at the last whole word, so "Team standup meeting" would render as "Team" — less title than the ellipsis showed, not more. Deviation from the issue: right-to-left layouts keep the ellipsis. With `softWrap` off Compose lays the line out at its full intrinsic width and clips to the node's left edge, which in RTL is the *end* of the string — an Arabic title would have lost its beginning. `Ellipsis` truncates at the logical end in both directions, so RTL keeps it. The Glance month widget needs nothing: its `Text` has no overflow parameter, and a RemoteViews `TextView` with `maxLines = 1` and no ellipsize already clips. Closes #164 Co-authored-by: Jean-Luc Makiola Reviewed-on: https://codeberg.org/jlmakiola/calendula/pulls/183 --- CHANGELOG.md | 8 ++++++++ .../jeanlucmakiola/calendula/ui/month/MonthScreen.kt | 12 +++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 399b5d9..5da84d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed +- Month-view event titles no longer end in an ellipsis. The "…" took the width + of a couple of characters and told you nothing you couldn't already see, so + the title now simply runs to the edge of its chip — a few more letters per + cell, which is often the difference between two events you can tell apart and + two you can't ([#164]). + ## [2.19.1] — 2026-08-11 ### Added @@ -1414,3 +1421,4 @@ automatically, with zero telemetry and no internet permission. [#123]: https://codeberg.org/jlmakiola/calendula/issues/123 [#163]: https://codeberg.org/jlmakiola/calendula/issues/163 [#173]: https://codeberg.org/jlmakiola/calendula/issues/173 +[#164]: https://codeberg.org/jlmakiola/calendula/issues/164 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 ffcccf6..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,11 +2352,21 @@ 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, maxLines = 1, - overflow = TextOverflow.Ellipsis, + // No "…" (#164): the chip is narrow enough that the ellipsis costs a + // 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 = if (rtl) TextOverflow.Ellipsis else TextOverflow.Clip, + softWrap = rtl, color = eventInk(fill), ) }