Skip to content

Add photos timestamp ordering#106

Open
adama789 wants to merge 3 commits into
mainfrom
FilesTimestamp
Open

Add photos timestamp ordering#106
adama789 wants to merge 3 commits into
mainfrom
FilesTimestamp

Conversation

@adama789

Copy link
Copy Markdown
Contributor

No description provided.

@adama789 adama789 requested a review from pawl0wski May 12, 2025 19:19
@sazonek sazonek requested a review from Copilot May 12, 2025 19:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()) }

Comment thread composeApp/src/commonMain/kotlin/com/github/familyvault/utils/TimeFormatter.kt Outdated

@6ajmon 6ajmon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nazwy miesięcy są po angielsku
image

@6ajmon

6ajmon commented May 20, 2025

Copy link
Copy Markdown
Contributor

Do dokumentów też chyba można dodać te timestampy
image

@6ajmon 6ajmon requested review from 6ajmon, bwisniewski26, Copilot, pawl0wski and sazonek and removed request for pawl0wski May 21, 2025 12:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CABINET] Poprawić wyświetlany ekran gdy nie ma żadnych zdjęć lub dokumentów

4 participants