From 63ba69729e50cf4a777a71294e49847de1ec8a42 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Mon, 20 Jul 2026 19:57:29 +0200 Subject: [PATCH] fix(month): keep the selection outline off the morphing cell (#53) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drawn on the cell's morphing pill, the outline rode its shared bounds — so collapsing painted it at the *expanded* cell's size and shrank it down, a full-height outline flashing over a grid that no longer had full-height cells. The same shape of mistake as the marker that used to cross the outgoing month during a page turn. It gets its own untagged layer, laid out where the collapsed cell actually is, and fades in there. That is the only size it is ever true at. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../jeanlucmakiola/calendula/ui/month/MonthScreen.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 c8dc4af..a8d1882 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 @@ -1320,7 +1320,17 @@ private fun SplitDayCell( .fillMaxSize() .morphElement(MonthMorphKey.Cell(date)) .clip(CELL_SHAPE) - .background(background) + .background(background), + ) + // The outline is a layer of its own, deliberately *untagged*. Drawn on the + // morphing pill it rode the cell's shared bounds, so collapsing painted it + // at the expanded cell's size and shrank it down — a full-height outline + // flashing over a grid that no longer had full-height cells. Untagged it + // is laid out where the collapsed cell actually is and simply fades in, + // which is the only size it is ever true at. + Box( + Modifier + .fillMaxSize() .border( width = 1.5.dp, color = MaterialTheme.colorScheme.primary.copy(alpha = selection),