Describe the feature
Description
Added a “Weekends” category in the Memories section to cluster all images that fall within a weekend.
Current Problem
The Memories section groups photos by location and date, but there is no way to browse photos specifically from weekends. Users who take most of their photos on weekends (trips, hangouts, events) have no dedicated view to relive those moments as a cohesive group. The existing filter buttons All, Location, and Date do not surface weekend-specific clusters.
Expected Feature
A new "Weekends" filter button in the Memories section that:
- Groups all photos by their ISO calendar week, producing one memory cluster per week that contains images.
- Displays each cluster as a "Happy Weekends" card showing the thumbnail of the first photo, the date range of that week's photos, and the total photo count.
- If a cluster spans a single day, shows only that date; otherwise shows start date – end date.
- Clicking a card opens a full detail view displaying all photos in that cluster, using the same
ImageCard grid and MediaView full-screen viewer used by the rest of the Memories section.
Implementation
Backend — generate_clusters_for_weekends() in memory_clustering.py
A standalone function generate_clusters_for_weekends() was added at the bottom of backend/app/utils/memory_clustering.py:
- Fetches all images from the database via
db_get_all_images().
- Sorts images by
metadata.date_created descending (most recent first).
- Iterates over every image, parses its ISO date, and extracts the ISO calendar year + week number using
datetime.isocalendar() , this forms a unique week_key (e.g. "2025-W48").
- Returns
list(weekend_memories.values()), each element is:
{
"mem_id": "<uuid>",
"images": [{"id": ..., "path": ..., "thumbnailPath": ...}, ...],
"start_date": "YYYY-MM-DD", # earliest photo date in the ISO week
"end_date": "YYYY-MM-DD", # latest photo date in the ISO week
}
- The
GET /api/memories/weekly-memories endpoint in routes/memories.py calls this function and returns a WeeklyMemoriesResponse containing weekly_memories.
Frontend
| Layer |
Change |
apiEndpoints.ts |
Added weeklyMemories: '/api/memories/weekly-memories' to memoriesEndpoints. |
api-functions/memories.ts |
Added WeeklyMemoryImage, WeeklyMemory, WeeklyMemoriesResponse interfaces and getWeeklyMemories() which performs a GET to the endpoint and returns the typed response. |
hooks/useMemories.tsx |
Added useWeeklyMemories() Tanstack Query hook (5-min stale time). |
MemoriesPage.tsx |
Added Weekends filter button. When active, hides all other sections and renders a WeekendMemoryCard grid. Each card uses thumbnailPath via convertFileSrc() for a fast thumbnail. Clicking a card renders WeekendMemoryDetail, which loads the cluster's images into Redux (setImages) and renders ImageCard + MediaView — the same pattern used by MemoryDetail — enabling full-screen image browsing. |
Note: ChatGPT was used to refine the statements above and to organize the structure of the issue.
Add ScreenShots
Screenshots
Before : No Weekends category.
After : With Weekends category
Record
Describe the feature
Description
Added a “Weekends” category in the Memories section to cluster all images that fall within a weekend.
Current Problem
The Memories section groups photos by location and date, but there is no way to browse photos specifically from weekends. Users who take most of their photos on weekends (trips, hangouts, events) have no dedicated view to relive those moments as a cohesive group. The existing filter buttons All, Location, and Date do not surface weekend-specific clusters.
Expected Feature
A new "Weekends" filter button in the Memories section that:
ImageCardgrid andMediaViewfull-screen viewer used by the rest of the Memories section.Implementation
Backend —
generate_clusters_for_weekends()inmemory_clustering.pyA standalone function
generate_clusters_for_weekends()was added at the bottom ofbackend/app/utils/memory_clustering.py:db_get_all_images().metadata.date_createddescending (most recent first).datetime.isocalendar(), this forms a uniqueweek_key(e.g."2025-W48").list(weekend_memories.values()), each element is:{ "mem_id": "<uuid>", "images": [{"id": ..., "path": ..., "thumbnailPath": ...}, ...], "start_date": "YYYY-MM-DD", # earliest photo date in the ISO week "end_date": "YYYY-MM-DD", # latest photo date in the ISO week }GET /api/memories/weekly-memoriesendpoint inroutes/memories.pycalls this function and returns aWeeklyMemoriesResponsecontainingweekly_memories.Frontend
apiEndpoints.tsweeklyMemories: '/api/memories/weekly-memories'tomemoriesEndpoints.api-functions/memories.tsWeeklyMemoryImage,WeeklyMemory,WeeklyMemoriesResponseinterfaces andgetWeeklyMemories()which performs aGETto the endpoint and returns the typed response.hooks/useMemories.tsxuseWeeklyMemories()Tanstack Query hook (5-min stale time).MemoriesPage.tsxWeekendMemoryCardgrid. Each card usesthumbnailPathviaconvertFileSrc()for a fast thumbnail. Clicking a card rendersWeekendMemoryDetail, which loads the cluster's images into Redux (setImages) and rendersImageCard+MediaView— the same pattern used byMemoryDetail— enabling full-screen image browsing.Note: ChatGPT was used to refine the statements above and to organize the structure of the issue.
Add ScreenShots
Screenshots
Before : No
Weekendscategory.After : With
WeekendscategoryRecord