Skip to content

armgit / ente

Public Imported from GitHub
0

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

Reduce noise

Manav Rathi4029398351e8
diff --git a/web/packages/new/photos/components/utils/thumbnail-grid-layout.ts b/web/packages/new/photos/components/utils/thumbnail-grid-layout.ts
index cfe1b9b34d..b273efce87 100644
--- a/web/packages/new/photos/components/utils/thumbnail-grid-layout.ts
+++ b/web/packages/new/photos/components/utils/thumbnail-grid-layout.ts
@@ -1,13 +1,30 @@
export interface ThumbnailGridLayoutParams {
- /** The inline padding (px) of the thumbnail grid. */
+ /**
+ * The overall width available to us.
+ *
+ * This is the height that is the input to the computation, stashed here so
+ * that other parts of the code downstream can also get at it if needed.
+ */
+ containerWidth: number;
+ /**
+ * The inline padding (px) of the thumbnail grid.
+ */
paddingInline: number;
- /** The number of columns in the thumbnail grid. */
+ /**
+ * The number of columns in the thumbnail grid.
+ */
columns: number;
- /** The width (px) of each item. */
+ /**
+ * The width (px) of each item.
+ */
itemWidth: number;
- /** The height (px) of each item. */
+ /**
+ * The height (px) of each item.
+ */
itemHeight: number;
- /** The gap (px) between each grid item. */
+ /**
+ * The gap (px) between each grid item.
+ */
gap: number;
}
@@ -36,6 +53,7 @@ export const computeThumbnailGridLayoutParams = (
const gap = GAP_BTW_TILES;
return {
+ containerWidth,
paddingInline,
columns,
itemWidth,
diff --git a/web/packages/new/photos/pages/duplicates.tsx b/web/packages/new/photos/pages/duplicates.tsx
index f36c147a16..e7221f3d74 100644
--- a/web/packages/new/photos/pages/duplicates.tsx
+++ b/web/packages/new/photos/pages/duplicates.tsx
@@ -486,7 +486,8 @@ const DuplicatesList: React.FC<DuplicatesListProps> = ({
return (
<VariableSizeList
- {...{ key, height, width, itemData, itemCount, itemSize, itemKey }}
+ key={key}
+ {...{ height, width, itemData, itemCount, itemSize, itemKey }}
>
{ListItem}
</VariableSizeList>
@@ -497,6 +498,11 @@ const ListItem: React.FC<ListChildComponentProps<DuplicatesListItemData>> =
memo(({ index, style, data }) => {
const { layoutParams, duplicateGroups, onToggleSelection } = data;
+ // For smaller screens, hide to divider to reduce visual noise. For
+ // larger screens, the divider is helpful in guiding the user's eyes to
+ // the checkbox which is otherwise at the right end of the header.
+ const showDivider = layoutParams.containerWidth > 700;
+
const duplicateGroup = duplicateGroups[index]!;
const items = duplicateGroup.items;
const count = items.length;
@@ -528,7 +534,7 @@ const ListItem: React.FC<ListChildComponentProps<DuplicatesListItemData>> =
<Divider
variant="middle"
sx={{
- opacity: 0.8,
+ opacity: showDivider ? 0.8 : 0,
marginBlock: "4px 20px",
}}
/>