Add photos timestamp ordering#106
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds photos timestamp ordering by introducing a new date formatting utility and updating image retrieval methods to return associated timestamps.
- Adds a formatDate function in TimeFormatter to display timestamps in a user-friendly date format
- Updates APIs and UI components in PhotosTabContent to sort and group photos by their creation timestamps
- Refactors related backend client methods to support returning paired image data and timestamps
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| composeApp/src/commonMain/kotlin/com/github/familyvault/utils/TimeFormatter.kt | Added a formatDate method to convert Long timestamps to a formatted date string |
| composeApp/src/commonMain/kotlin/com/github/familyvault/ui/screens/main/filesCabinet/PhotosTabContent.kt | Refactored photo rendering to group and order images by timestamp and updated variable naming |
| composeApp/src/commonMain/kotlin/com/github/familyvault/services/IFileCabinetService.kt | Modified API to return a pair of image bytes and timestamp |
| composeApp/src/commonMain/kotlin/com/github/familyvault/services/FileCabinetService.kt | Updated function return type to match the new data structure |
| composeApp/src/commonMain/kotlin/com/github/familyvault/backend/client/IPrivMxClient.kt | Adjusted method signature to support returning timestamps with image data |
| composeApp/src/androidMain/kotlin/com/github/familyvault/backend/client/PrivMxClient.android.kt | Updated file retrieval to return a pair of image data and its creation timestamp |
Comments suppressed due to low confidence (1)
composeApp/src/commonMain/kotlin/com/github/familyvault/ui/screens/main/filesCabinet/PhotosTabContent.kt:39
- [nitpick] Consider renaming 'imageData' to 'imagesWithTimestamps' to clearly indicate that each element is a pair of image bytes and its timestamp.
var imageData by remember { mutableStateOf<List<Pair<ByteArray, Long>>>(emptyList()) }
There was a problem hiding this comment.
Pull Request Overview
This PR implements timestamp ordering for photos by adding logic to format timestamps into date parts and update image retrieval to include timestamps.
- Introduces a new function (formatDateParts) in TimeFormatter.kt to extract date parts from timestamps.
- Updates PhotosTabContent.kt to group images by date using the new timestamp information and adjusts image retrieval methods.
- Modifies service interfaces and implementations (IFileCabinetService.kt, FileCabinetService.kt, IPrivMxClient.kt, PrivMxClient.android.kt) to return images as pairs (ByteArray, Long) and adds new month string resources.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| composeApp/src/commonMain/kotlin/com/github/familyvault/utils/TimeFormatter.kt | Added new method to extract date parts from timestamps. |
| composeApp/src/commonMain/kotlin/com/github/familyvault/ui/screens/main/filesCabinet/PhotosTabContent.kt | Updated to group images by formatted date and use updated image data type. |
| composeApp/src/commonMain/kotlin/com/github/familyvault/services/IFileCabinetService.kt | Updated method signatures to return image data with timestamps. |
| composeApp/src/commonMain/kotlin/com/github/familyvault/services/FileCabinetService.kt | Refactored to handle paired image bytes and timestamps throughout. |
| composeApp/src/commonMain/kotlin/com/github/familyvault/backend/client/IPrivMxClient.kt | Adjusted return type of file retrieval API. |
| composeApp/src/androidMain/kotlin/com/github/familyvault/backend/client/PrivMxClient.android.kt | Updated implementation to include timestamp information. |
| composeApp/src/commonMain/composeResources/values-*/strings.xml | Added month strings for localization support. |
Comments suppressed due to low confidence (1)
composeApp/src/commonMain/kotlin/com/github/familyvault/ui/screens/main/filesCabinet/PhotosTabContent.kt:156
- The 'maxLineSpan' variable is not defined in the current scope. Please define it or replace it with a concrete value (e.g., 3, matching the fixed grid column count).
item(span = { GridItemSpan(maxLineSpan) }) {
| limit: Long, | ||
| skip: Long | ||
| ): List<ByteArray> { | ||
| ): List<Pair<ByteArray, Long>> { |
There was a problem hiding this comment.
Dla bezpieczeństwa warto wydzielić to do innej metody a ten powinien zostać tak jak był w PrivMxClient, też zamiast Pair<...,...> powinien być jakiś model.


No description provided.