π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[web][photos] Refine header spacing and cover accessibility
AswinAsok2f511d51af5f
diff --git a/web/apps/photos/src/components/collections/CollectionHeader.tsx b/web/apps/photos/src/components/collections/CollectionHeader.tsxindex 0082b4718b..80e7e303c8 100644--- a/web/apps/photos/src/components/collections/CollectionHeader.tsx+++ b/web/apps/photos/src/components/collections/CollectionHeader.tsx@@ -25,7 +25,14 @@ import CheckIcon from "@mui/icons-material/Check";import LinkIcon from "@mui/icons-material/Link";import MoreHorizIcon from "@mui/icons-material/MoreHoriz";import PublicIcon from "@mui/icons-material/Public";-import { Box, IconButton, Stack, Tooltip } from "@mui/material";+import {+ Box,+ IconButton,+ Stack,+ Tooltip,+ useMediaQuery,+ useTheme,+} from "@mui/material";import { SpacedRow } from "ente-base/components/containers";import { ContextMenu, ContextMenuItem } from "ente-base/components/ContextMenu";import { ActivityIndicator } from "ente-base/components/mui/ActivityIndicator";@@ -97,6 +104,7 @@ export interface CollectionHeaderProps {export const CollectionHeader: React.FC<CollectionHeaderProps> = (props) => {const { activeCollection, collectionSummary, onHeightChange } = props;const headerRef = useRef<HTMLDivElement>(null);+ const showCover = useMediaQuery(useTheme().breakpoints.up("sm"));useEffect(() => {const header = headerRef.current;@@ -172,15 +180,19 @@ export const CollectionHeader: React.FC<CollectionHeaderProps> = (props) => {</IconButton></Tooltip>)}- {isAlbum && (- <ItemCard- key={`${collectionSummary.id}-${collectionSummary.coverFile?.id ?? "empty"}`}- TileComponent={GalleryItemsCoverTile}- coverFile={collectionSummary.coverFile}- />+ {isAlbum && showCover && (+ <Box+ aria-hidden+ sx={{ flexShrink: 0, alignSelf: "flex-start" }}+ >+ <ItemCard+ key={`${collectionSummary.id}-${collectionSummary.coverFile?.id ?? "empty"}`}+ TileComponent={GalleryItemsCoverTile}+ coverFile={collectionSummary.coverFile}+ />+ </Box>)}<GalleryItemsSummary- compact={isAlbum}nameProps={isAlbum? { sx: { overflowWrap: "anywhere" } }diff --git a/web/apps/photos/src/components/gallery/PeopleHeader.tsx b/web/apps/photos/src/components/gallery/PeopleHeader.tsxindex dbfff7caab..4e41eb4cd4 100644--- a/web/apps/photos/src/components/gallery/PeopleHeader.tsx+++ b/web/apps/photos/src/components/gallery/PeopleHeader.tsx@@ -11,6 +11,7 @@ import RestoreIcon from "@mui/icons-material/Restore";import SearchIcon from "@mui/icons-material/Search";import VisibilityOutlinedIcon from "@mui/icons-material/VisibilityOutlined";import {+ Box,Dialog,DialogActions,DialogContent,@@ -27,6 +28,7 @@ import {Tooltip,Typography,useMediaQuery,+ useTheme,} from "@mui/material";import { CenteredFill, SpacedRow } from "ente-base/components/containers";import { ActivityErrorIndicator } from "ente-base/components/ErrorIndicator";@@ -131,25 +133,37 @@ const PersonHeaderSummary = ({}: { person: Person } & Pick<React.ComponentProps<typeof GalleryItemsSummary>,"name" | "nameProps" | "onNameClick"->) => (- <Stack direction="row" sx={{ gap: 2, alignItems: "center", minWidth: 0 }}>- <ItemCard- key={`${person.id}-${person.displayFaceID}`}- TileComponent={GalleryItemsCoverTile}- coverFile={person.displayFaceFile}- coverFaceID={person.displayFaceID}- />- <GalleryItemsSummary- {...summaryProps}- compact- fileCount={person.fileIDs.length}- nameProps={{- ...summaryProps.nameProps,- sx: { overflowWrap: "anywhere" },- }}- />- </Stack>-);+>) => {+ const showCover = useMediaQuery(useTheme().breakpoints.up("sm"));+ return (+ <Stack+ direction="row"+ sx={{ gap: 2, alignItems: "center", minWidth: 0 }}+ >+ {showCover && (+ <Box+ aria-hidden+ sx={{ flexShrink: 0, alignSelf: "flex-start" }}+ >+ <ItemCard+ key={`${person.id}-${person.displayFaceID}`}+ TileComponent={GalleryItemsCoverTile}+ coverFile={person.displayFaceFile}+ coverFaceID={person.displayFaceID}+ />+ </Box>+ )}+ <GalleryItemsSummary+ {...summaryProps}+ fileCount={person.fileIDs.length}+ nameProps={{+ ...summaryProps.nameProps,+ sx: { overflowWrap: "anywhere" },+ }}+ />+ </Stack>+ );+};interface CGroupPersonHeaderProps {person: CGroupPerson;diff --git a/web/packages/new/photos/components/gallery/ListHeader.tsx b/web/packages/new/photos/components/gallery/ListHeader.tsxindex 805ee00f6b..f3170261a0 100644--- a/web/packages/new/photos/components/gallery/ListHeader.tsx+++ b/web/packages/new/photos/components/gallery/ListHeader.tsx@@ -11,7 +11,6 @@ import React, { useEffect, useRef, useState } from "react";interface GalleryItemsSummaryProps {name: string;- compact?: boolean;description?: string;descriptionMaxWidth?: number;nameProps?: TypographyProps;@@ -24,7 +23,6 @@ interface GalleryItemsSummaryProps {export const GalleryItemsSummary: React.FC<GalleryItemsSummaryProps> = ({name,- compact = false,description,descriptionMaxWidth,nameProps,@@ -60,8 +58,8 @@ export const GalleryItemsSummary: React.FC<GalleryItemsSummaryProps> = ({sx={{gap: 1.5,// Keep the header height stable without an end icon.- minHeight: compact ? "20px" : "24px",- mt: compact ? "2px" : "4px",+ minHeight: "20px",+ mt: "2px",}}><Typography@@ -70,7 +68,7 @@ export const GalleryItemsSummary: React.FC<GalleryItemsSummaryProps> = ({color: "text.muted",fontSize: "14px",fontWeight: 500,- lineHeight: compact ? "20px" : "18px",+ lineHeight: "20px",}}>{t("photos_count", { count: fileCount })}@@ -167,10 +165,7 @@ export const GalleryItemsHeaderAdapter = styled("div")`margin-bottom: 12px;`;-/** A compact cover shared by album and person gallery headers. */-export const GalleryItemsCoverTile = styled("div")(({ theme }) => ({- display: "none",- [theme.breakpoints.up("sm")]: { display: "block" },+export const GalleryItemsCoverTile = styled("div")({width: 54,height: 54,flexShrink: 0,@@ -179,4 +174,4 @@ export const GalleryItemsCoverTile = styled("div")(({ theme }) => ({position: "relative",alignSelf: "flex-start","& > img": { width: "100%", height: "100%", objectFit: "cover" },-}));+});