π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[web] Add hidden albums overview and item header
AswinAsokdaf6330f14e9
diff --git a/web/apps/photos/src/components/SearchBar.tsx b/web/apps/photos/src/components/SearchBar.tsxindex 1f17aea3ed..085d732bdf 100644--- a/web/apps/photos/src/components/SearchBar.tsx+++ b/web/apps/photos/src/components/SearchBar.tsx@@ -164,6 +164,7 @@ export const SearchBar: React.FC<SearchBarProps> = (props) => {slotProps={{paper: {"aria-label": t("search"),+ inert: !open,sx: {width: "621px",maxWidth: "calc(100% - 24px)",diff --git a/web/apps/photos/src/components/collections/CollectionHeader.tsx b/web/apps/photos/src/components/collections/CollectionHeader.tsxindex b6cd49b643..78e2b6e73f 100644--- a/web/apps/photos/src/components/collections/CollectionHeader.tsx+++ b/web/apps/photos/src/components/collections/CollectionHeader.tsx@@ -3,6 +3,7 @@ import { downloadAndSaveCollectionFiles } from "@/services/save";import {CleanIcon,Delete02Icon,+ Download04Icon,Download05Icon,Edit02Icon,Logout01Icon,@@ -157,7 +158,7 @@ export const CollectionHeader: React.FC<CollectionHeaderProps> = (props) => {...(isAlbum && { gridArea: "summary" }),}}>- {(type == "hiddenItems" || type == "archiveItems") && (+ {type == "archiveItems" && (<Tooltip title={t("go_back")}><IconButtonaria-label={t("go_back")}@@ -186,13 +187,20 @@ export const CollectionHeader: React.FC<CollectionHeaderProps> = (props) => {? { sx: { overflowWrap: "anywhere" } }: undefined}- name={name}+ name={+ type == "hiddenItems" ? t("section_hidden") : name+ }description={isAlbum ? undefined : description}descriptionMaxWidth={480}onDescriptionHeightChange={isAlbum ? undefined : onDescriptionHeightChange}fileCount={fileCount}+ countLabel={+ type == "hiddenItems"+ ? t("album_items_count", { count: fileCount })+ : undefined+ }endIcon={<EndIcon />}/></Stack>@@ -700,23 +708,25 @@ const CollectionHeaderOptions: React.FC<CollectionHeaderProps> = ({if (isSmallWidth) {menuOptions.unshift(- showDownloadQuickOption(collectionSummary) && fileCount > 0 && (- <ContextMenuItem- key="download"- disabled={- hasActiveFileSelection ||- isActiveCollectionDownloadInProgress()- }- onClick={downloadCollection}- >- {isActiveCollectionDownloadInProgress() ? (- <ActivityIndicator size="20px" />- ) : (- <DownloadIcon />- )}- {downloadOptionLabel(collectionSummary)}- </ContextMenuItem>- ),+ collectionSummaryType != "hiddenItems" &&+ showDownloadQuickOption(collectionSummary) &&+ fileCount > 0 && (+ <ContextMenuItem+ key="download"+ disabled={+ hasActiveFileSelection ||+ isActiveCollectionDownloadInProgress()+ }+ onClick={downloadCollection}+ >+ {isActiveCollectionDownloadInProgress() ? (+ <ActivityIndicator size="20px" />+ ) : (+ <DownloadIcon />+ )}+ {downloadOptionLabel(collectionSummary)}+ </ContextMenuItem>+ ),showShareQuickOption(collectionSummary) && (<ContextMenuItemkey="share"@@ -872,7 +882,7 @@ const QuickOptions: React.FC<QuickOptionsProps> = ({onClick={onEmptyTrashClick}/>)}- {!isSmallWidth &&+ {(!isSmallWidth || collectionSummary.type == "hiddenItems") &&showDownloadQuickOption(collectionSummary) &&collectionSummary.fileCount > 0 &&(isDownloadInProgress() ? (@@ -981,20 +991,12 @@ type DownloadQuickOptionProps = OptionProps & {};const DownloadIcon: React.FC = () => (- <svg- width="22"- height="22"- viewBox="0 0 24 24"- fill="none"- xmlns="http://www.w3.org/2000/svg"- stroke="currentColor"- strokeWidth="1.5"- strokeLinecap="round"- strokeLinejoin="round"- >- <path d="M2.99969 17.0002C2.99969 17.9302 2.99969 18.3952 3.10192 18.7767C3.37932 19.8119 4.18796 20.6206 5.22324 20.898C5.60474 21.0002 6.06972 21.0002 6.99969 21.0002L16.9997 21.0002C17.9297 21.0002 18.3947 21.0002 18.7762 20.898C19.8114 20.6206 20.6201 19.8119 20.8975 18.7767C20.9997 18.3952 20.9997 17.9302 20.9997 17.0002" />- <path d="M16.4998 11.5002C16.4998 11.5002 13.1856 16.0002 11.9997 16.0002C10.8139 16.0002 7.49976 11.5002 7.49976 11.5002M11.9997 15.0002V3.00016" />- </svg>+ <HugeiconsIcon+ icon={Download04Icon}+ size={22}+ strokeWidth={1.5}+ aria-hidden+ />);const DownloadQuickOption: React.FC<DownloadQuickOptionProps> = ({@@ -1004,7 +1006,11 @@ const DownloadQuickOption: React.FC<DownloadQuickOptionProps> = ({}) => (<Tooltip title={downloadOptionLabel(collectionSummary)}><span>- <IconButton disabled={disabled} onClick={onClick}>+ <IconButton+ disabled={disabled}+ onClick={onClick}+ aria-label={downloadOptionLabel(collectionSummary)}+ ><Boxsx={{width: 24,diff --git a/web/apps/photos/src/components/collections/GalleryBarAndListHeader.tsx b/web/apps/photos/src/components/collections/GalleryBarAndListHeader.tsxindex bc0ede89f6..789dfdf25d 100644--- a/web/apps/photos/src/components/collections/GalleryBarAndListHeader.tsx+++ b/web/apps/photos/src/components/collections/GalleryBarAndListHeader.tsx@@ -5,8 +5,13 @@ import {type CollectionShareProps,} from "@/components/collections/CollectionShare";import type { FileListHeaderOrFooter } from "@/components/FileList";+import {+ HiddenAlbumsHeader,+ hiddenAlbumsHeaderHeight,+} from "@/components/gallery/HiddenAlbumsHeader";import { PeopleHeader } from "@/components/gallery/PeopleHeader";import type { GalleryBarMode } from "@/components/gallery/reducer";+import { Box } from "@mui/material";import { useModalVisibility } from "ente-base/components/utils/modal";import type { Collection } from "ente-media/collection";import {@@ -29,6 +34,7 @@ type GalleryBarAndListHeaderProps = {mode: GalleryBarMode;shouldHide: boolean;collectionSummary: CollectionSummary | undefined;+ hiddenAlbums: CollectionSummary[];activeCollection: Collection | undefined;activePerson: Person | undefined;people: Person[];@@ -58,6 +64,7 @@ export const GalleryBarAndListHeader: React.FC<mode,user,collectionSummary,+ hiddenAlbums,activeCollection,setActiveCollectionID,setBlockingLoad,@@ -112,27 +119,38 @@ export const GalleryBarAndListHeader: React.FC<(activeCollection ||collectionSummary.id <= PseudoCollectionID.all);+ const showHiddenAlbums = collectionSummary?.type == "hiddenItems";+setFileListHeader({component: shouldRenderCollectionHeader ? (- <CollectionHeader- {...{- activeCollection,- setActiveCollectionID,- isActiveCollectionDownloadInProgress,- onRemotePull,- onAddSaveGroup,- onShowMap,- onCollectionSlideshow,- onBackToAlbums,- }}- collectionSummary={collectionSummary}- onCollectionShare={openCollectionShare}- onCollectionManageLink={openCollectionManageLink}- onCollectionCast={showCollectionCast}- onEditAlbumDetails={onEditAlbumDetails}- hasActiveFileSelection={hasActiveFileSelection}- onDescriptionHeightChange={setDescriptionHeight}- />+ <Box sx={{ width: "100%" }}>+ {showHiddenAlbums && (+ <HiddenAlbumsHeader+ albums={hiddenAlbums}+ onSelectAlbum={setActiveCollectionID}+ onBack={onBackToAlbums}+ />+ )}+ <CollectionHeader+ {...{+ activeCollection,+ setActiveCollectionID,+ isActiveCollectionDownloadInProgress,+ onRemotePull,+ onAddSaveGroup,+ onShowMap,+ onCollectionSlideshow,+ onBackToAlbums,+ }}+ collectionSummary={collectionSummary}+ onCollectionShare={openCollectionShare}+ onCollectionManageLink={openCollectionManageLink}+ onCollectionCast={showCollectionCast}+ onEditAlbumDetails={onEditAlbumDetails}+ hasActiveFileSelection={hasActiveFileSelection}+ onDescriptionHeightChange={setDescriptionHeight}+ />+ </Box>) : mode != "people" && collectionSummary ? (<GalleryItemsHeaderAdapter><GalleryItemsSummary@@ -149,13 +167,21 @@ export const GalleryBarAndListHeader: React.FC<) : (<></>),- height: 72 + (albumDescription ? descriptionHeight : 0),+ height:+ 72 ++ (showHiddenAlbums+ ? hiddenAlbums.length+ ? hiddenAlbumsHeaderHeight+ : 78+ : 0) ++ (albumDescription ? descriptionHeight : 0),});// eslint-disable-next-line react-hooks/exhaustive-deps}, [shouldHide,mode,collectionSummary,+ hiddenAlbums,activeCollection,isActiveCollectionDownloadInProgress,activePerson,diff --git a/web/apps/photos/src/components/gallery/AlbumTile.tsx b/web/apps/photos/src/components/gallery/AlbumTile.tsxnew file mode 100644index 0000000000..00f9e53448--- /dev/null+++ b/web/apps/photos/src/components/gallery/AlbumTile.tsx@@ -0,0 +1,146 @@+import { PinIcon } from "@hugeicons/core-free-icons";+import { HugeiconsIcon } from "@hugeicons/react";+import { Box, Stack, Typography, styled } from "@mui/material";+import { ItemCard } from "ente-new/photos/components/Tiles";+import { UnstyledButton } from "ente-new/photos/components/UnstyledButton";+import type { CollectionSummary } from "ente-new/photos/services/collection-summary";+import { t } from "i18next";++interface AlbumTileProps {+ album: CollectionSummary;+ onSelectAlbum: (id: number) => void;+ isScrolling?: boolean;+ isLinks?: boolean;+ countLabel?: string;+ showBadges?: boolean;+}++export const AlbumTile = ({+ album,+ onSelectAlbum,+ isScrolling,+ isLinks,+ countLabel,+ showBadges = true,+}: AlbumTileProps) => {+ const badge = album.attributes.has("sharedIncoming")+ ? t("album_overview_received_title")+ : album.attributes.has("sharedOutgoing") ||+ album.attributes.has("sharedViaLink")+ ? t("shared_albums_label")+ : undefined;+ return (+ <AlbumTileButton+ title={album.name}+ onClick={() => onSelectAlbum(album.id)}+ >+ <ItemCard+ TileComponent={AlbumTileCover}+ coverFile={album.coverFile}+ isScrolling={isScrolling}+ >+ {showBadges && !isLinks && badge && (+ <Box+ component="span"+ sx={{+ position: "absolute",+ right: 8,+ bottom: 8,+ height: 24,+ px: "8px",+ borderRadius: "8px",+ bgcolor: "rgba(0,0,0,.55)",+ color: "#fff",+ fontSize: 11,+ fontWeight: 600,+ display: "flex",+ alignItems: "center",+ backdropFilter: "blur(6px)",+ maxWidth: "calc(100% - 16px)",+ overflow: "hidden",+ whiteSpace: "nowrap",+ }}+ >+ {badge}+ </Box>+ )}+ </ItemCard>+ <Stack+ component="span"+ sx={{ width: "100%", gap: "var(--album-text-gap, 2px)" }}+ >+ <Stack+ component="span"+ direction="row"+ sx={{ alignItems: "center", gap: "4px", minWidth: 0 }}+ >+ <Typography+ component="span"+ noWrap+ sx={{+ fontSize: "var(--album-name-size)",+ lineHeight: "20px",+ fontWeight: 500,+ }}+ >+ {album.name}+ </Typography>+ {showBadges &&+ (album.attributes.has("pinned") ||+ album.attributes.has("shareePinned")) && (+ <Box+ component={HugeiconsIcon}+ icon={PinIcon}+ size={12}+ sx={{ flexShrink: 0, color: "text.faint" }}+ />+ )}+ </Stack>+ <Typography+ component="span"+ sx={{+ fontSize: "var(--album-count-size)",+ lineHeight: "16px",+ fontWeight: 500,+ color: "text.muted",+ }}+ >+ {countLabel ??+ t("album_items_count", { count: album.fileCount })}+ </Typography>+ </Stack>+ </AlbumTileButton>+ );+};++export const AlbumTileButton = styled(UnstyledButton)(({ theme }) => ({+ width: "var(--album-tile-width, 140px)",+ flexShrink: 0,+ display: "flex",+ flexDirection: "column",+ alignItems: "flex-start",+ gap: 8,+ color: theme.vars.palette.text.base,+ textAlign: "left",+ borderRadius: 20,+ "&:hover": { opacity: 0.86 },+ "&:focus-visible": {+ outline: `2px solid ${theme.vars.palette.stroke.base}`,+ outlineOffset: -2,+ },+}));++export const AlbumTileCover = styled("div")({+ width: "var(--album-tile-width, 140px)",+ height: "var(--album-tile-width, 140px)",+ flexShrink: 0,+ borderRadius: 20,+ overflow: "hidden",+ position: "relative",+ "& > img": {+ width: "100%",+ height: "100%",+ objectFit: "cover",+ display: "block",+ },+});diff --git a/web/apps/photos/src/components/gallery/AlbumsOverview.tsx b/web/apps/photos/src/components/gallery/AlbumsOverview.tsxindex 613111e059..8b6f6f800c 100644--- a/web/apps/photos/src/components/gallery/AlbumsOverview.tsx+++ b/web/apps/photos/src/components/gallery/AlbumsOverview.tsx@@ -1,11 +1,7 @@import { useDeleteEmptyAlbums } from "@/components/collections/useDeleteEmptyAlbums";import type { RemotePullOpts } from "@/components/gallery";import type { AlbumFilter } from "@/utils/album-filters";-import {- Delete02Icon,- ImageAdd02Icon,- PinIcon,-} from "@hugeicons/core-free-icons";+import { Delete02Icon, ImageAdd02Icon } from "@hugeicons/core-free-icons";import { HugeiconsIcon } from "@hugeicons/react";import {Box,@@ -13,12 +9,9 @@ import {Stack,Tooltip,Typography,- styled,useMediaQuery,useTheme,} from "@mui/material";-import { ItemCard } from "ente-new/photos/components/Tiles";-import { UnstyledButton } from "ente-new/photos/components/UnstyledButton";import type {CollectionSummary,CollectionsSortBy,@@ -27,6 +20,11 @@ import { t } from "i18next";import { useEffect, useRef, useState } from "react";import AutoSizer from "react-virtualized-auto-sizer";import { FixedSizeList, type ListChildComponentProps } from "react-window";+import {+ AlbumTileButton as AlbumButton,+ AlbumTile,+ AlbumTileCover as Cover,+} from "./AlbumTile";interface AlbumsOverviewProps {albums: CollectionSummary[];@@ -292,134 +290,16 @@ const AlbumsRow = ({</AlbumButton>);const album = data.albums[itemIndex - Number(data.showCreate)]!;- const badge = album.attributes.has("sharedIncoming")- ? t("album_overview_received_title")- : album.attributes.has("sharedOutgoing") ||- album.attributes.has("sharedViaLink")- ? t("shared_albums_label")- : undefined;return (- <AlbumButton+ <AlbumTilekey={album.id}- title={album.name}- onClick={() => data.onSelectAlbum(album.id)}- >- <ItemCard- TileComponent={Cover}- coverFile={album.coverFile}- isScrolling={isScrolling}- >- {!data.isLinks && badge && (- <Box- component="span"- sx={{- position: "absolute",- right: 8,- bottom: 8,- height: 24,- px: "8px",- borderRadius: "8px",- bgcolor: "rgba(0,0,0,.55)",- color: "#fff",- fontSize: 11,- fontWeight: 600,- display: "flex",- alignItems: "center",- backdropFilter: "blur(6px)",- maxWidth: "calc(100% - 16px)",- overflow: "hidden",- whiteSpace: "nowrap",- }}- >- {badge}- </Box>- )}- </ItemCard>- <Stack- component="span"- sx={{ width: "100%", gap: "2px" }}- >- <Stack- component="span"- direction="row"- sx={{- alignItems: "center",- gap: "4px",- minWidth: 0,- }}- >- <Typography- component="span"- noWrap- sx={{- fontSize: "var(--album-name-size)",- lineHeight: "20px",- fontWeight: 500,- }}- >- {album.name}- </Typography>- {(album.attributes.has("pinned") ||- album.attributes.has("shareePinned")) && (- <Box- component={HugeiconsIcon}- icon={PinIcon}- size={12}- sx={{- flexShrink: 0,- color: "text.faint",- }}- />- )}- </Stack>- <Typography- component="span"- sx={{- fontSize: "var(--album-count-size)",- lineHeight: "16px",- fontWeight: 500,- color: "text.muted",- }}- >- {t("album_items_count", {- count: album.fileCount,- })}- </Typography>- </Stack>- </AlbumButton>+ album={album}+ onSelectAlbum={data.onSelectAlbum}+ isScrolling={isScrolling}+ isLinks={data.isLinks}+ />);})}</div>);};--const AlbumButton = styled(UnstyledButton)(({ theme }) => ({- width: "var(--album-tile-width)",- display: "flex",- flexDirection: "column",- alignItems: "flex-start",- gap: 8,- color: theme.vars.palette.text.base,- textAlign: "left",- borderRadius: 20,- "&:hover": { opacity: 0.86 },- "&:focus-visible": {- outline: `2px solid ${theme.vars.palette.stroke.base}`,- outlineOffset: -2,- },-}));--const Cover = styled("div")({- width: "var(--album-tile-width)",- height: "var(--album-tile-width)",- flexShrink: 0,- borderRadius: 20,- overflow: "hidden",- position: "relative",- "& > img": {- width: "100%",- height: "100%",- objectFit: "cover",- display: "block",- },-});diff --git a/web/apps/photos/src/components/gallery/BarImpl.tsx b/web/apps/photos/src/components/gallery/BarImpl.tsxindex 598f6bbdb8..163f30657f 100644--- a/web/apps/photos/src/components/gallery/BarImpl.tsx+++ b/web/apps/photos/src/components/gallery/BarImpl.tsx@@ -123,7 +123,7 @@ export const GalleryBarImpl: React.FC<GalleryBarImplProps> = ({const albumListRef = useRef<VariableSizeList | null>(null);const searchInputRef = useRef<HTMLInputElement>(null);const [peopleSearchQuery, setPeopleSearchQuery] = useState("");- const [linksExpanded, setLinksExpanded] = useState(true);+ const [groupExpanded, setGroupExpanded] = useState(true);const searchQuery = mode == "people" ? peopleSearchQuery : albumSearchQuery;const setSearchQuery =mode == "people" ? setPeopleSearchQuery : onAlbumSearchQueryChange;@@ -171,7 +171,7 @@ export const GalleryBarImpl: React.FC<GalleryBarImplProps> = ({}, [albumFilter]);useEffect(() => {setPeopleSearchQuery("");- if (mode == "links") setLinksExpanded(true);+ setGroupExpanded(true);}, [mode]);useEffect(() => {@@ -199,7 +199,10 @@ export const GalleryBarImpl: React.FC<GalleryBarImplProps> = ({? {type: "collections",collectionSummaries: displayedCollectionSummaries,- indented: mode == "albums" || mode == "links",+ indented:+ mode == "albums" ||+ mode == "links" ||+ mode == "hidden-albums",activeCollectionID: activeCollectionID!,onSelectCollectionID,}@@ -473,6 +476,11 @@ export const GalleryBarImpl: React.FC<GalleryBarImplProps> = ({isSearching,]);+ const isGroupOverview =+ mode == "links"+ ? activeCollectionID === undefined+ : activeCollectionID == PseudoCollectionID.hiddenItems;+const navigation = (<Stackcomponent="nav"@@ -690,30 +698,31 @@ export const GalleryBarImpl: React.FC<GalleryBarImplProps> = ({)}</AutoSizer></Box>- ) : mode == "links" ? (+ ) : mode == "links" || mode == "hidden-albums" ? (<Stackrole="group"- aria-label={t("links")}+ aria-label={t(mode == "links" ? "links" : "section_hidden")}sx={{ flex: 1, minHeight: 0, minWidth: 0 }}><BarCard- aria-current={- activeCollectionID === undefined- ? "page"- : undefined- }- aria-expanded={isSearching || linksExpanded}+ aria-current={isGroupOverview ? "page" : undefined}+ aria-expanded={isSearching || groupExpanded}onClick={() => {- setLinksExpanded(- activeCollectionID !== undefined ||- !linksExpanded,+ setGroupExpanded(+ !isGroupOverview || !groupExpanded,);- onShowLinksOverview();+ if (mode == "links") onShowLinksOverview();+ else+ onSelectCollectionID(+ PseudoCollectionID.hiddenItems,+ );mobileDrawerProps.onClose();}}sx={{ flexShrink: 0, height: rowHeight }}>- <CardText>{t("links")}</CardText>+ <CardText>+ {t(mode == "links" ? "links" : "section_hidden")}+ </CardText><Boxcomponent={HugeiconsIcon}icon={ArrowDown01Icon}@@ -722,13 +731,13 @@ export const GalleryBarImpl: React.FC<GalleryBarImplProps> = ({sx={{color: "text.muted",transform:- isSearching || linksExpanded+ isSearching || groupExpanded? undefined: "rotate(-90deg)",}}/></BarCard>- {(isSearching || linksExpanded) && items}+ {(isSearching || groupExpanded) && items}</Stack>) : (itemsdiff --git a/web/apps/photos/src/components/gallery/HiddenAlbumsHeader.tsx b/web/apps/photos/src/components/gallery/HiddenAlbumsHeader.tsxnew file mode 100644index 0000000000..2bbe514ff3--- /dev/null+++ b/web/apps/photos/src/components/gallery/HiddenAlbumsHeader.tsx@@ -0,0 +1,105 @@+import ArrowBackIcon from "@mui/icons-material/ArrowBack";+import { IconButton, Stack, Tooltip, Typography } from "@mui/material";+import type { CollectionSummary } from "ente-new/photos/services/collection-summary";+import { t } from "i18next";+import { useEffect, useRef, useState } from "react";+import { AlbumTile } from "./AlbumTile";++interface HiddenAlbumsHeaderProps {+ albums: CollectionSummary[];+ onSelectAlbum: (id: number) => void;+ onBack: () => void;+}++// Includes the spacing before the hidden-items summary in the virtualized list.+export const hiddenAlbumsHeaderHeight = 311;++export const HiddenAlbumsHeader = ({+ albums,+ onSelectAlbum,+ onBack,+}: HiddenAlbumsHeaderProps) => {+ const rowRef = useRef<HTMLDivElement>(null);+ const [hasMoreAlbums, setHasMoreAlbums] = useState(false);++ useEffect(() => {+ const row = rowRef.current;+ if (!row) return;++ const updateFade = () =>+ setHasMoreAlbums(+ row.scrollWidth - row.clientWidth - row.scrollLeft > 1,+ );+ updateFade();+ row.addEventListener("scroll", updateFade, { passive: true });+ const observer = new ResizeObserver(updateFade);+ observer.observe(row);+ return () => {+ row.removeEventListener("scroll", updateFade);+ observer.disconnect();+ };+ }, [albums.length]);++ return (+ <Stack+ sx={{+ height: albums.length ? hiddenAlbumsHeaderHeight : 78,+ gap: "24px",+ }}+ >+ <Stack+ direction="row"+ sx={{ alignItems: "center", minHeight: 54, gap: 1 }}+ >+ <Tooltip title={t("go_back")}>+ <IconButton+ aria-label={t("go_back")}+ onClick={onBack}+ sx={{ width: 32, height: 32 }}+ >+ <ArrowBackIcon sx={{ fontSize: 20 }} />+ </IconButton>+ </Tooltip>+ <Typography+ component="h2"+ sx={{+ fontFamily: '"Outfit Variable", Outfit, sans-serif',+ fontWeight: 600,+ fontSize: 24,+ lineHeight: "32px",+ }}+ >+ {t("hidden_albums")}+ </Typography>+ </Stack>+ <Stack+ ref={rowRef}+ direction="row"+ sx={{+ "--album-name-size": "14px",+ "--album-count-size": "12px",+ "--album-text-gap": "4px",+ gap: "22px",+ overflowX: "auto",+ pb: "12px",+ minHeight: 0,+ maskImage: hasMoreAlbums+ ? "linear-gradient(to right, black calc(100% - 110px), transparent 100%)"+ : undefined,+ }}+ >+ {albums.map((album) => (+ <AlbumTile+ key={album.id}+ album={album}+ onSelectAlbum={onSelectAlbum}+ showBadges={false}+ countLabel={t("photos_count", {+ count: album.fileCount,+ })}+ />+ ))}+ </Stack>+ </Stack>+ );+};diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsxindex 5405edf73f..9861e54fbf 100644--- a/web/apps/photos/src/pages/gallery.tsx+++ b/web/apps/photos/src/pages/gallery.tsx@@ -2274,6 +2274,7 @@ const Page: React.FC = () => {{!isCleanupViewOpen && (<><GalleryBarAndListHeader+ hiddenAlbums={sidebarCollectionSummaries}{...{user,activeCollection,diff --git a/web/apps/photos/tests/sidebar-album-search.test.tsx b/web/apps/photos/tests/sidebar-album-search.test.tsxindex c7bcc292dd..07b3e1fd93 100644--- a/web/apps/photos/tests/sidebar-album-search.test.tsx+++ b/web/apps/photos/tests/sidebar-album-search.test.tsx@@ -242,8 +242,18 @@ describe("Hidden and Archive sidebars", () => {expect(html).toContain('aria-label="search_in_albums"');expect(html).toContain('aria-label="Family"');expect(html).toContain('aria-label="Holiday album"');+ const buttons = (html.match(/<button\b[^>]*>/g) ?? []).join("");for (const label of ["Uncategorized", "Hidden", "Archive", "Trash"])- expect(html).not.toContain(`aria-label="${label}"`);+ expect(buttons).not.toContain(`aria-label="${label}"`);+ if (mode == "hidden-albums")+ expect(html).toContain('role="group" aria-label="Hidden"');},);++ test("keeps the Hidden group available when there are no albums", () => {+ const html = renderSearch("", "ente", "hidden-albums", []);+ expect(html).toContain('role="group" aria-label="Hidden"');+ expect(html).toContain('aria-expanded="true"');+ expect(html).toContain(">Hidden<");+ });});diff --git a/web/packages/new/photos/components/gallery/ListHeader.tsx b/web/packages/new/photos/components/gallery/ListHeader.tsxindex f3170261a0..980e6f5f46 100644--- a/web/packages/new/photos/components/gallery/ListHeader.tsx+++ b/web/packages/new/photos/components/gallery/ListHeader.tsx@@ -15,6 +15,7 @@ interface GalleryItemsSummaryProps {descriptionMaxWidth?: number;nameProps?: TypographyProps;fileCount: number;+ countLabel?: string;endIcon?: React.ReactNode;// This cannot be the only way to invoke the action; it is mouse-only.onNameClick?: () => void;@@ -27,6 +28,7 @@ export const GalleryItemsSummary: React.FC<GalleryItemsSummaryProps> = ({descriptionMaxWidth,nameProps,fileCount,+ countLabel,endIcon,onNameClick,onDescriptionHeightChange,@@ -71,7 +73,7 @@ export const GalleryItemsSummary: React.FC<GalleryItemsSummaryProps> = ({lineHeight: "20px",}}>- {t("photos_count", { count: fileCount })}+ {countLabel ?? t("photos_count", { count: fileCount })}</Typography>{endIcon && (<Box sx={{ svg: { fontSize: "17px", color: "text.muted" } }}>