π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[web][photos] Match Archive view to Hidden
AswinAsoke8d0e6640a62
diff --git a/web/apps/photos/src/components/collections/CollectionHeader.tsx b/web/apps/photos/src/components/collections/CollectionHeader.tsxindex e5f5da10f9..722195ab1a 100644--- a/web/apps/photos/src/components/collections/CollectionHeader.tsx+++ b/web/apps/photos/src/components/collections/CollectionHeader.tsx@@ -21,7 +21,6 @@ import {} from "@hugeicons/core-free-icons";import { HugeiconsIcon } from "@hugeicons/react";import ArchiveOutlinedIcon from "@mui/icons-material/ArchiveOutlined";-import ArrowBackIcon from "@mui/icons-material/ArrowBack";import CheckIcon from "@mui/icons-material/Check";import LinkIcon from "@mui/icons-material/Link";import MoreHorizIcon from "@mui/icons-material/MoreHoriz";@@ -158,17 +157,6 @@ export const CollectionHeader: React.FC<CollectionHeaderProps> = (props) => {...(isAlbum && { gridArea: "summary" }),}}>- {type == "archiveItems" && (- <Tooltip title={t("go_back")}>- <IconButton- aria-label={t("go_back")}- onClick={props.onBackToAlbums}- sx={{ width: 32, height: 32 }}- >- <ArrowBackIcon sx={{ fontSize: 20 }} />- </IconButton>- </Tooltip>- )}{isAlbum && showCover && (<Boxaria-hidden@@ -187,7 +175,9 @@ export const CollectionHeader: React.FC<CollectionHeaderProps> = (props) => {? { sx: { overflowWrap: "anywhere" } }: undefined}- name={name}+ name={+ type == "archiveItems" ? t("archived_items") : name+ }description={isAlbum ? undefined : description}descriptionMaxWidth={480}onDescriptionHeightChange={diff --git a/web/apps/photos/src/components/collections/GalleryBarAndListHeader.tsx b/web/apps/photos/src/components/collections/GalleryBarAndListHeader.tsxindex 789dfdf25d..4fa1e36931 100644--- a/web/apps/photos/src/components/collections/GalleryBarAndListHeader.tsx+++ b/web/apps/photos/src/components/collections/GalleryBarAndListHeader.tsx@@ -6,9 +6,9 @@ import {} from "@/components/collections/CollectionShare";import type { FileListHeaderOrFooter } from "@/components/FileList";import {- HiddenAlbumsHeader,- hiddenAlbumsHeaderHeight,-} from "@/components/gallery/HiddenAlbumsHeader";+ AlbumsHeader,+ albumsHeaderHeight,+} from "@/components/gallery/AlbumsHeader";import { PeopleHeader } from "@/components/gallery/PeopleHeader";import type { GalleryBarMode } from "@/components/gallery/reducer";import { Box } from "@mui/material";@@ -23,6 +23,7 @@ import {type CollectionSummary,} from "ente-new/photos/services/collection-summary";import type { Person } from "ente-new/photos/services/ml/people";+import { t } from "i18next";import React, { useCallback, useEffect, useState } from "react";import { AlbumCastDialog } from "./AlbumCastDialog";import {@@ -34,7 +35,7 @@ type GalleryBarAndListHeaderProps = {mode: GalleryBarMode;shouldHide: boolean;collectionSummary: CollectionSummary | undefined;- hiddenAlbums: CollectionSummary[];+ albums: CollectionSummary[];activeCollection: Collection | undefined;activePerson: Person | undefined;people: Person[];@@ -64,7 +65,7 @@ export const GalleryBarAndListHeader: React.FC<mode,user,collectionSummary,- hiddenAlbums,+ albums,activeCollection,setActiveCollectionID,setBlockingLoad,@@ -119,14 +120,21 @@ export const GalleryBarAndListHeader: React.FC<(activeCollection ||collectionSummary.id <= PseudoCollectionID.all);- const showHiddenAlbums = collectionSummary?.type == "hiddenItems";+ const showAlbums =+ collectionSummary?.type == "hiddenItems" ||+ collectionSummary?.type == "archiveItems";setFileListHeader({component: shouldRenderCollectionHeader ? (<Box sx={{ width: "100%" }}>- {showHiddenAlbums && (- <HiddenAlbumsHeader- albums={hiddenAlbums}+ {showAlbums && (+ <AlbumsHeader+ title={t(+ collectionSummary.type == "hiddenItems"+ ? "hidden_albums"+ : "archived_albums",+ )}+ albums={albums}onSelectAlbum={setActiveCollectionID}onBack={onBackToAlbums}/>@@ -169,11 +177,7 @@ export const GalleryBarAndListHeader: React.FC<),height:72 +- (showHiddenAlbums- ? hiddenAlbums.length- ? hiddenAlbumsHeaderHeight- : 78- : 0) ++ (showAlbums ? (albums.length ? albumsHeaderHeight : 78) : 0) +(albumDescription ? descriptionHeight : 0),});// eslint-disable-next-line react-hooks/exhaustive-deps@@ -181,7 +185,7 @@ export const GalleryBarAndListHeader: React.FC<shouldHide,mode,collectionSummary,- hiddenAlbums,+ albums,activeCollection,isActiveCollectionDownloadInProgress,activePerson,diff --git a/web/apps/photos/src/components/gallery/HiddenAlbumsHeader.tsx b/web/apps/photos/src/components/gallery/AlbumsHeader.tsxsimilarity index 91%rename from web/apps/photos/src/components/gallery/HiddenAlbumsHeader.tsxrename to web/apps/photos/src/components/gallery/AlbumsHeader.tsxindex fcbc3f5427..0b4676be43 100644--- a/web/apps/photos/src/components/gallery/HiddenAlbumsHeader.tsx+++ b/web/apps/photos/src/components/gallery/AlbumsHeader.tsx@@ -7,25 +7,27 @@ import AutoSizer from "react-virtualized-auto-sizer";import { FixedSizeList, type ListChildComponentProps } from "react-window";import { AlbumTile } from "./AlbumTile";-interface HiddenAlbumsHeaderProps {+interface AlbumsHeaderProps {+ title: string;albums: CollectionSummary[];onSelectAlbum: (id: number) => void;onBack: () => void;}-export const hiddenAlbumsHeaderHeight = 311;+export const albumsHeaderHeight = 311;-export const HiddenAlbumsHeader = ({+export const AlbumsHeader = ({+ title,albums,onSelectAlbum,onBack,-}: HiddenAlbumsHeaderProps) => {+}: AlbumsHeaderProps) => {const [scrollOffset, setScrollOffset] = useState(0);return (<Stacksx={{- height: albums.length ? hiddenAlbumsHeaderHeight : 78,+ height: albums.length ? albumsHeaderHeight : 78,gap: "24px",}}>@@ -51,7 +53,7 @@ export const HiddenAlbumsHeader = ({lineHeight: "32px",}}>- {t("hidden_albums")}+ {title}</Typography></Stack>{albums.length > 0 && (@@ -92,7 +94,7 @@ export const HiddenAlbumsHeader = ({: undefined,}}>- {HiddenAlbumTile}+ {HeaderAlbumTile}</FixedSizeList>)}</AutoSizer>@@ -102,13 +104,13 @@ export const HiddenAlbumsHeader = ({);};-const HiddenAlbumTile = ({+const HeaderAlbumTile = ({index,style,data: { albums, onSelectAlbum },isScrolling,}: ListChildComponentProps<- Pick<HiddenAlbumsHeaderProps, "albums" | "onSelectAlbum">+ Pick<AlbumsHeaderProps, "albums" | "onSelectAlbum">>) => {const album = albums[index]!;return (diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsxindex 9861e54fbf..3515cf223d 100644--- a/web/apps/photos/src/pages/gallery.tsx+++ b/web/apps/photos/src/pages/gallery.tsx@@ -2274,7 +2274,7 @@ const Page: React.FC = () => {{!isCleanupViewOpen && (<><GalleryBarAndListHeader- hiddenAlbums={sidebarCollectionSummaries}+ albums={sidebarCollectionSummaries}{...{user,activeCollection,diff --git a/web/packages/base/locales/en-US/translation.json b/web/packages/base/locales/en-US/translation.jsonindex cccc5f6bd7..9d81bb33f0 100644--- a/web/packages/base/locales/en-US/translation.json+++ b/web/packages/base/locales/en-US/translation.json@@ -833,6 +833,8 @@"all_hidden_albums": "All hidden albums","hidden_albums": "Hidden albums","hidden_items": "Hidden items",+ "archived_albums": "Archived albums",+ "archived_items": "Archived items","enter_two_factor_otp": "Enter the 6-digit code from your authenticator app.","create_account": "Create account","copied": "Copied",