Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Deploying drive-web with
|
| 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 |
| name: `${file.plainName}.${file.type}`, | ||
| type: file.type, | ||
| month: month.key, | ||
| day: dayOfFolder.get(file.folderUuid) as DayKey, |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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 🤔
|
|
||
| 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'); |
There was a problem hiding this comment.
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();
|
check conflicts also |
…tos-month-grid # Conflicts: # src/views/Photos/hooks/usePhotoFilters.ts # src/views/Photos/services/photoFolders.service.ts
|



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
Testing Process
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.