Rename 'outdated' to 'sync,' change path

This commit is contained in:
Sam Becker 2025-04-19 11:23:32 -05:00
parent d36ae5c15a
commit 00932b6687
6 changed files with 21 additions and 22 deletions

View File

@ -267,7 +267,7 @@ Vercel Postgres can be switched to another Postgres-compatible, pooling provider
> There have been reports ([Issue 184](https://github.com/sambecker/exif-photo-blog/issues/184#issuecomment-2629474045) + [185](https://github.com/sambecker/exif-photo-blog/issues/185#issuecomment-2629478570)) that having large photos (over 30MB), or a CDN, e.g., Cloudflare in front of Vercel, may destabilize static optimization. > There have been reports ([Issue 184](https://github.com/sambecker/exif-photo-blog/issues/184#issuecomment-2629474045) + [185](https://github.com/sambecker/exif-photo-blog/issues/185#issuecomment-2629478570)) that having large photos (over 30MB), or a CDN, e.g., Cloudflare in front of Vercel, may destabilize static optimization.
#### Why don't my older photos look right? #### Why don't my older photos look right?
> As the template has evolved, EXIF fields (such as lenses) have been added, blur data is generated through a different method, and AI/privacy features have been added. In order to bring older photos up to date, either click the 'sync' button next to a photo or use the outdated photo page (`/admin/outdated`) to make batch updates. > As the template has evolved, EXIF fields (such as lenses) have been added, blur data is generated through a different method, and AI/privacy features have been added. In order to bring older photos up to date, either click the 'sync' button next to a photo or use the photo sync page (`/admin/photos/sync`) to make batch updates.
#### Why don't my OG images load when I share a link? #### Why don't my OG images load when I share a link?
> Many services such as iMessage, Slack, and X, require near-instant responses when unfurling link-based content. In order to guarantee sufficient responsiveness, consider rendering pages and image assets ahead of time by enabling static optimization by setting `NEXT_PUBLIC_STATICALLY_OPTIMIZE_PHOTOS = 1` and `NEXT_PUBLIC_STATICALLY_OPTIMIZE_PHOTO_OG_IMAGES = 1`. Keep in mind that this will increase platform usage. > Many services such as iMessage, Slack, and X, require near-instant responses when unfurling link-based content. In order to guarantee sufficient responsiveness, consider rendering pages and image assets ahead of time by enabling static optimization by setting `NEXT_PUBLIC_STATICALLY_OPTIMIZE_PHOTOS = 1` and `NEXT_PUBLIC_STATICALLY_OPTIMIZE_PHOTO_OG_IMAGES = 1`. Keep in mind that this will increase platform usage.

View File

@ -1,15 +1,15 @@
import AdminOutdatedClient from '@/admin/AdminOutdatedClient'; import AdminPhotosSyncClient from '@/admin/AdminPhotosSyncClient';
import { AI_TEXT_GENERATION_ENABLED } from '@/app/config'; import { AI_TEXT_GENERATION_ENABLED } from '@/app/config';
import { getOutdatedPhotos } from '@/photo/db/query'; import { getOutdatedPhotos } from '@/photo/db/query';
export const maxDuration = 60; export const maxDuration = 60;
export default async function AdminOutdatedPage() { export default async function AdminSyncPage() {
const photos = await getOutdatedPhotos() const photos = await getOutdatedPhotos()
.catch(() => []); .catch(() => []);
return ( return (
<AdminOutdatedClient {...{ <AdminPhotosSyncClient {...{
photos, photos,
hasAiTextGeneration: AI_TEXT_GENERATION_ENABLED, hasAiTextGeneration: AI_TEXT_GENERATION_ENABLED,
}} /> }} />

View File

@ -5,7 +5,7 @@ import AppGrid from '@/components/AppGrid';
import AdminPhotosTable from '@/admin/AdminPhotosTable'; import AdminPhotosTable from '@/admin/AdminPhotosTable';
import AdminPhotosTableInfinite from '@/admin/AdminPhotosTableInfinite'; import AdminPhotosTableInfinite from '@/admin/AdminPhotosTableInfinite';
import PathLoaderButton from '@/components/primitives/PathLoaderButton'; import PathLoaderButton from '@/components/primitives/PathLoaderButton';
import { PATH_ADMIN_OUTDATED } from '@/app/paths'; import { PATH_ADMIN_PHOTOS_SYNC } from '@/app/paths';
import { Photo } from '@/photo'; import { Photo } from '@/photo';
import { StorageListResponse } from '@/platforms/storage'; import { StorageListResponse } from '@/platforms/storage';
import { LiaBroomSolid } from 'react-icons/lia'; import { LiaBroomSolid } from 'react-icons/lia';
@ -53,11 +53,13 @@ export default function AdminPhotosClient({
</div> </div>
{photosCountOutdated > 0 && {photosCountOutdated > 0 &&
<PathLoaderButton <PathLoaderButton
path={PATH_ADMIN_OUTDATED} path={PATH_ADMIN_PHOTOS_SYNC}
icon={<LiaBroomSolid icon={<LiaBroomSolid
size={18} size={18}
className="translate-y-[-1px]" className="translate-y-[-1px]"
/>} />}
// TODO: Add tooltip
// TODO: Use LinkWithStatus
title={`${photosCountOutdated} Outdated Photos`} title={`${photosCountOutdated} Outdated Photos`}
className={clsx( className={clsx(
'text-blue-600 dark:text-blue-400', 'text-blue-600 dark:text-blue-400',

View File

@ -15,7 +15,7 @@ import { LiaBroomSolid } from 'react-icons/lia';
const UPDATE_BATCH_SIZE_MAX = 4; const UPDATE_BATCH_SIZE_MAX = 4;
export default function AdminOutdatedClient({ export default function AdminPhotosSyncClient({
photos, photos,
hasAiTextGeneration, hasAiTextGeneration,
}: { }: {
@ -34,14 +34,9 @@ export default function AdminOutdatedClient({
<AdminChildPage <AdminChildPage
backLabel="Photos" backLabel="Photos"
backPath={PATH_ADMIN_PHOTOS} backPath={PATH_ADMIN_PHOTOS}
breadcrumb={<> breadcrumb={<ResponsiveText shortText="Need Sync">
<span className="hidden sm:inline-block"> Need Sync ({photos.length})
Outdated ({photos.length}) </ResponsiveText>}
</span>
<span className="sm:hidden">
Outdated
</span>
</>}
accessory={<LoaderButton accessory={<LoaderButton
primary primary
icon={<IconGrSync className="translate-y-[1px]" />} icon={<IconGrSync className="translate-y-[1px]" />}
@ -84,9 +79,11 @@ export default function AdminOutdatedClient({
> >
<div className="space-y-1.5"> <div className="space-y-1.5">
<div className="font-bold"> <div className="font-bold">
{photos.length} outdated {photos.length}
{' '} {' '}
{photos.length === 1 ? 'photo' : 'photos'} found {photos.length === 1 ? 'photo' : 'photos'}
{' '}
could benefit from being synced
</div> </div>
Sync photos to import newer EXIF fields, improve blur data, Sync photos to import newer EXIF fields, improve blur data,
{' '} {' '}

View File

@ -28,7 +28,7 @@ import {
import EnvVar from '@/components/EnvVar'; import EnvVar from '@/components/EnvVar';
import { IoSyncCircle } from 'react-icons/io5'; import { IoSyncCircle } from 'react-icons/io5';
import clsx from 'clsx/lite'; import clsx from 'clsx/lite';
import { PATH_ADMIN_OUTDATED } from '@/app/paths'; import { PATH_ADMIN_PHOTOS_SYNC } from '@/app/paths';
import { LiaBroomSolid } from 'react-icons/lia'; import { LiaBroomSolid } from 'react-icons/lia';
import { IoMdGrid } from 'react-icons/io'; import { IoMdGrid } from 'react-icons/io';
import { RiSpeedMiniLine } from 'react-icons/ri'; import { RiSpeedMiniLine } from 'react-icons/ri';
@ -428,11 +428,11 @@ export default function AdminAppInsightsClient({
content={renderHighlightText( content={renderHighlightText(
pluralize( pluralize(
photosCountOutdated || DEBUG_PHOTOS_COUNT_OUTDATED, photosCountOutdated || DEBUG_PHOTOS_COUNT_OUTDATED,
'outdated photo', 'photo',
), ) + ' need to be synced',
'blue', 'blue',
)} )}
expandPath={PATH_ADMIN_OUTDATED} expandPath={PATH_ADMIN_PHOTOS_SYNC}
/>} />}
<ScoreCardRow <ScoreCardRow
icon={<IconPhoto icon={<IconPhoto

View File

@ -39,7 +39,7 @@ const PATH_RECIPE_DYNAMIC = `${PREFIX_RECIPE}/[recipe]`;
// Admin paths // Admin paths
export const PATH_ADMIN_PHOTOS = `${PATH_ADMIN}/photos`; export const PATH_ADMIN_PHOTOS = `${PATH_ADMIN}/photos`;
export const PATH_ADMIN_OUTDATED = `${PATH_ADMIN}/outdated`; export const PATH_ADMIN_PHOTOS_SYNC = `${PATH_ADMIN_PHOTOS}/sync`;
export const PATH_ADMIN_UPLOADS = `${PATH_ADMIN}/uploads`; export const PATH_ADMIN_UPLOADS = `${PATH_ADMIN}/uploads`;
export const PATH_ADMIN_TAGS = `${PATH_ADMIN}/tags`; export const PATH_ADMIN_TAGS = `${PATH_ADMIN}/tags`;
export const PATH_ADMIN_RECIPES = `${PATH_ADMIN}/recipes`; export const PATH_ADMIN_RECIPES = `${PATH_ADMIN}/recipes`;