diff --git a/src/main/kotlin/com/bolenpad/photophetch/ui/BrowseScreen.kt b/src/main/kotlin/com/bolenpad/photophetch/ui/BrowseScreen.kt index bc0c742..476af23 100644 --- a/src/main/kotlin/com/bolenpad/photophetch/ui/BrowseScreen.kt +++ b/src/main/kotlin/com/bolenpad/photophetch/ui/BrowseScreen.kt @@ -191,12 +191,6 @@ fun BrowseScreen(state: AppState) { // ─── Data helpers ────────────────────────────────────────────────────────────── -private data class FolderSection( - val folder: FolderInfo, - val byDay: List>>, - val allPhotos: List, -) - private fun buildFolderSections(pl: PhotoListState.Loaded): List { val zoneId = java.time.ZoneId.systemDefault() return pl.folders.map { folder -> @@ -400,7 +394,7 @@ private fun UnifiedPhotoScroll( } @Composable -private fun FolderDividerHeader( +internal fun FolderDividerHeader( name: String, total: Int, selected: Int, diff --git a/src/main/kotlin/com/bolenpad/photophetch/ui/DensePhotoGrid.kt b/src/main/kotlin/com/bolenpad/photophetch/ui/DensePhotoGrid.kt index d8397ab..4115ce3 100644 --- a/src/main/kotlin/com/bolenpad/photophetch/ui/DensePhotoGrid.kt +++ b/src/main/kotlin/com/bolenpad/photophetch/ui/DensePhotoGrid.kt @@ -47,7 +47,7 @@ import java.time.format.DateTimeFormatter */ @Composable fun DensePhotoGrid( - folderSections: List, + folderSections: List, selectedPhotos: Set, device: DeviceInfo?, adbBin: String, @@ -69,13 +69,6 @@ fun DensePhotoGrid( val scope = rememberCoroutineScope() // Build flat item list: folder header + photo rows per section - data class GridItem( - val type: GridItemType, - val folderSection: com.bolenpad.photophetch.ui.FolderSection? = null, - val rowPhotos: List? = null, - ) - enum class GridItemType { FOLDER_HEADER, PHOTO_ROW } - val items: List = buildList { folderSections.forEach { section -> if (section.allPhotos.isEmpty()) return@forEach diff --git a/src/main/kotlin/com/bolenpad/photophetch/ui/GridModels.kt b/src/main/kotlin/com/bolenpad/photophetch/ui/GridModels.kt new file mode 100644 index 0000000..58c049a --- /dev/null +++ b/src/main/kotlin/com/bolenpad/photophetch/ui/GridModels.kt @@ -0,0 +1,21 @@ +package com.bolenpad.photophetch.ui + +import com.bolenpad.photophetch.model.PhonePhoto +import java.time.LocalDate + +/** A folder's photos grouped by day, used by both Grouped and Dense grid views */ +data class FolderSection( + val folder: FolderInfo, + val byDay: List>>, + val allPhotos: List, +) + +/** Item types used in the DensePhotoGrid flat list */ +enum class GridItemType { FOLDER_HEADER, PHOTO_ROW } + +/** A single item in the DensePhotoGrid flat list */ +data class GridItem( + val type: GridItemType, + val folderSection: FolderSection? = null, + val rowPhotos: List? = null, +)