Follow-up to #2334387: UI changes to support current responsive image standards

Problem/Motivation

We need some kind of states API / ajax update for the breakpoint group form, because it is currently very confusing that you need to save the form, refresh the page, and only then see the relevant breakpoint groups in the details elements. It also can cause minor data loss if you fill out breakpoint group A, switch to breakpoint group B to check it out, and then flip back to breakpoint group A, because you need to save each time, which clears your previous settings.

Proposed resolution

Build it

Remaining tasks

User interface changes

Described above.

API changes

There are no API changes: those have already been taken care of in other issues. This would just improve the ability to make use of those API changes through a UI.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Task because this a follow-up to a recent critical change.
Issue priority Major because the sizes attribute will be very difficult to configurate without this UI change.
Prioritized changes The main goal of this issue is improve usability for the new sizes attribute. Making this easier to use will give Drupal 8 full ability to make use of the responsive images specification, which ultimately means better front-end performance for Drupal 8 sites. This is also a follow-up change to a recent critical, #2260061: Responsive image module does not support sizes/picture polyfill 2.2.
Disruption This will not be disruptive for core, contrib modules or themes. This only adds easier configuration and does not change the underlying APIs.
CommentFileSizeAuthor
#3 i2547917-3.patch1.33 KBJelle_S
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

attiks created an issue. See original summary.

attiks’s picture

Title: UI changes to support current responsive image standards » Add states API / ajax update for the breakpoint group form
Jelle_S’s picture

Status: Needs work » Needs review
FileSize
1.33 KB

First patch. Should work as expected.

Status: Needs review » Needs work

The last submitted patch, 3: i2547917-3.patch, failed testing.

attiks’s picture

Status: Needs work » Reviewed & tested by the community

Good to go, tested manually

RainbowArray’s picture

This is a great improvement.

It's very nice to see the breakpoint group choices update immediately. If you change something in breakpoint group A without saving, then switch to breakpoint group Ba, and then come back to breakpoint group A, the changes you made in group A will go away. To me that doesn't feel unexpected, though, because I hadn't saved yet. If there was a way to preserve those changes (the sizes value for a breakpoint, or the image styles selected, for example), that would be even better. But I'd guess that's a bridge too far.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

This is great!!

Agreed that other places we employ this pattern we don't preserve form values between switching, so I think this is ok.

Committed and pushed to 8.0.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.