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
Owner

What

Following a shared place photo link (/e/:event_id) now opens the photo gallery modal on the linked photo, instead of only scrolling the inline carousel in the details sidebar.

How

The linked photo is matched by event id, and the gallery opens exactly once, as soon as the photo is present in the visible list. Photos load asynchronously (cache first, then relays) and can arrive after the gallery opens, so opening is deferred until the linked photo is available.

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.

Focus is stable: photos that arrive while the gallery is open never move it, and a manual open or close consumes the pending link so a late-arriving photo can neither reopen nor hijack the gallery. Photo focus is tracked by event id, so it survives parsePlacePhotos rebuilding the photo objects on every update.

Tests

pnpm test passes (556 tests) and pnpm lint is clean.

New coverage: the gallery opens on the linked photo; it waits for a late arrival; it reveals the author and then opens; focus stays put when other photos are added; it does not reopen after a manual close; it does not hijack a gallery the user opened on another photo; it does not auto-open without a deep link; the service reveal semantics and place-scoping; and a real-unmount deletion test that guards the Blossom cleanup against an early teardown.

## What Following a shared place photo link (`/e/:event_id`) now opens the photo gallery modal on the linked photo, instead of only scrolling the inline carousel in the details sidebar. ## How The linked photo is matched by event id, and the gallery opens exactly once, as soon as the photo is present in the visible list. Photos load asynchronously (cache first, then relays) and can arrive after the gallery opens, so opening is deferred until the linked photo is available. 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. Focus is stable: photos that arrive while the gallery is open never move it, and a manual open or close consumes the pending link so a late-arriving photo can neither reopen nor hijack the gallery. Photo focus is tracked by event id, so it survives `parsePlacePhotos` rebuilding the photo objects on every update. ## Tests `pnpm test` passes (556 tests) and `pnpm lint` is clean. New coverage: the gallery opens on the linked photo; it waits for a late arrival; it reveals the author and then opens; focus stays put when other photos are added; it does not reopen after a manual close; it does not hijack a gallery the user opened on another photo; it does not auto-open without a deep link; the service reveal semantics and place-scoping; and a real-unmount deletion test that guards the Blossom cleanup against an early teardown.
raucao added 1 commit 2026-11-30 08:13:07 +00:00
Open the gallery on a shared place photo link
CI / Lint (pull_request) Successful in 59s
CI / Test (pull_request) Successful in 1m33s
a2bda44a65
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.
raucao added 1 commit 2026-11-30 09:02:09 +00:00
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
bb05e7fa43
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.
raucao added the enhancementui/ux labels 2026-11-30 09:04:59 +00:00
raucao merged commit 322262ea53 into master 2026-11-30 09:05:39 +00:00
raucao deleted branch feature/photo_links 2026-11-30 09:05:39 +00:00
Sign in to join this conversation.