Open the gallery on a shared place photo link #139

Merged
raucao merged 2 commits from feature/photo_links into master 2026-11-30 09:05:39 +00:00
2 Commits
Author SHA1 Message Date
raucao bb05e7fa43 Re-align the photo carousel when the list changes under it
CI / Lint (pull_request) Successful in 1m15s
CI / Test (pull_request) Successful in 1m46s
Release Drafter / Update release notes draft (pull_request) Successful in 18s
On a cold cache the gallery opened on the linked photo, but the large main
view showed the place's first photo. The gallery opens as soon as the linked
event is in the store, then the remaining photos stream in and
parsePlacePhotos promotes the first landscape to index 0, shifting the linked
photo's offset. scrollToNewPhoto only re-ran when the focused event changed,
so the track stayed at the old offset while the thumbnail highlight (driven by
the template, not the scroll position) looked correct.

Re-align to the focused slide when the photo set changes, keyed by the joined
event ids so it only fires on a genuine add/remove/reorder. The re-align is
deferred with requestAnimationFrame so the DOM has updated, and setupCarousel
re-observes the slides the same way so the intersection observer keeps
tracking them.
2026-11-30 13:02:08 +04:00
raucao a2bda44a65 Open the gallery on a shared place photo link
CI / Lint (pull_request) Successful in 59s
CI / Test (pull_request) Successful in 1m33s
The /e/:event_id route redirected to the place with a `photo` query param,
but that only scrolled the inline carousel. It now opens the gallery modal,
focused on the linked photo.

The photo list loads asynchronously (cache first, then relays) and more
photos can arrive while the gallery is open, so the auto-open waits for the
linked photo, opens exactly once, and keeps focus on the same event id.
A manual open or close consumes the pending link so a late-arriving photo
cannot reopen or hijack the gallery the user is looking at.

When the linked photo is hidden as untrusted, following the link reveals all
untrusted photos by that author for the current place. The reveal is
place-scoped and cleared when the place changes, so it never leaks into
other places, and other authors' hidden photos stay hidden.
2026-11-30 12:12:48 +04:00