-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image lightbox: Remove duplicate image when lightbox is opened #63381
Merged
+38
−1
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d487019
Hide content image when lightbox is opened
artemiomorales af27f53
Handle duplicate image when closing lightbox as well
artemiomorales e3976e8
Remove styling for prefers reduced motion
artemiomorales 72b3688
Rename state getters
artemiomorales 40c28b9
Hide captions in galleries when opening lightbox
artemiomorales 59a63c3
Revert "Hide captions in galleries when opening lightbox"
artemiomorales File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure if we should put the styles to hide/show the caption here or in the gallery styles. My inclination is to put them here because we need to animate the caption with the same timing as the image. What do you think?
Note that we need to restrict these caption styles to the gallery to prevent hiding captions in other circumstances when they don't overlay the image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the desired behavior with captions here? Should they be handled different for gallery vs normal images?
Right now this is how galleries are working in this pull request:
Lightbox.lightbox.-.18.July.2024.mp4
And this is how normal images work:
Lightbox.caption.1.mp4
This is how they would work if we hide the caption as in the galleries:
Lightbox.gallery.mp4
So, what is the expected UX? Should we even add a "fade-in" effect for the caption as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a separate issue to handle the captions correctly. I'm also wondering what the rationale was for omitting the caption in the expanded image. There are reports that the caption should be included for legal reasons on some websites #60469 (comment). So that at least should be an option to configure for the lightbox.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok got it, so we need to account for the caption in galleries in two scenarios:
I only took into account the first issue, not the second.
In the first scenario, like in the latest fix, I think we could make the caption disappear immediately when the lightbox opens, then make it reappear at the proper time when the lightbox is closed. We could also introduce a fade and sequence it properly with the zooming animation to make it more elegant.
For the second scenario, the caption should fade out and fade in smoothly like the rest of the content outside of the image.
I believe there was conversation with design that the experience of a single image lightbox doesn't require a caption because one already has the context to understand what's being displayed. This is in contrast to a lightbox gallery, in which you don't have as much context.
Ok, I'll revert the most recent change, merge, and open a separate issue 👍