fix(detail): mount the zoom viewer when opened via the fullscreen (⛶) button#529
Closed
Zheaoli wants to merge 1 commit into
Closed
fix(detail): mount the zoom viewer when opened via the fullscreen (⛶) button#529Zheaoli wants to merge 1 commit into
Zheaoli wants to merge 1 commit into
Conversation
The "View fullscreen" (⛶) button only set `lightboxPhoto = true`; it did not add
the photo to the zoomed-viewer LRU like the image-click path does. With the
LRU mount-gate (`keepViewerMounted={zoomLru.includes(photo.id)}`), a photo opened
via ⛶ was never in the LRU, so `keepViewerMounted` was false and the WebGL viewer
`<div>` never mounted — the fullscreen area came up blank ("can't load zoom"),
on every device (not a WebGL/GPU issue: the viewer simply wasn't rendered).
Two complementary fixes:
- The ⛶ button now also calls `bumpZoomLru(current?.id)`, mirroring the
image-click path (`bumpZoomLru` ignores a falsy id defensively).
- The mount-gate also keeps the currently-open photo mounted regardless of path:
`keepViewerMounted={zoomLru.includes(photo.id) || (isCurrent && lightboxPhoto)}`,
so any route that sets `lightboxPhoto` mounts the viewer. This doesn't relax the
LRU's ≤3 cap — the current photo should always be mounted; the rest stay
LRU-bound.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
Clicking the fullscreen (⛶) button on a photo opened a blank zoom area — "can't load zoom." Happens on every device; it is not a WebGL/GPU issue — the viewer simply was never mounted.
Root cause
The ⛶ button's
onClickonly setlightboxPhoto = true. It did not add the photo to the zoomed-viewer LRU, unlike the image-click path:With the LRU mount-gate added earlier (
keepViewerMounted={zoomLru.includes(photo.id)}→progressive-imagegates the viewer onhasOpenedFullScreen && keepViewerMounted !== false), a photo opened via ⛶ was never in the LRU, sokeepViewerMountedwasfalse→false !== false→ the WebGL viewer<div>never rendered → blank. The two zoom-open paths were asymmetric; the mount-gate was added without updating the ⛶ path.Fix (both, complementary)
bumpZoomLru(current?.id), mirroring the image-click path.bumpZoomLrunow ignores a falsy id defensively.keepViewerMounted={zoomLru.includes(photo.id) || (isCurrent && lightboxPhoto)}.This root-fixes the whole class (any route that sets
lightboxPhoto) and does not relax the LRU's ≤3 cap — the current photo should always be mounted; the rest stay LRU-bound.tsc+eslintclean. The viewer-lifecycle / GL-context LRU behavior is otherwise unchanged. (Verification needs a real GPU browser — the fullscreen WebGL viewer can't be exercised headless; the fix is that the viewer<div>now mounts on the ⛶ path, which is environment-independent.)