From c8921e864142c24e31aa7c699d6dee3c2532fff7 Mon Sep 17 00:00:00 2001 From: xfy Date: Fri, 15 May 2026 13:12:58 +0800 Subject: [PATCH] Fix calendar height jitter when collapsing to week view WeekPager had no height constraint (unlike CalendarPager which uses pagerModifier with gridHeightPx), causing the pager to freely expand instead of staying at the computed single-row height. Also, WeekPager used 2dp row padding while CalendarMonthPage uses ROW_PADDING_DP (4dp), creating a height mismatch at the switch point. Co-Authored-By: Claude Opus 4.7 --- .../commonMain/kotlin/plus/rua/project/ui/CalendarMonthView.kt | 3 ++- shared/src/commonMain/kotlin/plus/rua/project/ui/WeekPager.kt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthView.kt b/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthView.kt index 4500e94..b780b47 100644 --- a/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthView.kt +++ b/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthView.kt @@ -147,7 +147,8 @@ fun CalendarMonthView( val weekSunday = weekMonday.plus(DatePeriod(days = 6)) val date = if (today in weekMonday..weekSunday) today else weekMonday viewModel.selectDate(date) - } + }, + modifier = pagerModifier ) } else { CalendarPager( diff --git a/shared/src/commonMain/kotlin/plus/rua/project/ui/WeekPager.kt b/shared/src/commonMain/kotlin/plus/rua/project/ui/WeekPager.kt index 770ad70..e424b75 100644 --- a/shared/src/commonMain/kotlin/plus/rua/project/ui/WeekPager.kt +++ b/shared/src/commonMain/kotlin/plus/rua/project/ui/WeekPager.kt @@ -57,7 +57,7 @@ fun WeekPager( Row( modifier = Modifier .fillMaxWidth() - .padding(vertical = 2.dp) + .padding(vertical = ROW_PADDING_DP.dp) ) { (0 until 7).forEach { dayOffset -> val date = weekMonday.plus(DatePeriod(days = dayOffset))