Skip to content

feat: Sort gallery by period - #2063

Draft
aymericmariaux wants to merge 2 commits into
refactor-gallery-viewmodelfrom
sort-gallery-by-period
Draft

feat: Sort gallery by period#2063
aymericmariaux wants to merge 2 commits into
refactor-gallery-viewmodelfrom
sort-gallery-by-period

Conversation

@aymericmariaux

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI balanced review requested due to automatic review settings August 5, 2026 12:55
@aymericmariaux
aymericmariaux marked this pull request as draft August 5, 2026 12:55

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

Adds selectable day, month, or year grouping to the gallery.

Changes:

  • Adds period-selection navigation and bottom sheet.
  • Moves gallery grouping state into GalleryViewModel.
  • Rebuilds sections and fast-scroll labels for the selected period.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
main_navigation.xml Adds period-selection dialog navigation.
gallery_menu.xml Adds the gallery sorting action.
fragment_menu_gallery.xml Attaches the new toolbar menu.
MenuGalleryFragment.kt Opens and handles the period selector.
GalleryViewModel.kt Manages gallery data and period grouping.
GalleryPeriodBottomSheetDialog.kt Configures the selection dialog.
GalleryPeriodBottomSheetAdapter.kt Displays period choices.
GalleryPeriod.kt Defines periods and date patterns.
GalleryFragment.kt Applies period changes to the gallery.
GalleryAdapter.kt Updates display-list and fast-scroll handling.

@aymericmariaux
aymericmariaux changed the base branch from main to refactor-gallery-viewmodel August 5, 2026 13:08
@aymericmariaux
aymericmariaux force-pushed the sort-gallery-by-period branch from dd6feec to dddd804 Compare August 5, 2026 13:32
@aymericmariaux
aymericmariaux requested a balanced review from Copilot August 5, 2026 13:54

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

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

Suppressed comments (1)

app/src/main/java/com/infomaniak/drive/ui/menu/GalleryViewModel.kt:104

  • Reformatting exposes an ordering mismatch after a multi-file copy: prependDuplicatedImages displays duplicatedList in iteration order but currently inserts each item at index 0 of galleryList, reversing the backing order. Selecting another period then rebuilds from that reversed list and visibly flips the copied files. Insert the whole duplicate list at index 0 once so the adapter and backing list retain the same order.
        return formatList(files)

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

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@aymericmariaux
aymericmariaux force-pushed the sort-gallery-by-period branch from 609f40f to e7621e6 Compare August 6, 2026 06:31
@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

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.

2 participants