diff --git a/apps/web/components/memories-grid.tsx b/apps/web/components/memories-grid.tsx index 29d8b0e83..6d2f1038d 100644 --- a/apps/web/components/memories-grid.tsx +++ b/apps/web/components/memories-grid.tsx @@ -641,27 +641,29 @@ export function MemoriesGrid({ id="selection-toolbar" className={cn( dmSansClassName(), - "flex items-center justify-between gap-3 mb-3 mr-2 px-3 py-2 rounded-full border border-[#2261CA33] bg-[#00173C]/40", + "flex items-center justify-between gap-1.5 mb-3 mr-2 px-2.5 py-2 rounded-full border border-[#2261CA33] bg-[#00173C]/40 sm:gap-3 sm:px-3", )} > -
+
{selectedDocumentIds.size} - {selectedDocumentIds.size === 1 ? "selected" : "selected"} + + {selectedDocumentIds.size === 1 ? "selected" : "selected"} + {selectedDocumentIds.size === 0 && ( - + Tap documents to select )}
-
+
- {isExpanded && ( -
- {group.docs.map((doc) => ( - { - if (doc.id) onToggleSelection?.(doc.id) - }} - indent - /> - ))} -
- )} + + {isExpanded && ( + + {group.docs.map((doc, index) => ( + + { + if (doc.id) onToggleSelection?.(doc.id) + }} + indent + isLast={index === group.docs.length - 1} + /> + + ))} + + )} +
) } @@ -506,57 +542,121 @@ export function TimelineView({ return (
- {periodGroups.map((period) => ( -
-
- - {period.label} - -
- -
- {period.typeGroups.map((group) => { - const expandKey = `${period.label}::${group.categoryInfo.key}` - - if (group.docs.length === 1) { - const doc = group.docs[0] - if (!doc) return null + {periodGroups.map((period, periodIndex) => { + const periodHasExpandedGroup = period.typeGroups.some((group) => + expandedGroups.has(`${period.label}::${group.categoryInfo.key}`), + ) + + return ( +
+
+ + {period.label} + +
+ +
+
+ + + + {periodHasExpandedGroup && ( + + )} + + + +
+ +
+ {period.typeGroups.map((group) => { + const expandKey = `${period.label}::${group.categoryInfo.key}` + + if (group.docs.length === 1) { + const doc = group.docs[0] + if (!doc) return null + + return ( + + ) + } return ( - toggleGroup(expandKey)} onOpenDocument={onOpenDocument} isSelectionMode={isSelectionMode} - isSelected={ - doc.id ? selectedDocumentIds.has(doc.id) : false - } - onToggleSelection={handleTimelineCardSelection} + selectedDocumentIds={selectedDocumentIds} + onToggleSelection={onToggleSelection} /> ) - } - - return ( - toggleGroup(expandKey)} - onOpenDocument={onOpenDocument} - isSelectionMode={isSelectionMode} - selectedDocumentIds={selectedDocumentIds} - onToggleSelection={onToggleSelection} - /> - ) - })} + })} +
-
- ))} + ) + })}