Skip to content

armgit / ente

Public Imported from GitHub
0

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

Keep small profile grids compact and clarify replies

Anand Baburajan61b4e4cbc274
diff --git a/web/apps/space/src/components/AboutSpaceContent.tsx b/web/apps/space/src/components/AboutSpaceContent.tsx
index 9c0c10ec80..331247570d 100644
--- a/web/apps/space/src/components/AboutSpaceContent.tsx
+++ b/web/apps/space/src/components/AboutSpaceContent.tsx
@@ -75,7 +75,7 @@ export const SpaceAboutContent: React.FC<{ children: React.ReactNode }> = ({
</div>
</Feature>
- <Feature title="Like and reply to their posts." cropVisual>
+ <Feature title="Like and reply to their posts privately." cropVisual>
<div className="screenPreview chatPreview">
<img
className="screenCapture"
diff --git a/web/apps/space/src/utils/profile-photo-layout.ts b/web/apps/space/src/utils/profile-photo-layout.ts
index 32ad2b8f3b..5011be6a46 100644
--- a/web/apps/space/src/utils/profile-photo-layout.ts
+++ b/web/apps/space/src/utils/profile-photo-layout.ts
@@ -17,8 +17,7 @@ export const profilePhotoRows = <Tile extends { aspectRatio: number }>(
let aspectRatio = 0;
for (
let rowSize = 1;
- rowSize <= (tiles.length < 5 ? 1 : 3) &&
- index + rowSize <= tiles.length;
+ rowSize <= 3 && index + rowSize <= tiles.length;
rowSize++
) {
aspectRatio += tiles[index + rowSize - 1]!.aspectRatio;
diff --git a/web/apps/space/tests/profile-photo-layout.test.ts b/web/apps/space/tests/profile-photo-layout.test.ts
index 00475994f1..63cfd2686b 100644
--- a/web/apps/space/tests/profile-photo-layout.test.ts
+++ b/web/apps/space/tests/profile-photo-layout.test.ts
@@ -8,18 +8,17 @@ import {
const photos = (ratios: number[]) =>
ratios.map((aspectRatio, id) => ({ id, aspectRatio }));
-test.each([1, 2, 3, 4])(
- "a profile with %i photos shows each at full width and its original height",
- (count) => {
- const tiles = photos([4 / 3, 3 / 2, 1, 9 / 16].slice(0, count));
+test.each([
+ { count: 2, rowSizes: [2] },
+ { count: 3, rowSizes: [3] },
+ { count: 4, rowSizes: [2, 2] },
+])(
+ "a profile with $count photos uses the adaptive grid",
+ ({ count, rowSizes }) => {
+ const tiles = photos(new Array<number>(count).fill(2 / 3));
const rows = profilePhotoRows(tiles, 352);
- expect(rows).toEqual(
- tiles.map((tile) => ({
- aspectRatio: tile.aspectRatio,
- height: 352 / tile.aspectRatio,
- tiles: [tile],
- })),
- );
+ expect(rows.map(({ tiles }) => tiles.length)).toEqual(rowSizes);
+ expect(rows.flatMap(({ tiles }) => tiles)).toEqual(tiles);
},
);