WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.3k stars 4.11k forks source link

Consider a different caption style for image galleries #8030

Open kjellr opened 6 years ago

kjellr commented 6 years ago

The Problem

The current implementation of gallery captions is problematic in some circumstances. For instance, when images get small, caption text is cut off and appears broken:

artboard copy 3

In this case, overflow text is scrollable, but for many users that's not clear from the appearance (#7963). It's also unwieldy to edit captions in such a small space — text and controls are hidden and appear clipped off (#6858):

screen shot 2018-07-18 at 12 16 05 pm

Additionally, even when gallery images are larger, long captions can overlap a significant portion of the image, blocking it from view:

screen shot 2018-07-18 at 12 02 32 pm


Proposed Solution

All of those issues could be avoided by adopting the caption style used for individual image captions: gray text, placed below the image. In addition to solving those issues, this may be a preferred style for some users in general.

Alternatively, we could address those issues with the current implementation and consider adding this new caption style as a second option for users — some users will not want text overlapping their images in any case.


Screenshots

Current: artboard copy 3

Proposed: artboard copy 4


Current: artboard

Proposed: artboard 2


Current: artboard copy

Proposed: artboard copy 2

sarahmonster commented 6 years ago

Adjusting the captions to be consistent with other captions used across the site makes sense to me. The overlaid captions are more aesthetically pleasing/modern feeling, and a bit more clearly associated with the image they caption, but problematic in cases on long captions and/or short screens, which is hard to account for in a consistent way. It's probably best to keep things super simple here, and then allow for further customisation via themes if people are looking for fancier captions.

The centre alignment of text can look a bit awkward particularly with longer captions, but this was an issue before as well (and also with the standalone image captions.)

mtias commented 6 years ago

@kjellr how would it look when you have just one image or two with a caption? Also, how does it handle CSS-crop?

kjellr commented 6 years ago

how would it look when you have just one image or two with a caption? Also, how does it handle CSS-crop?

It doesn't look too bad when only one or two images contain a caption: 

05-deselected


It does get messier when cropping is turned off, but I'm not sure that's necessarily because of the captions — this scenario looks a bit messy even without them.

08-deselected


Here's a quick prototype to get a feel for it:

https://wp.invisionapp.com/share/YZN2YRUF6J4#/309939863_01-Start

kjellr commented 6 years ago

Also, if we were to include this as an option instead of replacing the current implementation, here's a quick mockup of that new option in the sidebar:

toggle-button

If we go in this direction, we'd probably want to iterate on that copy though. 😄 Edit: Thanks @michelleweber for the copy suggestions.

The secondary text could toggle between “Captions are placed below images.” and “Captions are placed inside images.” depending on the current state.

karmatosed commented 6 years ago

I think the switch makes a lot of sense here. As a side note, switch wise we're going to explore not having secondary text just having calls in the primary. We'd be iterating here when that happens. What could work as text in that case?

michelleweber commented 6 years ago

If you only need a single line, I think "Display captions below images" is still clear. "Display captions below instead of overlaid on images" if you want more detail.

StaggerLeee commented 6 years ago

I like it as it is now. Also problem with switch option is User will think it is forced on front-end too. Needs different label.

kjellr commented 6 years ago

Also problem with switch option is User will think it is forced on front-end too. Needs different label.

The current caption styles are carried over to the front-end by default, so I imagine this would be too.

noisysocks commented 6 years ago

Quick update: I started working on this on Thursday and am probably about halfway there. I've been pulled away by some other tasks, but am hoping to get back on this and submit a PR tomorrow.

noisysocks commented 5 years ago

My understanding is that this isn't a priority for Phase 1. Not sure whether that means we slap the Future label on it or simply close. Thoughts? @mtias @karmatosed @kjellr

kjellr commented 5 years ago

I think it's okay to close for now. We can always reopen if we decide we want to pursue it later.

paaljoachim commented 5 years ago

I posted about the grey background behind the gallery caption some time ago here: https://github.com/WordPress/gutenberg/issues/7260

The main problem is that when something does not show up as the user has decided on then it is easy to think it is a bug. It was so for me. Having to figure out the CSS to remove the grey background behind the caption is extra work for the user. Another bump in the road so to speak. Having the option to move the caption below the image makes it cleaner as it does not cover the image, and it is also the same way seen for single images. Making it more consistent.

glendaviesnz commented 2 years ago

Going to reopen and add to Gallery improvements project as should be easier now it is using inner image blocks

paaljoachim commented 2 years ago

Last year @ellatrix made this PR for adding the caption as an inner block. Image block: try caption as inner block https://github.com/WordPress/gutenberg/pull/31823 I believe it will be very helpful in multitudes of ways moving captions into Inner blocks. As one benefit could be to have its own paragraph like toolbar options.

shelb-elliott commented 1 year ago

Hi all, Newspack team here - we've had Carolina Public Press request this same feature in Slack, so I wanted to offer that information for consideration. There's also a similar issue open here that's worth noting.

glendaviesnz commented 1 year ago

Something similar is being worked on here

t-hamano commented 8 months ago

Recently, #56587 was also submitted suggesting improving the caption text color and background color using theme colors.

james-tyner commented 5 months ago

Hi! Just wanted to drop a note here expressing my support for this change to the gallery caption editing experience.

In our newsroom at @sfstandard, we find that for longer captions (which are the norm at major news publishers), the existing UX can result in captions being very difficult to read and therefore very difficult to edit, especially if you need to select some of the existing text in the caption. It's a frequent complaint of our copy editing team.

I think our team would prefer for captions to be placed outside the images by default, though I know that may not be a universal preference. My understanding is that one of the core tenets of the Gutenberg project is for the backend editing experience to closely mirror the frontend reading experience. If that's a concern here, I'd suggest that the gallery block have a writing & editing focused appearance when it's being actively edited, and then once it's no longer being edited it can transform into an appearance that more closely reflects the frontend.

jasmussen commented 5 months ago

@james-tyner thanks for chiming in. Would you have a chance to look at this related issue that overlaps a bit? I'd love your thoughts there, on the style bits as well.

CC: @glendaviesnz and @noisysocks since you touched on this in the past, would this and #56587 potentially be easy fixes? Anything I can help with perhaps?

paaljoachim commented 1 month ago

I am right now working on a Norwegian artist web site. I just now added 6 images into a gallery. The original site has captions that look like this: https://www.grofolkan.no/2020-2/ Screenshot 2024-07-11 at 00 43 00

With a Gallery block in Gutenberg it looks like this:

Screenshot 2024-07-11 at 00 44 36

Test site. https://designkurs.com/gallerier/2020-2/

Captions in Galleries really could use some work. I believe I will have to add individual image blocks to the artist site instead of using galleries and that is just too bad, as it would be nice to use the Gallery block.

--

Btw I changed the galleries on my test site to instead of a Gallery block contain a Group block and two columns containing image blocks with captions. But with an artist web site it would save me a lot of time using the Gallery block to modify the caption and block spacing/padding between the images in the gallery. Anyhow I will see how it goes.

glendaviesnz commented 1 month ago

@paaljoachim in the gallery the captions are just positioned that way with css, so if you add some custom css you can make them behave like the stand-alone image ones, eg. something like this should work:

.wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
    background: 0 0;
    color: #cccccc;
    position: initial;
    text-align: left;
}