From 9c0afa2054130bb8fd0a781721eef0e40a96bfb6 Mon Sep 17 00:00:00 2001 From: Mannu Date: Mon, 18 May 2026 22:45:23 +0530 Subject: [PATCH] feat(memories): 4-col grid, hover effects, folder label per tile, no blank tiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - grid-cols-4 (~40% smaller than 3-col) with gap-1 and rounded-xl corners - Hover: scale-110 image + dark overlay + expand icon (⤢) - Subtle shadow + ring border on each tile - Folder emoji + name shown below each tile (when assigned) - Filter out tiles with no URL and remove tiles that fail to load (onError → null) Co-Authored-By: Claude Sonnet 4.6 --- src/app/memories/page.tsx | 68 +++++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 20 deletions(-) diff --git a/src/app/memories/page.tsx b/src/app/memories/page.tsx index 33df0ba..f2ca134 100644 --- a/src/app/memories/page.tsx +++ b/src/app/memories/page.tsx @@ -190,9 +190,10 @@ export default function MemoriesPage() { }; const baseList = searchResults !== null ? searchResults : memories; - const displayMemories = activeFolder + const displayMemories = (activeFolder ? baseList.filter(m => m.description === activeFolder) - : baseList; + : baseList + ).filter(m => m.url || m.thumbnailUrl); const folderCounts = memories.reduce>((acc, m) => { if (m.description) acc[m.description] = (acc[m.description] || 0) + 1; @@ -269,9 +270,14 @@ export default function MemoriesPage() {

) : ( -
+
{displayMemories.map(mem => ( - setSelected(mem)} /> + f.id === mem.description) ?? null} + onClick={() => setSelected(mem)} + /> ))}
)} @@ -389,26 +395,48 @@ export default function MemoriesPage() { // ─── Grid tile ──────────────────────────────────────────────────────────────── -function MemoryTile({ memory, onClick }: { memory: Memory; onClick: () => void }) { - const [loaded, setLoaded] = useState(false); +function MemoryTile({ memory, folder, onClick }: { memory: Memory; folder: Folder | null; onClick: () => void }) { + const [loaded, setLoaded] = useState(false); + const [imgError, setImgError] = useState(false); const src = memory.thumbnailUrl || memory.url; + + if (imgError) return null; + return ( - + {/* Folder label */} + {folder && folder.id && ( +

+ {folder.emoji} {folder.label} +

)} - {memory.isPrivate &&
🔒
} - +
); }