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 <noreply@anthropic.com>
This commit is contained in:
xfy 2026-05-15 13:12:58 +08:00
parent f189c188c7
commit c8921e8641
2 changed files with 3 additions and 2 deletions

View File

@ -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(

View File

@ -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))