π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Forward
Manav Rathie71379e72592
diff --git a/web/apps/photos/src/components/FileListWithViewer.tsx b/web/apps/photos/src/components/FileListWithViewer.tsxindex 118925a3d1..4a1f0008b6 100644--- a/web/apps/photos/src/components/FileListWithViewer.tsx+++ b/web/apps/photos/src/components/FileListWithViewer.tsx@@ -3,6 +3,7 @@ import { formattedDate } from "@/base/i18n-date";import {FileViewer,type FileViewerProps,+ type FileViewerToggleArchiveButtonProps,} from "@/gallery/components/viewer/FileViewer";import type { Collection } from "@/media/collection";import { EnteFile } from "@/media/file";@@ -83,7 +84,8 @@ export type FileListWithViewerProps = {| "allCollectionsNameByID"| "onSelectCollection"| "onSelectPerson"- >;+ > &+ FileViewerToggleArchiveButtonProps;/*** A list of files (represented by their thumbnails), along with a file viewer@@ -107,7 +109,11 @@ export const FileListWithViewer: React.FC<FileListWithViewerProps> = ({isInHiddenSection,fileCollectionIDs,allCollectionsNameByID,+ archivedCollectionIDs,+ archivedFileIDs,+ pendingVisibilityUpdates,setFilesDownloadProgressAttributesCreator,+ onFileVisibilityUpdate,onMarkUnsyncedFavoriteUpdate,onMarkTempDeleted,onSetOpenFileViewer,@@ -176,15 +182,6 @@ export const FileListWithViewer: React.FC<FileListWithViewerProps> = ({: undefined;}, [onMarkTempDeleted]);- const handleToggleArchive = useMemo(() => {- // TODO(AR):- return favoriteFileIDs- ? (file: EnteFile) => {- console.log("toggle archive", file);- }- : undefined;- }, [favoriteFileIDs]);-const handleSaveEditedImageCopy = useCallback((editedFile: File, collection: Collection, enteFile: EnteFile) => {uploadManager.prepareForNewUpload();@@ -229,6 +226,10 @@ export const FileListWithViewer: React.FC<FileListWithViewerProps> = ({favoriteFileIDs,fileCollectionIDs,allCollectionsNameByID,+ archivedCollectionIDs,+ archivedFileIDs,+ pendingVisibilityUpdates,+ onFileVisibilityUpdate,onSelectCollection,onSelectPerson,}}diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsxindex 2b7769d3b8..bb57270b6c 100644--- a/web/apps/photos/src/pages/gallery.tsx+++ b/web/apps/photos/src/pages/gallery.tsx@@ -803,7 +803,7 @@ const Page: React.FC = () => {});};- const handleFileViewerVisibilityUpdate = useCallback(+ const handleFileViewerFileVisibilityUpdate = useCallback(async (fileID: number, visibility: ItemVisibility) => {dispatch({type: "markPendingVisibilityUpdate",@@ -1096,12 +1096,16 @@ const Page: React.FC = () => {isInHiddenSection={barMode == "hidden-albums"}archivedCollectionIDs={state.archivedCollectionIDs}archivedFileIDs={state.archivedFileIDs}- pendingVisibilityUpdates={state.pendingVisibilityUpdates}+ pendingVisibilityUpdates={+ state.pendingVisibilityUpdates+ }favoriteFileIDs={state.favoriteFileIDs}setFilesDownloadProgressAttributesCreator={setFilesDownloadProgressAttributesCreator}- onVisibilityUpdate={handleFileViewerVisibilityUpdate}+ onFileVisibilityUpdate={+ handleFileViewerFileVisibilityUpdate+ }onMarkUnsyncedFavoriteUpdate={handleMarkUnsyncedFavoriteUpdate}diff --git a/web/packages/gallery/components/viewer/FileViewer.tsx b/web/packages/gallery/components/viewer/FileViewer.tsxindex 77bf65697f..774491224b 100644--- a/web/packages/gallery/components/viewer/FileViewer.tsx+++ b/web/packages/gallery/components/viewer/FileViewer.tsx@@ -18,6 +18,7 @@ import {type FileInfoProps,} from "@/gallery/components/FileInfo";import type { Collection } from "@/media/collection";+import type { ItemVisibility } from "@/media/file-metadata";import { FileType } from "@/media/file-type";import type { EnteFile } from "@/media/file.js";import { isHEICExtension, needsJPEGConversion } from "@/media/formats";@@ -116,6 +117,23 @@ export interface FileViewerAnnotatedFile {itemData: ItemData;}+/**+ * File IDs of all the collections and files that the user has archived, and for+ * which an toggle is pending, and a callback to trigger the toggle.+ *+ * The toggle archived button will shown in the file actions of the file viewer+ * only if all four of these props are specified.+ */+export interface FileViewerToggleArchiveButtonProps {+ archivedCollectionIDs?: Set<number>;+ archivedFileIDs?: Set<number>;+ pendingVisibilityUpdates?: Set<number>;+ onFileVisibilityUpdate?: (+ fileID: number,+ visibility: ItemVisibility,+ ) => Promise<void>;+}+export type FileViewerProps = ModalVisibilityProps & {/*** The currently logged in user, if any.@@ -231,7 +249,8 @@ export type FileViewerProps = ModalVisibilityProps & {| "allCollectionsNameByID"| "onSelectCollection"| "onSelectPerson"- >;+ > &+ FileViewerToggleArchiveButtonProps;/*** A PhotoSwipe based image and video viewer.diff --git a/web/packages/new/photos/components/gallery/reducer.ts b/web/packages/new/photos/components/gallery/reducer.tsindex 85932b9152..78f80e8f2f 100644--- a/web/packages/new/photos/components/gallery/reducer.ts+++ b/web/packages/new/photos/components/gallery/reducer.ts@@ -1149,7 +1149,7 @@ const deriveHiddenFileIDs = (hiddenFiles: EnteFile[]) =>* Compute archived file IDs from their dependencies.*/const deriveArchivedFileIDs = (- archivedCollectionIDs: Set<number>,+ archivedCollectionIDs: GalleryState["archivedCollectionIDs"],files: EnteFile[],unsyncedVisibilityUpdates: GalleryState["unsyncedVisibilityUpdates"],) =>