Skip to content

Conversation

@yomete
Copy link

@yomete yomete commented Oct 3, 2025

This pull request introduces a new, lightweight PhotoLight type for use in grid and homepage photo queries, optimizing data fetching and component rendering by reducing the amount of photo data loaded when full details are unnecessary.

The changes update both backend query logic and frontend components to use this lighter type where appropriate, and provide new cached query functions for improved performance.

Key changes include:

  • Added the PhotoLight interface in src/photo/index.ts, representing a subset of photo fields for lightweight queries, and implemented the parsePhotoLightFromDb utility for parsing DB rows into this type. (F267da1fL49R49, F267da1fL133)
  • Refactored various functions and components (PhotoGrid, PhotoGridPageClient, PhotoLink, PhotoMedium, and related utility functions) to use PhotoLight instead of the full Photo type where only basic photo information is required.
  • Introduced the getPhotosLight function in src/photo/query.ts to efficiently query only the necessary columns for PhotoLight, and defined PHOTO_LIGHT_COLUMNS for this purpose.
  • Updated homepage (app/page.tsx) and grid page (app/grid/page.tsx) logic to use the new getPhotosCachedLight for grid views, and to select between light and full photo queries based on the GRID_HOMEPAGE_ENABLED flag.
  • Updated function signatures throughout the codebase to accept both Photo and PhotoLight types where needed, and ensured compatibility in utility functions such as sorting and description generation.
  • Updated the film field in PhotoExif to use the FujifilmSimulation type for improved type safety.

yomete added 4 commits August 31, 2025 18:36
Introduces a new PhotoLight interface for lightweight photo data, updates components and queries to use PhotoLight where full photo details are unnecessary, and adds getPhotosLight and getPhotosCachedLight for more efficient data fetching in grid views.

This refactor improves performance by reducing the amount of data loaded for photo grids and updates type usage across relevant files.
Introduces the PhotoLight interface and updates relevant functions and components to use PhotoLight instead of Photo where appropriate. Adds the takenAtNaive field to PhotoLight and updates database queries to include it. Refactors type usage in photo and tag modules for improved type safety and clarity.
@vercel
Copy link

vercel bot commented Oct 3, 2025

@yomete is attempting to deploy a commit to the Sam Becker's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant