feat(month): split style with a day pane (#53)
Adds MonthViewStyle.Split: the month compressed to day numbers and event dots over a list of the selected day's events. - The app's first selected-day concept. Every other view drills straight into a date; here a tap selects, because the pane below is already the answer to "what's on this day" and opening a whole screen would defeat the layout. The full Day view stays one tap away on the pane's date header, matching the Week and Agenda headers (#37). - The pane reuses the agenda's row vocabulary (extracted in the groundwork commit) rather than growing a parallel set, so the two surfaces read as one app. It needs no extra provider query: instancesByDay is already covered by the month grid range. - Selection follows the month — today when the new month holds it, else the 1st — so the pane never lists a day the grid isn't showing. Tapping a leading or trailing day follows it to its own month. - Selection and today are different signals (tinted, outlined cell vs. the filled circle the other views use for today), so both read when they land on the same day. - The swipe stays on the grid alone; the pane scrolls and is full of tappable rows. MonthScreen gains onEventClick, wired in CalendarHost alongside the other three views, and MonthUiState.Success now carries its zone for the same reason the agenda's does. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import com.google.common.truth.Truth.assertThat
|
||||
import kotlinx.datetime.DateTimeUnit
|
||||
import kotlinx.datetime.DayOfWeek
|
||||
import kotlinx.datetime.LocalDate
|
||||
import kotlinx.datetime.YearMonth
|
||||
import kotlinx.datetime.plus
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
@@ -101,4 +102,20 @@ class ContinuousWeekIndexTest {
|
||||
loaded = window
|
||||
assertThat(nextLoadWindow(loaded, firstVisible = 2, lastVisible = 7)).isNull()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `the split selection follows the month, landing on today when it's there`() {
|
||||
val today = LocalDate(2026, 6, 10)
|
||||
assertThat(selectionForMonth(YearMonth(2026, kotlinx.datetime.Month.JUNE), today))
|
||||
.isEqualTo(today)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `the split selection falls to the 1st of any other month`() {
|
||||
val today = LocalDate(2026, 6, 10)
|
||||
assertThat(selectionForMonth(YearMonth(2026, kotlinx.datetime.Month.JULY), today))
|
||||
.isEqualTo(LocalDate(2026, 7, 1))
|
||||
assertThat(selectionForMonth(YearMonth(2025, kotlinx.datetime.Month.JUNE), today))
|
||||
.isEqualTo(LocalDate(2025, 6, 1))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user