Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

refractor(photos):remove-dead-files-and-exports

Aswin Asok9634d45e185d
diff --git a/web/apps/photos/public/images/empty-state/ente_duck.png b/web/apps/photos/public/images/empty-state/ente_duck.png
deleted file mode 100644
index a8ea4c8a5e..0000000000
Binary files a/web/apps/photos/public/images/empty-state/ente_duck.png and /dev/null differ
diff --git a/web/apps/photos/public/images/empty-state/[email protected] b/web/apps/photos/public/images/empty-state/[email protected]
deleted file mode 100644
index 991252998b..0000000000
Binary files a/web/apps/photos/public/images/empty-state/[email protected] and /dev/null differ
diff --git a/web/apps/photos/public/images/empty-state/[email protected] b/web/apps/photos/public/images/empty-state/[email protected]
deleted file mode 100644
index dbcde186aa..0000000000
Binary files a/web/apps/photos/public/images/empty-state/[email protected] and /dev/null differ
diff --git a/web/apps/photos/public/images/gallery-locked/1x.png b/web/apps/photos/public/images/gallery-locked/1x.png
deleted file mode 100644
index 8c5918bbe1..0000000000
Binary files a/web/apps/photos/public/images/gallery-locked/1x.png and /dev/null differ
diff --git a/web/apps/photos/public/images/gallery-locked/2x.png b/web/apps/photos/public/images/gallery-locked/2x.png
deleted file mode 100644
index 2d0924ca7d..0000000000
Binary files a/web/apps/photos/public/images/gallery-locked/2x.png and /dev/null differ
diff --git a/web/apps/photos/public/images/gallery-locked/3x.png b/web/apps/photos/public/images/gallery-locked/3x.png
deleted file mode 100644
index e8d0645c3c..0000000000
Binary files a/web/apps/photos/public/images/gallery-locked/3x.png and /dev/null differ
diff --git a/web/apps/photos/src/components/ActiveDownloadStatusNotifications.tsx b/web/apps/photos/src/components/ActiveDownloadStatusNotifications.tsx
deleted file mode 100644
index 3fc2e2f452..0000000000
--- a/web/apps/photos/src/components/ActiveDownloadStatusNotifications.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import { DownloadStatusNotifications } from "ente-gallery/components/DownloadStatusNotifications";
-import { useSaveGroups } from "ente-gallery/components/utils/save-groups";
-import type { ComponentProps } from "react";
-
-type ActiveDownloadStatusNotificationsProps = Omit<
- ComponentProps<typeof DownloadStatusNotifications>,
- "saveGroups" | "onRemoveSaveGroup"
->;
-
-export const ActiveDownloadStatusNotifications: React.FC<
- ActiveDownloadStatusNotificationsProps
-> = (props) => {
- const { saveGroups, onRemoveSaveGroup } = useSaveGroups();
-
- return (
- <DownloadStatusNotifications
- saveGroups={saveGroups}
- onRemoveSaveGroup={onRemoveSaveGroup}
- {...props}
- />
- );
-};
diff --git a/web/apps/photos/src/components/CollectionSelector.tsx b/web/apps/photos/src/components/CollectionSelector.tsx
index d12b688a67..4d1bf8d72c 100644
--- a/web/apps/photos/src/components/CollectionSelector.tsx
+++ b/web/apps/photos/src/components/CollectionSelector.tsx
@@ -33,7 +33,7 @@ import { includes } from "ente-utils/type-guards";
import { t } from "i18next";
import React, { useCallback, useEffect, useMemo, useState } from "react";
-export type CollectionSelectorAction =
+type CollectionSelectorAction =
| "upload"
| "add"
| "move"
@@ -50,7 +50,7 @@ export interface CollectionSelectorAttributes {
onCancel?: () => void;
}
-export type CollectionSelectorProps = ModalVisibilityProps & {
+type CollectionSelectorProps = ModalVisibilityProps & {
onExited?: () => void;
attributes: CollectionSelectorAttributes | undefined;
collectionSummaries: CollectionSummaries;
diff --git a/web/apps/photos/src/components/Collections/AlbumCastDialog.tsx b/web/apps/photos/src/components/Collections/AlbumCastDialog.tsx
index a1302b9c73..9f1d431f8d 100644
--- a/web/apps/photos/src/components/Collections/AlbumCastDialog.tsx
+++ b/web/apps/photos/src/components/Collections/AlbumCastDialog.tsx
@@ -36,7 +36,7 @@ export const AlbumCastDialog: React.FC<AlbumCastDialogProps> = ({
// MUI preserves a dialog child's state while hidden.
// Keep contents separate so each open starts fresh and reruns effects.
-export const AlbumCastDialogContents: React.FC<AlbumCastDialogProps> = ({
+const AlbumCastDialogContents: React.FC<AlbumCastDialogProps> = ({
open,
onClose,
collection,
diff --git a/web/apps/photos/src/components/Collections/CollectionHeader.tsx b/web/apps/photos/src/components/Collections/CollectionHeader.tsx
index 8b6deee100..832bef0d66 100644
--- a/web/apps/photos/src/components/Collections/CollectionHeader.tsx
+++ b/web/apps/photos/src/components/Collections/CollectionHeader.tsx
@@ -1008,33 +1008,6 @@ const DownloadQuickOption: React.FC<DownloadQuickOptionProps> = ({
</Tooltip>
);
-export const FeedIcon: React.FC = () => (
- <svg
- width="23"
- height="20"
- viewBox="0 0 23 20"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path
- d="M9.7998 0.5C10.2416 0.5 10.5996 0.857977 10.5996 1.2998C10.5996 1.74163 10.2416 2.09961 9.7998 2.09961H4.7998C3.03249 2.09961 1.59961 3.53249 1.59961 5.2998V14.2998C1.59961 16.0671 3.0325 17.5 4.7998 17.5H13.7998C15.5671 17.5 17 16.0671 17 14.2998V11.7998C17 11.358 17.358 11 17.7998 11C18.2416 11 18.5996 11.358 18.5996 11.7998V14.2998C18.5996 16.9507 16.4507 19.0996 13.7998 19.0996H4.7998C2.14883 19.0996 0 16.9507 0 14.2998V5.2998C0 2.64884 2.14884 0.5 4.7998 0.5H9.7998Z"
- fill="currentColor"
- />
- <path
- d="M13.2998 13.5C13.7416 13.5 14.0996 13.858 14.0996 14.2998C14.0996 14.7416 13.7416 15.0996 13.2998 15.0996H4.2998C3.85798 15.0996 3.5 14.7416 3.5 14.2998C3.5 13.858 3.85798 13.5 4.2998 13.5H13.2998Z"
- fill="currentColor"
- />
- <path
- d="M10.2998 10.5C10.7416 10.5 11.0996 10.858 11.0996 11.2998C11.0996 11.7416 10.7416 12.0996 10.2998 12.0996H4.2998C3.85798 12.0996 3.5 11.7416 3.5 11.2998C3.5 10.858 3.85798 10.5 4.2998 10.5H10.2998Z"
- fill="currentColor"
- />
- <path
- d="M20.6523 6.12012C21.3761 5.2635 22.0996 4.13144 22.0996 2.93848C22.0995 1.38141 20.9626 0 19.2998 0C18.621 0 17.9847 0.205224 17.2998 0.749023C16.6149 0.205224 15.9787 0 15.2998 0C13.637 0 12.5001 1.38141 12.5 2.93848C12.5 4.13144 13.2236 5.2635 13.9473 6.12012C14.698 7.00866 15.5878 7.76218 16.1758 8.21484C16.8431 8.72865 17.7565 8.72865 18.4238 8.21484C19.0119 7.76218 19.9016 7.00866 20.6523 6.12012Z"
- fill="currentColor"
- />
- </svg>
-);
-
const showShareQuickOption = ({ type, attributes }: CollectionSummary) =>
type == "album" ||
type == "folder" ||
diff --git a/web/apps/photos/src/components/FileList.tsx b/web/apps/photos/src/components/FileList.tsx
index d4e207d0d4..dc8dddab0f 100644
--- a/web/apps/photos/src/components/FileList.tsx
+++ b/web/apps/photos/src/components/FileList.tsx
@@ -92,7 +92,7 @@ export interface FileListAnnotatedFile {
}
// deleteBy is an epoch-microsecond timestamp.
-export type EnteTrashFile = EnteFile & { deleteBy?: number };
+type EnteTrashFile = EnteFile & { deleteBy?: number };
export interface FileListProps {
height: number;
diff --git a/web/apps/photos/src/components/MultilineInput.tsx b/web/apps/photos/src/components/MultilineInput.tsx
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/web/apps/photos/src/components/SubscriptionCard.tsx b/web/apps/photos/src/components/SubscriptionCard.tsx
index f695207da4..d24bf8e672 100644
--- a/web/apps/photos/src/components/SubscriptionCard.tsx
+++ b/web/apps/photos/src/components/SubscriptionCard.tsx
@@ -117,7 +117,7 @@ interface SubscriptionCardContentOverlayProps {
userDetails: UserDetails;
}
-export const SubscriptionCardContentOverlay: React.FC<
+const SubscriptionCardContentOverlay: React.FC<
SubscriptionCardContentOverlayProps
> = ({ userDetails }) => {
const inFamily = isPartOfFamilyWithOtherMembers(userDetails);
diff --git a/web/apps/photos/src/components/gallery/BarImpl.tsx b/web/apps/photos/src/components/gallery/BarImpl.tsx
index 718fc73808..0ddd1d2e2e 100644
--- a/web/apps/photos/src/components/gallery/BarImpl.tsx
+++ b/web/apps/photos/src/components/gallery/BarImpl.tsx
@@ -277,7 +277,7 @@ const BarWrapper = styled("div")`
margin-block-end: 16px;
`;
-export const Row1 = styled("div")`
+const Row1 = styled("div")`
display: flex;
align-items: center;
justify-content: space-between;
@@ -285,7 +285,7 @@ export const Row1 = styled("div")`
margin-block-end: 12px;
`;
-export const Row2 = styled("div")`
+const Row2 = styled("div")`
display: flex;
align-items: flex-start;
gap: 16px;
diff --git a/web/apps/photos/src/components/gallery/index.tsx b/web/apps/photos/src/components/gallery/index.tsx
index 631bcaff47..0f8d2043b8 100644
--- a/web/apps/photos/src/components/gallery/index.tsx
+++ b/web/apps/photos/src/components/gallery/index.tsx
@@ -203,7 +203,7 @@ export const PeopleEmptyState: React.FC = () => {
}
};
-export const PeopleEmptyStateMessage: React.FC<React.PropsWithChildren> = ({
+const PeopleEmptyStateMessage: React.FC<React.PropsWithChildren> = ({
children,
}) => (
<CenteredFill>
@@ -220,7 +220,7 @@ export const PeopleEmptyStateMessage: React.FC<React.PropsWithChildren> = ({
</CenteredFill>
);
-export const PeopleEmptyStateDisabled: React.FC = () => {
+const PeopleEmptyStateDisabled: React.FC = () => {
const [showConsent, setShowConsent] = useState(false);
const handleConsent = useWrapAsyncOperation(async () => {
diff --git a/web/apps/photos/src/components/gallery/reducer.ts b/web/apps/photos/src/components/gallery/reducer.ts
index 15c1d90cfb..24952a8c08 100644
--- a/web/apps/photos/src/components/gallery/reducer.ts
+++ b/web/apps/photos/src/components/gallery/reducer.ts
@@ -51,7 +51,7 @@ export type GalleryBarMode =
| "archive-albums"
| "people";
-export type GalleryView =
+type GalleryView =
| {
type: "albums" | "hidden-albums" | "archive-albums";
activeCollectionSummaryID: number;
@@ -65,7 +65,7 @@ export type GalleryView =
activePerson: Person | undefined;
};
-export interface GalleryState {
+interface GalleryState {
user: LocalUser | undefined;
familyData: FamilyData | undefined;
@@ -122,7 +122,7 @@ export interface GalleryState {
filteredFiles: EnteFile[];
}
-export type GalleryAction =
+type GalleryAction =
| {
type: "mount";
user: LocalUser;
diff --git a/web/apps/photos/src/components/sidebar/TwoFactorSettings.tsx b/web/apps/photos/src/components/sidebar/TwoFactorSettings.tsx
index c20f378f7b..6fd6207426 100644
--- a/web/apps/photos/src/components/sidebar/TwoFactorSettings.tsx
+++ b/web/apps/photos/src/components/sidebar/TwoFactorSettings.tsx
@@ -61,8 +61,6 @@ export const TwoFactorSettings: React.FC<
);
};
-export default TwoFactorSettings;
-
type ContentsProps = Pick<NestedSidebarDrawerVisibilityProps, "onRootClose">;
const SetupDrawerContents: React.FC<ContentsProps> = ({ onRootClose }) => {
diff --git a/web/apps/photos/src/services/cast.ts b/web/apps/photos/src/services/cast.ts
index 6647dc9342..6138c1a151 100644
--- a/web/apps/photos/src/services/cast.ts
+++ b/web/apps/photos/src/services/cast.ts
@@ -21,7 +21,7 @@ export const revokeAllCastTokens = async () =>
* given device / pairing {@link code} from remote, or `undefined` if there is
* no public key associated with the given code.
*/
-export const publicKeyForPairingCode = async (code: string) => {
+const publicKeyForPairingCode = async (code: string) => {
const res = await fetch(await apiURL(`/cast/device-info/${code}`), {
headers: await authenticatedRequestHeaders(),
});
diff --git a/web/apps/photos/src/services/export.ts b/web/apps/photos/src/services/export.ts
index 749ee3400b..30d81d317f 100644
--- a/web/apps/photos/src/services/export.ts
+++ b/web/apps/photos/src/services/export.ts
@@ -70,7 +70,7 @@ export interface ExportProgress {
total: number;
}
-export interface ExportSettings {
+interface ExportSettings {
folder?: string;
continuousExport?: boolean;
}
@@ -80,13 +80,13 @@ const ExportSettings = z.object({
continuousExport: z.boolean().nullish().transform(nullToUndefined),
});
-export const savedExportSettings = () => {
+const savedExportSettings = () => {
const jsonString = localStorage.getItem("export");
const json = jsonString ? JSON.parse(jsonString) : undefined;
return json ? ExportSettings.parse(json) : undefined;
};
-export const saveExportSettings = (exportSettings: ExportSettings) => {
+const saveExportSettings = (exportSettings: ExportSettings) => {
localStorage.setItem("export", JSON.stringify(exportSettings));
};
@@ -94,7 +94,7 @@ type CollectionExportNames = Record<number, string>;
type FileExportNames = Record<string, string>;
-export interface ExportRecord {
+interface ExportRecord {
version: number;
stage: ExportStage;
lastAttemptTimestamp: number;
@@ -102,7 +102,7 @@ export interface ExportRecord {
fileExportNames: FileExportNames;
}
-export const NULL_EXPORT_RECORD: ExportRecord = {
+const NULL_EXPORT_RECORD: ExportRecord = {
version: 5,
stage: ExportStage.init,
// @ts-ignore
@@ -1483,7 +1483,7 @@ const getLivePhotoExportName = (
videoExportName: string,
) => JSON.stringify({ image: imageExportName, video: videoExportName });
-export const isLivePhotoExportName = (exportName: string) => {
+const isLivePhotoExportName = (exportName: string) => {
try {
JSON.parse(exportName);
return true;
diff --git a/web/apps/photos/src/services/large-files.ts b/web/apps/photos/src/services/large-files.ts
index 3e5ba77fbb..6806a181fa 100644
--- a/web/apps/photos/src/services/large-files.ts
+++ b/web/apps/photos/src/services/large-files.ts
@@ -10,7 +10,7 @@ import { savedCollectionFiles } from "ente-new/photos/services/photos-fdb";
import { pullFiles } from "./pull";
// Keep the 10 MB threshold aligned with mobile.
-export const MIN_LARGE_FILE_SIZE = 10 * 1024 * 1024;
+const MIN_LARGE_FILE_SIZE = 10 * 1024 * 1024;
export type LargeFileFilter = "all" | "photos" | "videos";
@@ -100,9 +100,9 @@ export const deleteSelectedLargeFiles = async (
return new Set(selectedItems.map((item) => item.id));
};
-export type SortOrder = "desc" | "asc";
+type SortOrder = "desc" | "asc";
-export interface LargeFilesState {
+interface LargeFilesState {
analysisStatus: undefined | "started" | "failed" | "completed";
largeFiles: LargeFileItem[];
filter: LargeFileFilter;
@@ -114,7 +114,7 @@ export interface LargeFilesState {
selectedFileIDs: Set<number>;
}
-export type LargeFilesAction =
+type LargeFilesAction =
| { type: "analyze" }
| { type: "analysisFailed" }
| { type: "analysisCompleted"; largeFiles: LargeFileItem[] }
diff --git a/web/apps/photos/src/services/search/sidebar-search-registry.ts b/web/apps/photos/src/services/search/sidebar-search-registry.ts
index 81a4eaff33..6214991c10 100644
--- a/web/apps/photos/src/services/search/sidebar-search-registry.ts
+++ b/web/apps/photos/src/services/search/sidebar-search-registry.ts
@@ -8,7 +8,7 @@ import type {
import { wait } from "ente-utils/promise";
import { t } from "i18next";
-export interface SidebarAction {
+interface SidebarAction {
id: SidebarActionID;
label: string;
path: string[];
@@ -16,7 +16,7 @@ export interface SidebarAction {
available?: () => boolean;
}
-export interface SidebarActionContext {
+interface SidebarActionContext {
// top-level sidebar controls
onClose: () => void;
onShowCollectionSummary: (
diff --git a/web/apps/photos/src/services/upload-manager.ts b/web/apps/photos/src/services/upload-manager.ts
index e0d98e02c7..63d224e9e9 100644
--- a/web/apps/photos/src/services/upload-manager.ts
+++ b/web/apps/photos/src/services/upload-manager.ts
@@ -48,9 +48,9 @@ import { indexNewUpload } from "ente-new/photos/services/ml";
import { wait } from "ente-utils/promise";
import watcher from "./watch";
-export type FileID = number;
+type FileID = number;
-export type PercentageUploaded = number;
+type PercentageUploaded = number;
export type UploadFileNames = Map<FileID, string>;
export interface UploadCounter {
@@ -64,15 +64,15 @@ export interface InProgressUpload {
}
// The UI groups addedSymlink with uploaded.
-export type FinishedUploadType = Exclude<UploadResult["type"], "addedSymlink">;
+type FinishedUploadType = Exclude<UploadResult["type"], "addedSymlink">;
-export type InProgressUploads = Map<FileID, PercentageUploaded>;
+type InProgressUploads = Map<FileID, PercentageUploaded>;
-export type FinishedUploads = Map<FileID, FinishedUploadType>;
+type FinishedUploads = Map<FileID, FinishedUploadType>;
export type SegregatedFinishedUploads = Map<FinishedUploadType, FileID[]>;
-export interface UploadBatchItemResult {
+interface UploadBatchItemResult {
localID: number;
requestedCollectionID: number;
result: UploadResult;
@@ -134,7 +134,7 @@ const successfulFileFromUploadResult = (
}
};
-export interface ProgressUpdater {
+interface ProgressUpdater {
setPercentComplete: React.Dispatch<React.SetStateAction<number>>;
setUploadCounter: React.Dispatch<React.SetStateAction<UploadCounter>>;
setUploadPhase: (phase: UploadPhase) => void;