Skip to content

armgit / ente

Public Imported from GitHub
0

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

Remove unused albums app carry-over

Anand Baburajan01fc8eef6f06
diff --git a/web/apps/albums/next.config.js b/web/apps/albums/next.config.js
index 28256d7c10..effb7ea550 100644
--- a/web/apps/albums/next.config.js
+++ b/web/apps/albums/next.config.js
@@ -23,8 +23,6 @@ module.exports = {
env: {
gitSHA,
appName,
- isDesktop: "",
- desktopAppVersion: undefined,
},
webpack: (config, { isServer }) => {
if (!isServer) {
diff --git a/web/apps/albums/package.json b/web/apps/albums/package.json
index 6d51284f8f..4646fa6b6d 100644
--- a/web/apps/albums/package.json
+++ b/web/apps/albums/package.json
@@ -12,9 +12,7 @@
"@mui/icons-material": "^7.3.4",
"@mui/material": "^7.3.4",
"@mui/system": "^7.3.3",
- "@mui/x-date-pickers": "^8.14.0",
"bs58": "^6.0.0",
- "chrono-node": "^2.9.0",
"comlink": "^4.4.2",
"dayjs": "^1.11.18",
"debounce": "^2.2.0",
@@ -34,23 +32,18 @@
"localforage": "^1.10.0",
"media-chrome": "^4.14.0",
"memoize-one": "^6.0.0",
- "ml-matrix": "^6.12.1",
"nanoid": "^5.1.6",
"next": "^15.5.9",
- "p-debounce": "^5.0.0",
"photoswipe": "^5.4.4",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"react-dropzone": "14.2.10",
"react-i18next": "^16.0.1",
"react-leaflet": "^5.0.0",
- "react-select": "^5.10.2",
"react-top-loading-bar": "^3.0.2",
"react-virtualized-auto-sizer": "^1.0.26",
"react-window": "^1.8.11",
"sanitize-filename": "^1.6.3",
- "similarity-transformation": "^0.0.1",
- "supercluster": "^8.0.1",
"zod": "^4.1.12"
},
"devDependencies": {
diff --git a/web/apps/albums/vendor/ente-base/app.ts b/web/apps/albums/vendor/ente-base/app.ts
index 513f46a99e..eb62cf33da 100644
--- a/web/apps/albums/vendor/ente-base/app.ts
+++ b/web/apps/albums/vendor/ente-base/app.ts
@@ -14,8 +14,6 @@ export type AppName = (typeof appNames)[number];
// This vendored copy only serves the public albums web app.
export const appName: AppName = "albums";
-export const isDesktop = false;
-export const desktopAppVersion: string | undefined = undefined;
export const staticAppTitle = "Ente Photos";
export const clientPackageName = "io.ente.albums.web";
export const clientIdentifier = clientPackageName;
diff --git a/web/apps/albums/vendor/ente-base/global-electron.d.ts b/web/apps/albums/vendor/ente-base/global-electron.d.ts
deleted file mode 100644
index c5de87ea12..0000000000
--- a/web/apps/albums/vendor/ente-base/global-electron.d.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import type { Electron } from "./types/ipc";
-
-/**
- * Extend the global object's (`globalThis`) interface to state that it can
- * potentially hold a property called `electron`. It will be injected by our
- * preload.js script when we're running in the context of our desktop app.
- */
-declare global {
- /**
- * Extra, desktop specific, APIs provided by our Node.js layer.
- *
- * This property will defined only when we're running inside our desktop
- * (Electron) app. It will expose a bunch of functions (see
- * {@link Electron}) that allow us to communicate with the Node.js layer of
- * our desktop app.
- */
- declare var electron: Electron | undefined;
-}
diff --git a/web/apps/albums/vendor/ente-base/types/ipc.ts b/web/apps/albums/vendor/ente-base/types/ipc.ts
deleted file mode 100644
index f782b4db02..0000000000
--- a/web/apps/albums/vendor/ente-base/types/ipc.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export interface Electron {
- openDirectory: (dirPath: string) => Promise<void>;
-}
-
-export type ZipItem = [zipPath: string, entryName: string];
diff --git a/web/apps/albums/vendor/ente-gallery/components/FileInfo.tsx b/web/apps/albums/vendor/ente-gallery/components/FileInfo.tsx
index 91c57a68e4..ab025d86f6 100644
--- a/web/apps/albums/vendor/ente-gallery/components/FileInfo.tsx
+++ b/web/apps/albums/vendor/ente-gallery/components/FileInfo.tsx
@@ -56,15 +56,6 @@ type FileInfoAnnotatedExif = Required<FileInfoExif> & {
export type FileInfoProps = ModalVisibilityProps & {
file: EnteFile;
exif: FileInfoExif | undefined;
- allowEdits?: boolean;
- allowMap?: boolean;
- showCollections?: boolean;
- fileCollectionIDs?: Map<number, number[]>;
- collectionNameByID?: Map<number, string>;
- onFileMetadataUpdate?: () => Promise<void>;
- onUpdateCaption: (fileID: number, newCaption: string) => void;
- onSelectCollection?: (collectionID: number) => void;
- onSelectPerson?: (personID: string) => void;
};
export const FileInfo: React.FC<FileInfoProps> = ({
diff --git a/web/apps/albums/vendor/ente-gallery/components/viewer/FileViewer.tsx b/web/apps/albums/vendor/ente-gallery/components/viewer/FileViewer.tsx
index fe0957002e..ff88cafde3 100644
--- a/web/apps/albums/vendor/ente-gallery/components/viewer/FileViewer.tsx
+++ b/web/apps/albums/vendor/ente-gallery/components/viewer/FileViewer.tsx
@@ -1222,8 +1222,6 @@ export const FileViewer: React.FC<FileViewerProps> = ({
};
}, [open, shouldCloseOnBrowserBack]);
- const handleUpdateCaption = useCallback(() => undefined, []);
-
useEffect(updateFullscreenStatus, [updateFullscreenStatus]);
if (!activeAnnotatedFile) {
@@ -1237,7 +1235,6 @@ export const FileViewer: React.FC<FileViewerProps> = ({
onClose={handleFileInfoClose}
file={activeAnnotatedFile.file}
exif={activeFileExif}
- onUpdateCaption={handleUpdateCaption}
/>
<CommentsSidebar
open={openComments}
diff --git a/web/apps/albums/vendor/ente-gallery/services/file-data.ts b/web/apps/albums/vendor/ente-gallery/services/file-data.ts
index c25e0924bd..0f4e06574f 100644
--- a/web/apps/albums/vendor/ente-gallery/services/file-data.ts
+++ b/web/apps/albums/vendor/ente-gallery/services/file-data.ts
@@ -16,15 +16,13 @@ import { z } from "zod";
*
* For example, for each original image that the user uploads, there will be an
* associated thumbnail file, potentially one or more preview files (optimized
- * for size or compatibility across devices), various ML embeddings generated
- * for that file, and possibly more such files in the future.
+ * for size or compatibility across devices), and possibly more such files in
+ * the future.
*
* There are specialized APIs for fetching and uploading the originals and the
* thumbnails. But for the other associated data, we can use the file data APIs.
*/
-type FileDataType =
- | "mldata" /* See: [Note: "mldata" format] */
- | "vid_preview" /* See: [Note: Video playlist and preview] */;
+type FileDataType = "vid_preview" /* See: [Note: Video playlist and preview] */;
const RemoteFileData = z.object({
/**
@@ -44,25 +42,7 @@ const RemoteFileData = z.object({
decryptionHeader: z.string(),
/**
* The epoch microseconds when this file data entry was last upserted.
- *
- * [Note: PUT "mldata" version check]
- *
- * When PUT-ting mldata onto remote, the client is expected to pass the
- * updated at of the existing {@link RemoteFileData} which it is updating
- * (this field), or 0 if the client is creating a new entity.
- *
- * This allows remote to detect and reject cases where the client is trying
- * to overwrite a version it hasn't yet pulled.
- *
- * About the optionality of this field: Newer museums are expected to always
- * provide the {@link updatedAt} in the response, but for ease of self
- * hosters we don't take a hard dependency on the latest museum and instead
- * allow this field to be optional. When it is not present, effectively
- * we'll pass 0 as {@link lastUpdatedAt} in the "mldata" PUT API call, but
- * since it's an old museum it'll anyway ignore it.
- *
- * > This note was added May 2025, and the optionality can be removed in a
- * > few months when museums should've updated (tag: Migration).
+ * Optional for compatibility with older museum responses.
*/
updatedAt: z.number().nullish().transform(nullToUndefined),
});
@@ -138,8 +118,6 @@ export const fetchFileData = async (
* S3 metadata (museum term, the APIs call it "file data") is data that museum
* uploads on behalf of the client. e.g.,
*
- * - ML data.
- *
* - Preview video playlist.
*
* S3 file data (museum term, the APIs call it "file preview data") is data that
diff --git a/web/apps/albums/vendor/ente-gallery/utils/native-stream.ts b/web/apps/albums/vendor/ente-gallery/utils/native-stream.ts
deleted file mode 100644
index 32b4186972..0000000000
--- a/web/apps/albums/vendor/ente-gallery/utils/native-stream.ts
+++ /dev/null
@@ -1,180 +0,0 @@
-/**
- * @file Streaming IPC communication with the Node.js layer of our desktop app.
- *
- * NOTE: These functions only work when we're running in our desktop app.
- *
- * See: [Note: IPC streams].
- */
-
-import type { ZipItem } from "ente-base/types/ipc";
-
-/**
- * Stream the given file or zip entry from the user's local file system.
- *
- * This only works when we're running in our desktop app since it uses the
- * "stream://" protocol handler exposed by our custom code in the Node.js layer.
- * See: [Note: IPC streams].
- *
- * @param pathOrZipItem Either the path on the file on the user's local file
- * system whose contents we want to stream. Or a tuple containing the path to a
- * zip file and the name of the entry within it.
- *
- * @return A ({@link Response}, size, lastModifiedMs) triple.
- *
- * * The response contains the contents of the file. In particular, the `body`
- * {@link ReadableStream} property of this response can be used to read the
- * files contents in a streaming manner.
- *
- * * The size is the size of the file that we'll be reading from disk.
- *
- * * The lastModifiedMs value is the last modified time of the file that we're
- * reading, expressed as epoch milliseconds.
- */
-export const readStream = async (
- pathOrZipItem: string | ZipItem,
-): Promise<{ response: Response; size: number; lastModifiedMs: number }> => {
- let url: URL;
- if (typeof pathOrZipItem == "string") {
- const params = new URLSearchParams({ path: pathOrZipItem });
- url = new URL(`stream://read?${params.toString()}`);
- } else {
- const [zipPath, entryName] = pathOrZipItem;
- const params = new URLSearchParams({ zipPath, entryName });
- url = new URL(`stream://read-zip?${params.toString()}`);
- }
-
- const req = new Request(url, { method: "GET" });
-
- const res = await fetch(req);
- if (!res.ok)
- throw new Error(
- `Failed to read stream from ${url.href}: HTTP ${res.status}`,
- );
-
- const size = readNumericHeader(res, "Content-Length");
- const lastModifiedMs = readNumericHeader(res, "X-Last-Modified-Ms");
-
- return { response: res, size, lastModifiedMs };
-};
-
-const readNumericHeader = (res: Response, key: string) => {
- const valueText = res.headers.get(key);
- const value = valueText === null ? NaN : +valueText;
- if (isNaN(value))
- throw new Error(
- `Expected a numeric ${key} when reading a stream response, instead got ${valueText}`,
- );
- return value;
-};
-
-/**
- * Write the given stream to a file on the local machine.
- *
- * This only works when we're running in our desktop app since it uses the
- * "stream://" protocol handler exposed by our custom code in the Node.js layer.
- * See: [Note: IPC streams].
- *
- * @param path The path on the local machine where to write the file to.
- *
- * @param stream The stream which should be written into the file.
- */
-export const writeStream = async (
- path: string,
- stream: ReadableStream | null,
-) => {
- const params = new URLSearchParams({ path });
- const url = new URL(`stream://write?${params.toString()}`);
-
- // The duplex parameter needs to be set to 'half' when streaming requests.
- //
- // Currently browsers, and specifically in our case, the desktop Chromium
- // runtime, don't support 'full' duplex mode (i.e. streaming both the
- // request and the response).
- // https://developer.chrome.com/docs/capabilities/web-apis/fetch-streaming-requests
- const req = new Request(url, {
- // GET can't have a body
- method: "POST",
- // [Note: duplex param required for stream body]
- //
- // The duplex parameter needs to be set to 'half' when streaming
- // requests. However, TypeScript's libdom.d.ts does not include the
- // "duplex" parameter, so we need to silence the tsc error. e.g. see
- // https://github.com/node-fetch/node-fetch/issues/1769.
- //
- // @ts-expect-error See: [Note: duplex param required for stream body]
- duplex: "half",
- body: stream,
- });
-
- const res = await fetch(req);
- if (!res.ok)
- throw new Error(
- `Failed to write stream to ${url.href}: HTTP ${res.status}`,
- );
-};
-
-/**
- * Initate a conversion to MP4, streaming the video contents to the node side.
- *
- * This is a variant of {@link writeStream} tailored for the conversion to MP4.
- *
- * @param video A {@link Blob} containing the video to convert.
- *
- * @returns a token that can then be passed to {@link readVideoStream} to
- * retrieve the converted MP4 file. This three step sequence (write/read/done)
- * can then be ended by using {@link videoStreamDone}).
- *
- * See: [Note: Convert to MP4].
- */
-export const initiateConvertToMP4 = async (video: Blob): Promise<string> => {
- const url = "stream://video?op=convert-to-mp4";
- const res = await fetch(url, { method: "POST", body: video });
- if (!res.ok)
- throw new Error(`Failed to write stream to ${url}: HTTP ${res.status}`);
- return res.text();
-};
-
-/**
- * Variant of {@link readStream} tailored for video conversion.
- *
- * @param token A token obtained from a video conversion operation like
- * {@link initiateConvertToMP4}.
- *
- * @returns a Response that contains the data associated with the provided
- * token.
- */
-export const readVideoStream = async (
- token: string,
-): Promise<Response> => {
- const params = new URLSearchParams({ token });
- const url = new URL(`stream://video?${params.toString()}`);
-
- const req = new Request(url, { method: "GET" });
-
- const res = await fetch(req);
- if (!res.ok)
- throw new Error(
- `Failed to read stream from ${url.href}: HTTP ${res.status}`,
- );
-
- return res;
-};
-
-/**
- * Sibling of {@link readVideoStream} to let the native side know when we are
- * done reading the response, so it can dispose any temporary resources.
- */
-export const videoStreamDone = async (
- token: string,
-): Promise<void> => {
- // The value for `done` is arbitrary, only its presence matters.
- const params = new URLSearchParams({ token, done: "1" });
- const url = new URL(`stream://video?${params.toString()}`);
-
- const req = new Request(url, { method: "GET" });
- const res = await fetch(req);
- if (!res.ok)
- throw new Error(
- `Failed to close stream at ${url.href}: HTTP ${res.status}`,
- );
-};
diff --git a/web/apps/albums/vendor/photos/components/DownloadStatusNotifications.tsx b/web/apps/albums/vendor/photos/components/DownloadStatusNotifications.tsx
index e7b5250a49..8694da0769 100644
--- a/web/apps/albums/vendor/photos/components/DownloadStatusNotifications.tsx
+++ b/web/apps/albums/vendor/photos/components/DownloadStatusNotifications.tsx
@@ -48,23 +48,6 @@ interface DownloadStatusNotificationsProps {
* {@link saveGroup}.
*/
onRemoveSaveGroup: (saveGroup: SaveGroup) => void;
- /**
- * Called when the collection summary with the given {@link collectionID}
- * should be shown. If {@link isHiddenCollectionSummary} is set, then any
- * reauthentication as appropriate before switching to the hidden section of
- * the app is performed first.
- *
- * and hidden attribute should be shown.
- *
- * This is only relevant in the context of the photos app, and can be
- * omitted by the public albums app. See the documentation of
- * {@link SaveGroup}'s {@link collectionSummaryID} property for why we don't
- * store the collection summary itself.
- */
- onShowCollectionSummary?: (
- collectionSummaryID: number | undefined,
- isHiddenCollectionSummary: boolean | undefined,
- ) => void;
/**
* If true, make each notification full width on mobile phones (MUI "sm"
* and below). Tablet and desktop widths remain unchanged.
@@ -78,12 +61,7 @@ interface DownloadStatusNotificationsProps {
*/
export const DownloadStatusNotifications: React.FC<
DownloadStatusNotificationsProps
-> = ({
- saveGroups,
- onRemoveSaveGroup,
- onShowCollectionSummary,
- fullWidthOnMobile,
-}) => {
+> = ({ saveGroups, onRemoveSaveGroup, fullWidthOnMobile }) => {
const { showMiniDialog } = useBaseContext();
const fileLabel = t("file").toLowerCase();
const [cancelDownloadGroup, setCancelDownloadGroup] =
@@ -127,19 +105,7 @@ export const DownloadStatusNotifications: React.FC<
}
};
- const createOnClick = (group: SaveGroup) => () => {
- const electron = globalThis.electron;
- if (electron && group.downloadDirPath) {
- void electron.openDirectory(group.downloadDirPath);
- } else if (onShowCollectionSummary) {
- onShowCollectionSummary(
- group.collectionSummaryID,
- group.isHiddenCollectionSummary,
- );
- } else {
- return undefined;
- }
- };
+ const createOnClick = (_group: SaveGroup) => undefined;
return (
<>
diff --git a/web/apps/albums/vendor/photos/types/supercluster.d.ts b/web/apps/albums/vendor/photos/types/supercluster.d.ts
deleted file mode 100644
index 3a6d672fb6..0000000000
--- a/web/apps/albums/vendor/photos/types/supercluster.d.ts
+++ /dev/null
@@ -1,87 +0,0 @@
-declare module "supercluster" {
- export type BBox = [number, number, number, number];
-
- export interface PointGeometry {
- type: "Point";
- coordinates: [number, number];
- }
-
- export interface PointFeature<TPointProperties = Record<string, unknown>> {
- type: "Feature";
- properties: TPointProperties;
- geometry: PointGeometry;
- }
-
- export interface ClusterProperties {
- cluster: true;
- cluster_id: number;
- point_count: number;
- point_count_abbreviated?: number | string;
- }
-
- export interface ClusterFeature<
- TClusterProperties = Record<string, unknown>,
- > {
- type: "Feature";
- properties: TClusterProperties & ClusterProperties;
- geometry: PointGeometry;
- }
-
- export type ClusterOrPoint<
- TPointProperties = Record<string, unknown>,
- TClusterProperties = Record<string, unknown>,
- > = PointFeature<TPointProperties> | ClusterFeature<TClusterProperties>;
-
- export interface SuperclusterOptions<
- TPointProperties = Record<string, unknown>,
- TClusterProperties = Record<string, unknown>,
- > {
- radius?: number;
- maxZoom?: number;
- minZoom?: number;
- minPoints?: number;
- extent?: number;
- nodeSize?: number;
- log?: boolean;
- generateId?: boolean;
- map?: (props: TPointProperties) => TClusterProperties;
- reduce?: (
- accumulated: TClusterProperties,
- props: TClusterProperties,
- ) => void;
- }
-
- export default class Supercluster<
- TPointProperties = Record<string, unknown>,
- TClusterProperties = Record<string, unknown>,
- > {
- constructor(
- options?: SuperclusterOptions<TPointProperties, TClusterProperties>,
- );
- load(points: PointFeature<TPointProperties>[]): this;
- getClusters(
- bbox: BBox,
- zoom: number,
- ): ClusterOrPoint<TPointProperties, TClusterProperties>[];
- getChildren(
- clusterId: number,
- ): ClusterOrPoint<TPointProperties, TClusterProperties>[];
- getLeaves(
- clusterId: number,
- limit: number,
- offset: number,
- ): PointFeature<TPointProperties>[];
- getClusterExpansionZoom(clusterId: number): number;
- getTile?(
- z: number,
- x: number,
- y: number,
- ): {
- features: {
- type: "Feature";
- geometry: { type: "Point"; coordinates: [number, number] };
- properties: Record<string, unknown>;
- }[];
- } | null;
- }
-}