Merge release/v2.14.0 into chore/floret-implementation
Brings the 2.14.0 feature set (Month week numbers, .ics restore + per-calendar export picker, Day view on date-header tap, wrapped long titles, Simplified Chinese) onto the floret-kit migration without resurrecting the inline component copies the kit now owns. Conflict resolutions (both were import-block collisions where the migration repointed to de.jeanlucmakiola.floret.* while release kept the old app-local imports): - CalendarsScreen.kt: keep the kit imports (CollapsingScaffold, DialogAmountField/DialogUnitDropdown, collapseExit/expandEnter, predictiveBack) and repoint FullScreenPicker + positionOf to the kit (both moved out of ui.common). Keep the genuinely app-local LeadingAvatar/SourceLogo/curatedSourcePackage; drop the renamed calendarCollapseExit/calendarExpandEnter (0 uses). - ImportScreen.kt: keep the app-local CalendarPickerGroups, use the kit's predictiveBack, drop the now-unused OptionCard import. Semantic fixup: CalendarPickerGroups.kt (new in 2.14.0) relied on same-package resolution of GroupedRow/Position, which the migration moved to the kit — added the explicit floret.components imports. Verified: :app:compileDebugKotlin, ./gradlew test (app + kit), and scripts/check_translations.py all green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -536,6 +536,30 @@ class CalendarRepositoryImplTest {
|
||||
assertThat(fake.importedEvents.map { it.second }).containsExactly(3L, 3L)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `exportEvents forwards the chosen calendar-id subset to the data source`(
|
||||
@TempDir tempDir: Path,
|
||||
) = runTest {
|
||||
val fake = FakeCalendarDataSource()
|
||||
val repo = CalendarRepositoryImpl(fake, newPrefs(tempDir), newSettings(tempDir), Dispatchers.Unconfined)
|
||||
|
||||
repo.exportEvents(calendarIds = setOf(1L, 4L))
|
||||
|
||||
assertThat(fake.lastExportableEventsCalendarIds).containsExactly(1L, 4L)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `exportEvents defaults to null so every eligible calendar is exported`(
|
||||
@TempDir tempDir: Path,
|
||||
) = runTest {
|
||||
val fake = FakeCalendarDataSource()
|
||||
val repo = CalendarRepositoryImpl(fake, newPrefs(tempDir), newSettings(tempDir), Dispatchers.Unconfined)
|
||||
|
||||
repo.exportEvents()
|
||||
|
||||
assertThat(fake.lastExportableEventsCalendarIds).isNull()
|
||||
}
|
||||
|
||||
private fun parsedEvent(uid: String?) = de.jeanlucmakiola.calendula.domain.ics.ParsedIcsEvent(
|
||||
uid = uid,
|
||||
summary = "E",
|
||||
|
||||
@@ -23,6 +23,8 @@ internal class FakeCalendarDataSource : CalendarDataSource {
|
||||
var eventDetailResult: (Long) -> EventDetail? = { null }
|
||||
var eventColorPaletteResult: (Long) -> List<EventColorOption> = { emptyList() }
|
||||
var exportableEventsResult: List<IcsEvent> = emptyList()
|
||||
/** The [calendarIds] the last [exportableEvents] call received (null = all). */
|
||||
var lastExportableEventsCalendarIds: Set<Long>? = null
|
||||
/** UIDs the target calendar already holds, for import dedup. */
|
||||
var existingUidsResult: Set<String> = emptySet()
|
||||
/** Set to make the next write call throw. */
|
||||
@@ -59,7 +61,10 @@ internal class FakeCalendarDataSource : CalendarDataSource {
|
||||
override fun eventDetail(eventId: Long): EventDetail? = eventDetailResult(eventId)
|
||||
override fun eventColorPalette(calendarId: Long): List<EventColorOption> =
|
||||
eventColorPaletteResult(calendarId)
|
||||
override fun exportableEvents(): List<IcsEvent> = exportableEventsResult
|
||||
override fun exportableEvents(calendarIds: Set<Long>?): List<IcsEvent> {
|
||||
lastExportableEventsCalendarIds = calendarIds
|
||||
return exportableEventsResult
|
||||
}
|
||||
|
||||
override fun existingUids(calendarId: Long): Set<String> = existingUidsResult
|
||||
|
||||
|
||||
@@ -97,6 +97,14 @@ class SettingsPrefsTest {
|
||||
assertThat(prefs.showHourLines.first()).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `week numbers default off and round-trips`(@TempDir tempDir: Path) = runTest {
|
||||
val prefs = SettingsPrefs(newDataStore(tempDir))
|
||||
assertThat(prefs.showWeekNumbers.first()).isFalse()
|
||||
prefs.setShowWeekNumbers(true)
|
||||
assertThat(prefs.showWeekNumbers.first()).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `autofocus event title defaults on and round-trips`(@TempDir tempDir: Path) = runTest {
|
||||
val prefs = SettingsPrefs(newDataStore(tempDir))
|
||||
|
||||
Reference in New Issue
Block a user