Skip to content

[PB-7047]: feat/show the photos of a month grouped by day - #2288

Open
xabg2 wants to merge 3 commits into
feat/PB-7048-photos-month-filterfrom
feat/PB-7047-photos-month-grid
Open

xabg2 wants to merge 3 commits into
feat/PB-7048-photos-month-filterfrom
feat/PB-7047-photos-month-grid

Conversation

@xabg2

@xabg2 xabg2 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Description

The Photos page now shows the backed-up photos of the selected month (the newest one by default), grouped by day and newest first. Days are labelled "Today", "Yesterday" or with the full date in the user's language. Photos from every device are mixed by default, and the device and month filters narrow what is shown. While the photos load the grid placeholder is shown, and if they cannot be loaded the user can try again. Trashed and deleted files are left out.

Each photo is shown as a tile with its file type icon; real thumbnails come in a later PR. The month and day are read from the backup folders created by the mobile app, which are now trusted as they are instead of being filtered by name.

Related Issues

Jira: PB-7047 (parent PB-6876)
Backend proposal to load months and photos without walking folders: PB-7089

Related Pull Requests

Checklist

  • Changes have been tested locally.
  • Unit tests have been written or updated as necessary.
  • The code adheres to the repository's coding standards.
  • Relevant documentation has been added or updated.
  • No new warnings or errors have been introduced.
  • SonarCloud issues have been reviewed and addressed.
  • QA Passed

Testing Process

  • Unit tests cover the photos of a month (day taken from its folder, trashed and deleted files left out, paged results, months without day folders), the gallery showing the newest month day by day, picking an older month, photos from several devices on the same day, retrying a failed load, and the "Today"/"Yesterday" labels.

Additional Notes

The page is still not linked from the sidebar. If PB-7089 is accepted, only the folder service changes; the rest of the page stays the same.

@xabg2 xabg2 added the enhancement New feature or request label Nov 5, 2026
@xabg2 xabg2 self-assigned this Nov 5, 2026
@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 914c3de6-2e10-4698-9cbb-b7e32df0e964

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Deploying drive-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: 743382c
Status: ✅  Deploy successful!
Preview URL: https://bd0be99a.drive-web.pages.dev
Branch Preview URL: https://feat-pb-7047-photos-month-gr.drive-web.pages.dev

View logs

@xabg2
xabg2 marked this pull request as ready for review November 6, 2026 12:56
Base automatically changed from chore/PB-7047-bump-sdk-1.26.0 to feat/PB-7048-photos-month-filter November 6, 2026 15:12
name: `${file.plainName}.${file.type}`,
type: file.type,
month: month.key,
day: dayOfFolder.get(file.folderUuid) as DayKey,

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.

dayOfFolder.get(file.folderUuid) as DayKey hides a possible undefined: nothing filters files by folderUuid membership first. If one file's folderUuid doesn't match any day folder, photo.day is undefined at runtime, and PhotosTimeline's sort (.localeCompare) throws, crashing the whole gallery.

maybe it would be better to filter out unmatched files before mapping instead of casting


private async getSubfolders(folderUuid: string, namePattern: RegExp, cursor?: string): Promise<Folder[]> {
private async getSubfolders(folderUuid: string, cursor?: string): Promise<Folder[]> {
const storageClient = SdkFactory.getNewApiInstance().createNewStorageClient();

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.

The SDK client is now created on every recursive page call instead of once per fetch, unlike the previous implementation. N pages = N client instances 🤔

}

private async getFilesInFolders(folderUuids: string[], cursor?: string): Promise<PhotoFolderFile[]> {
const photosClient = SdkFactory.getNewApiInstance().createPhotosClient();

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.

same here: the SDK client is now created on every recursive page call instead of once per fetch, unlike the previous implementation. N pages = N client instances 🤔

Comment thread src/services/date.service.ts Outdated

const isToday = (date: Date | string): boolean => dayjs(date).isSame(dayjs(), 'day');

const isYesterday = (date: Date | string): boolean => dayjs(date).isSame(dayjs().subtract(1, 'day'), 'day');

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.

nitpick: dayjs also ships isToday/isYesterday plugins that already do this (same as relativeTime at this file)

so you could:

dayjs.extend(isTodayPlugin);
dayjs.extend(isYesterdayPlugin);

and then:

const isToday = (date: Date | string): boolean => dayjs(date).isToday();

const isYesterday = (date: Date | string): boolean => dayjs(date).isYesterday();

@larryrider

Copy link
Copy Markdown
Contributor

check conflicts also

xabg2 added 2 commits November 6, 2026 17:21
…tos-month-grid

# Conflicts:
#	src/views/Photos/hooks/usePhotoFilters.ts
#	src/views/Photos/services/photoFolders.service.ts
@xabg2
xabg2 requested a review from larryrider November 6, 2026 16:29
@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

This branch has not been deployed

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants