Repository navigation
Photo-only delivery and a gallery page for photo share links - #128
Conversation
|
Thank you for taking the time to create the PR for this feature. I will look into it as soon as possible and try to merge it asap if/when possible. I'll keep you posted. Thanks again for contributing |
Contributor feature from #128, plus: the share-page guard centralised into verifyProjectAccess, selection state in useAlbumGallery, one queue-drop helper, and the gallery view derived from what the link carries rather than from the switch.
|
Hi @donutinit thanks a lot for this, its merged and ships in 1.4.0. i did change a fair bit after merging to fit how vitransfer is put together, so i wanted to explain what and why. the main one is the access check. you had the photo-only guard written out in each video route, which worked, but it meant every new video route has to remember to add it. i moved it into verifyProjectAccess as a requireVideoAccess option so its denied by default instead. the handful of routes that dont go through that helper kept their own check. then the album view. you had the gallery for photo-only links and the existing full page album view for projects that also have videos, so the same photos looked different depending on whether the project happened to have a video in it. i made the gallery the album view everywhere, so clicking an album from the overview opens the same thing now with a back to overview button, and the old album view is gone. i also changed what decides the view. it follows what the link actually carries rather than the switch, and it counts videos of any status, so a project with a video still transcoding doesnt flip from the overview to the gallery when encoding finishes. the rest was styling, getting it onto our own tokens and components. the bar uses the same treatment as the video players bar, the buttons and hover states match the rest of the share page, and the accent colour from settings now comes through on the cover button, the open album and the photo selection. the useAlbumGallery extraction was the best part of this and i didnt touch it, same for the two scroll fixes you found in there. thanks again, really appreciate the effort. Let me know if anything looks off to you. |
Closes #123
This is the PR for #123. I sometimes deliver photo sessions with ViTransfer and the share page always looked like a video review page, even with zero videos, and the client still had to click into the only album lol. So photo share links now open as a proper delivery gallery, something close to a Pixieset gallery, and there's a per-project switch that keeps the videos off the share link completely.
Summary
Project.photoOnlyShare, default off) in the Client Share Page settingsWhat changed
Photo-only switch (server)
With the switch on, for anyone who isn't an admin:
GET /api/share/[token]returnsvideos: [],videosByName: {}andphotoOnlyShare: truevideo-token,download-all-token, comments (read and write),approve, the/api/videos/[id]/*download, asset and client-asset routes, and TUS/S3 comment attachment uploads refuse the request/api/content/[token]and/api/content/zip/[token]check the project too, so links minted before the switch was turned on stop workingAdmins keep full access. Photos, photo downloads and reverse share uploads keep working.
Emails for photo-only projects:
Gallery page
PhotoDeliveryGalleryis what the share link shows when it has photos and no videos (or the switch is on):?album=<id>, so a copied link opens the same albumShared bits
SharePhotoSectioninto auseAlbumGalleryhook. The old album view works the same and gets two fixes out of it: switching albums while a page was loading could leave the new album empty, and infinite scroll never prefetched because the observer watched the viewport while the grid scrolls inside its own containerPhotoLightboxis now a proper dialog (focus moves in and back out, Tab stays inside), swipes between photos on touch without triggering the browser's swipe back, and with paged albums the counter shows the album total and keeps going past the loaded page instead of wrapping to 1. It also has agalleryvariant with a plain background for the new pageThemeToggleandLanguageTogglegot aghostvariant; the default look is unchangedThings you might want to know
devbecause that's where recent PRs land, even though CONTRIBUTING mentionsmainValidation
npx tsc --noEmit,npm run lint(no new warnings) andnpm run buildnext startand the worker (Postgres 18, Valkey, local storage) using a real photo session, plus generated albums with up to 230 photos and a project with 13 albums