Problem/Motivation

#3096078: Display core compatibility ranges for available module updates was committed before a usability review.

It adds a lot of (mostly duplicate) text to the available updates report:

Screenshot of available updates report showing core compatibility ranges (narrow)

We should try to improve the UX of this info because it's:

a) Important.
b) Likely to grow larger and more complex over time.

Proposed resolution

  • Have the available updates report determine if a release is compatible with your currently installed version of core or not.
  • Make "not compatible" an open details that replaces download link.
  • Add a closed details under download link for compatible releases.
  • Shorten the text from "This module is compatible with Drupal core:" to "Requires Drupal core:".

Manual Testing: How to

  1. Start with a clean 8.9.x clone
  2. Apply latest patch.
  3. Download token 8.x-1.5 (since 8.x-1.6 is out, and that defines the core compatibility in the new format that triggers all this).
  4. Download redis 8.x-1.2 (since 8.x-1.4 is out, and that defines core_version_requirement: ^8.8 || ^9).
  5. Modify core/lib/Drupal.php and set const VERSION = '8.7.10'; (see manual-testing patch in #86).
  6. Install Drupal and enable Redis and Token
  7. Visit /admin/reports/updates and check for updates, click around, enjoy.
  8. Visit /admin/reports/updates/update and see that #3113992: The 'Update' page has no idea that some updates are incompatible is a separate bug.

Remaining tasks

  1. Initial UX review.
  2. Brainstorm solutions.
  3. Implement them. Initial prototype in #26
  4. Decide if the compatibility details area should go above (#26) or below the "Release notes" link. See #31 for more. Decided: Below. Patch in #44.
  5. Decide the correct text to use for the details titles:
    • "Not compatible"
    • #28: "This update has compatibility issues"
    • #32: "This update is not compatible with your version of Drupal"
    • #48: "Not compatible..." (with ellipsis)

    Decided (#60): "Not compatible" (no ellipsis).

  6. Decide if we should also inform site admins about compatibility with recommended/available core update versions. See #2. Decided: not in this issue (#58). Follow up: #3114149: Update report should show whether suggested project versions are compatible with recommended core version
  7. Decide if we should show compatibility info at all if the update is compatible with your current version of core (see #43, #46, #47, etc). Decided: yes (#58)
  8. Decide if we want icons next to 'Not compatible' and perhaps download link or not (#6, #16, #48, #49, ...). Decided: not in this issue. We may do it in a follow-up issue. (#58)
  9. Decide if the not-compatible message should say the currently installed core version, and if so, above or below the ranges of compatible core releases. See #46.4, #48, #55 Decided: NO #88.
  10. Decide if the release notes should go above the download link in the compatible case (#56) Decided: Keep the current order (#58)
  11. Decide what the hover / focus styles for these <details> (especially <summary>) elements should look like:
  12. Improve implementation:
    • remove @todo's
    • Fix compatibility message to not hard-code 'module' into the text (either use 'release' or be aware of project type) (#54)
    • Expand details by default for "Not compatible" modules #65
    • Change details payload in both cases to start with a full sentence that explains what "Compatible" or "Not compatible" means. #65
    • Change the text inside the details to: "Requires Drupal core: 8.8.1 to 8.9.2" #66
    • Remove the colors on the details headings for accessibility and UX concerns #67 Restored red for Not compatible (patch #94, based on #91 and #93) Removed color to be decided in follow up #3114707: Add color to summary element to improve UX of core compatibility info on available updates report see @xjm Release manager decision in #109.
    • Restore the Download link in the "Not compatible" case. #68 Overruled, re-removed in #104.
    • Decide if we should add a twig template for the compatibility details or let it all be hard-coded markup. The details render array is now created in template_preprocess_update_version() so it can be altered by themes overriding this preprocess hook if needed. (#137).
    • Decide if we should pass core_compatible to the update-version.twig.html templates or not. #68 We need to do that since we're conditionally hiding the download link after all (#101)
  13. Fix styling (target: aim for #36, implementation: custom CSS in update/css/update.admin.theme.css for <details> / <summary>):
  14. Update / fix failing tests. Done: patch #81
  15. Add new tests:
    • Make sure details are closed vs. open vs. by default for compatible vs. not compatible releases
    • Assert the intro text is how we expect it to be for compatible vs. not compatible Irrelevant after #88.
    • Make sure download link is gone for not compatible releases
  16. Reviews:
    • Accessibility Passed: #91
    • UX Lots...
    • Markup and CSS Done: #160, #161, #164, #166
    • Code / implementation
  17. Add screenshots for themes they have not updated their templates
  18. Remove the changes to drupalci.yml so the full test suite runs
  19. Manual testing. See above for instructions.
  20. RTBC.
  21. Commit.
  22. Follow up for the 9.0 Usability review of the major version update
  23. Follow up to do a UX review of the update status report once other semver work is implemented in core and on Drupal.org as a part of #3110198: [META] Beta targets following Drupal 9.0.0-beta1 and 8.9.0-beta1
  24. Follow up: #3114707: Add color to summary element to improve UX of core compatibility info on available updates report
  25. Follow up: #3114910: Improve Claro styles for core compatibility details on available updates report
  26. Follow up: #3116331: details/summary doesn't have a hover style

User interface changes

Screenshots From Seven (patch #141):

Initial state

initial state of messages. Showing only not compatible details open

Toggled both details

messages after each details element has been clicked.

Claro

Seven with no template changes

With stable template from before #3096078: Display core compatibility ranges for available module updates since this was not committed to 8.8.x

Not sure how reliable this search is, but it only shows 11 themes overriding this template:
http://grep.xnddx.ru/search?text=version&filename=update-version.html.twig
This includes the contrib versions of Claro and Stable

API changes

None

Data model changes

None.

Release notes snippet

TBD. Probably not needed since this is just cleaning up another feature that hasn't yet been released.

CommentFileSizeAuthor
#189 3102724-189-8.8.x.patch28.19 KBtedbow
#182 3102724.175_182.interdiff.txt648 bytesdww
#182 3102724-182.8_9_x.patch28.12 KBdww
#182 3102724-182.9_0_x.patch28.14 KBdww
#179 3102724-175_9.0.x.patch28.1 KBtedbow
#175 3102724-175.patch28.07 KBtedbow
#175 interdiff-172-175.txt4.02 KBtedbow
#172 3102724-172.patch28.36 KBtedbow
#172 interdiff-170-172.txt1.17 KBtedbow
#170 3102724-170.patch28.5 KBtedbow
#170 interdiff-169-170.txt2.06 KBtedbow
#169 3102724-169.patch30.56 KBtedbow
#169 interdiff-165-169.txt6.78 KBtedbow
#169 claro_updates.png168.31 KBtedbow
#165 3102724-165.patch30.21 KBtedbow
#165 interdiff-161-165.txt2.59 KBtedbow
#161 interdiff-158-161.txt5.07 KBtedbow
#161 3102724-161.patch30.45 KBtedbow
#158 3102724-158.patch30.47 KBtedbow
#158 interdiff-155-158.txt5.92 KBtedbow
#155 3102724-155.patch28.77 KBtedbow
#155 interdiff-147-155.txt3.34 KBtedbow
#147 3102724-147.patch26.73 KBtedbow
#147 interdiff-143-147.txt24.81 KBtedbow
#143 3102724-143.claro-toggle-both.png126.24 KBdww
#143 3102724-143.claro-initial.png126.96 KBdww
#143 3102724.141_143.interdiff.txt1.72 KBdww
#143 3102724-143.patch50.47 KBdww
#141 3102724-140.stark_.png100.32 KBdww
#141 3102724-140.claro_.initial.png145.66 KBdww
#141 3102724-140.seven-toggle-both.png107.69 KBdww
#141 3102724-140.seven-initial.png107.15 KBdww
#141 3102724.138_140.commit-diff.txt3.78 KBdww
#141 3102724.138_140.interdiff.txt11.59 KBdww
#141 3102724-140.patch48.46 KBdww
#138 messages-toggled.png121.2 KBtedbow
#138 messages-initial.png121.86 KBtedbow
#138 3102724-138.patch45.12 KBtedbow
#138 interdiff-130-138.txt8.95 KBtedbow
#131 message-no-template-changes.png101.19 KBtedbow
#131 message-toggled.png117.41 KBtedbow
#131 messages-initial.png117.11 KBtedbow
#130 3102724-130.patch44.56 KBtedbow
#130 interdiff-129-130.txt4.56 KBtedbow
#129 3102724-129.patch44.54 KBtedbow
#129 interdiff-127-129.txt10.11 KBtedbow
#127 3102724-127.patch37.59 KBtedbow
#127 interdiff-120-127.txt12.81 KBtedbow
#122 3102724-122.claro-initial-styles.png130.93 KBdww
#120 3102724.116_120.interdiff.txt1.16 KBdww
#120 3102724-120.patch40.5 KBdww
#117 3102724.114_116.interdiff.txt6.21 KBdww
#117 3102724.112_116.interdiff.txt3.81 KBdww
#117 3102724-116.patch40.42 KBdww
#114 3102724-114.patch42.94 KBtedbow
#114 interdiff-112-114.txt4.82 KBtedbow
#112 3102724-111.patch40.04 KBtedbow
#112 interdiff-110-111.txt19.17 KBtedbow
#110 3102724-110.patch21.18 KBbnjmnm
#110 interdiff_104-110.txt2.22 KBbnjmnm
#104 3102724-104.seven-toggle-both.png107.16 KBdww
#104 3102724-104.seven-initial-state.png106.27 KBdww
#104 3102724.94_104.interdiff.txt2.59 KBdww
#104 3102724-104.patch22.63 KBdww
#100 claro-action-link.png93.79 KBckrina
#100 claro-details.png150.47 KBckrina
#96 3102724-96.seven-not-compatible-collapsed.png54.24 KBdww
#96 3102724-96.seven-not-compatible-focus.png65.35 KBdww
#96 3102724-96.seven-release-notes-focus.png65.75 KBdww
#96 3102724-96.seven-toggle-both.png115.8 KBdww
#96 3102724-96.seven-initial-state.png116.44 KBdww
#96 3102724.94_96.interdiff.txt4.09 KBdww
#96 3102724-96.patch24.91 KBdww
#94 3102724-94.seven-toggle-both.png106.86 KBdww
#94 3102724-94.seven-initial-state.png107.12 KBdww
#94 3102724.92_94.interdiff.txt3 KBdww
#94 3102724-94.patch21.66 KBdww
#92 3102724-92.seven-toggle-both.png107.66 KBdww
#92 3102724-92.seven-initial-state.png108.09 KBdww
#92 3102724.81_92.interdiff.txt1.63 KBdww
#92 3102724-92.patch20.77 KBdww
#86 3102724-86.seven-toggle-both.png134.56 KBdww
#86 3102724-86.seven-initial-state.png134.08 KBdww
#86 3102724-86-manual-testing.do-not-test.patch375 bytesdww
#85 3102724-85-manual-testing.do-not-test.patch1016 bytesdww
#84 3102724-84.manual-testing-do-not-test.patch1016 bytesdww
#81 3102724.79_81.interdiff.txt1.77 KBdww
#81 3102724-81.patch21.43 KBdww
#79 3102724.78_79.interdiff.txt8.02 KBdww
#79 3102724-79.patch20.24 KBdww
#78 3102724.69_78.interdiff.txt531 bytesdww
#78 3102724-78.do-not-test.patch13.8 KBdww
#69 3102724-69.seven-compatible-closed_compatibility-focus.png50.18 KBdww
#69 3102724-69.seven-compatible-closed_release-notes-focus.png51.02 KBdww
#69 3102724.68_69.interdiff.txt1.33 KBdww
#69 3102724-69.patch13.8 KBdww
#68 3102724-68.seven-not-compatible-closed.png52.3 KBdww
#68 3102724-68.seven-not-compatible-open.png80.38 KBdww
#68 3102724.67_68.interdiff.txt2.59 KBdww
#68 3102724-68.patch13.42 KBdww
#67 3102724-67.seven-not-compatible-closed.png47.15 KBdww
#67 3102724-67.seven-not-compatible-open.png77.28 KBdww
#67 3102724-67.seven-compatible-open.png78.68 KBdww
#67 3102724-67.seven-compatible-closed.png50.8 KBdww
#67 3102724.66_67.interdiff.txt2.24 KBdww
#67 3102724-67.patch14.39 KBdww
#66 3102724.55_65.interdiff.txt3.37 KBdww
#66 3102724-66.patch15.48 KBdww
#65 3102724.65_66.interdiff.txt734 bytesdww
#65 3102724-65.patch15.51 KBdww
#55 3102724-55.seven-not-compatible-open.png81.92 KBdww
#55 3102724.54_55.interdiff.txt718 bytesdww
#55 3102724-55.patch14.48 KBdww
#54 3102724-54.seven-not-compatible-open.png135.88 KBdww
#54 3102724.51_54.interdiff.txt1 KBdww
#54 3102724-54.patch14.09 KBdww
#51 3102724.49_51.interdiff.txt2.05 KBdww
#51 3102724-51.patch13.39 KBdww
#50 3102724-49.seven-compatible-open.png61.78 KBdww
#49 3102724-49.seven-not-compatible-open.png59.57 KBdww
#49 3102724-49.seven-not-compatible-closed.png47.07 KBdww
#49 3102724-45.seven-compatible-open.png66.42 KBdww
#49 3102724-49.seven-compatible-closed.png49.73 KBdww
#49 3102724.45_49.interdiff.txt3.13 KBdww
#49 3102724-49.patch13.23 KBdww
#45 3102724-45.seven-not-compatible-open.png60.61 KBdww
#45 3102724-45.seven-not-compatible-closed.png48.86 KBdww
#45 3102724-45.seven-compatible-open.png66.42 KBdww
#45 3102724-45.seven-compatible-closed.png55.26 KBdww
#45 3102724.44_45.interdiff.txt1.4 KBdww
#45 3102724-45.patch11.97 KBdww
#44 3102724.31_44.interdiff.txt2.85 KBdww
#44 3102724-44.patch10.33 KBdww
#36 details-modules-page.png43.67 KBwebchick
#31 3102724.29_31.interdiff.txt2.91 KBdww
#31 3102724-31.patch10.09 KBdww
#29 3102724.26_29.interdiff.txt2.16 KBdww
#29 3102724-29.patch10.09 KBdww
#26 3102724-25.not-compatible-open.png78.85 KBdww
#26 3102724-25.not-compatible-initial.png63.72 KBdww
#26 3102724-25.compatible-open.png86.09 KBdww
#26 3102724-25.compatible-initial.png67.18 KBdww
#26 3102724-26.patch8.94 KBdww
#13 22be5f2abac6c872c2156eedf19156e978e6e73a.jpeg560.82 KBgábor hojtsy
#6 Screen Shot 2020-01-23 at 12.56.19 PM.png317.13 KBwebchick
#5 Screen Shot 2020-01-23 at 12.56.19 PM.png359.6 KBwebchick
#3 update-status-proposal.png131.53 KBwebchick
#3 firefix-app-details.png357.12 KBwebchick
#3 firefox-app-updates.png274.99 KBwebchick
#3 chrome-app-details.png136.5 KBwebchick
#3 chrome-app-updates.png234.08 KBwebchick
#3 mac-app-details.png850.92 KBwebchick
#3 mac-app-updates.png1.08 MBwebchick

Comments

dww created an issue. See original summary.

dww’s picture

One extremely important thing this UI should make more clear is if a given release is compatible with the version of core you're currently running. That's definitely not obvious when skimming the output. Especially if your version of core is inside one of the printed ranges, it's going to take quite a bit of mental energy to parse the range and figure out if the given update would work on your site. We could compute that automatically and tell you by some more obvious mechanisms (icon with hidden text, explicit text, both, etc).

The other extremely useful bit of info that's currently rather buried is if the given release would be compatible with a recommended core update. This is a bit harder to quantify, since there might be multiple core updates recommended. E.g. if you're on 8.7.9 right now, update.module will tell you to update to 8.7.11 and mention that 8.8.1 also exists. But it'd be really slick if an available update for one of your contribs could say (approximately):

Address 8.x-1.7
This module is compatible with Drupal core 8.6.0 to 8.8.1, including your current version (8.7.9), recommended core (8.7.11) and latest core (8.8.1)

(more or less).

webchick’s picture

StatusFileSize
new1.08 MB
new850.92 KB
new234.08 KB
new136.5 KB
new274.99 KB
new357.12 KB
new131.53 KB

This page has probably never had a usability eye on it, so it's a little difficult to parse out exactly what to be focusing on. And I'm assuming we want something simple, rather than a full-scale redesign?

Because in terms of other apps' update pages, none of them that I have readily available go to nearly this level of detail, esp. on the top level. They just simply would just not show you things that do not work for your version, and any more detailed version information would be hidden behind a "Details" / "More" link; the interface itself simply showing you lists of things to update and a button to update all of them.

Examples:
Mac OS App Updates page
Mac OS App details page
Chrome App updates page
Chrome App details page
Firefox App updates page
Firefox App details page

So to avoid a wholescale redesign, one idea could be doing this a bit like the modules page, where the pertinent info is available at hand (name of module, whether it's a security release or not), and you expand a details element to get at the rest of the info, which we could format however (e.g. in a table, if that's an easier way of parsing this info).

Collapsed details elements

(I'm sure this is missing some nuance, but to get the brainstorming kicked off...)

Basically: make it very easy for people to make the best choice, and bury the other choices, as well as other details not directly related to solving the problem at hand.

dww’s picture

Thanks, @webchick!

Re:

They just simply would just not show you things that do not work for your version

Big ole' can-o-worms. :/ See #3076183: [Meta] Determine how available updates for modules should be handled if they are not compatible with the current version of Drupal core -- oh yeah, you commented there, too. ;)

I like the ideas of collapsing most of the details on this report. That sounds like a really good move, but seems a bit out of scope. I agree this report hasn't had much UX review in years (although it's not fair to say "never" we did try in the earlier days, including a fair bit of effort from bojan and yoroy). I was trying to be more specific with this issue and the details around the core compatibility ranges, not a full-scale "redesign the available updates report" issue.

That said, if we go this route to address the duplicate / verbose info that was just added, we'd still end up burying the important info about core compatibility. Or, we'd have to put this info "above the fold", and then we're not really any better off.

Or, we'd have to summarize the key compatibility stuff I mentioned in #2, put *that* above the fold, and put all the detailed version range stuff in the hidden details.

Or something. ;)

webchick’s picture

StatusFileSize
new359.6 KB

Oh, right, I knew this problem space sounded overly familiar. :D And fair point this has received some UX love, just not in a very long while, and so other pages such as the Status Report page or https://www.drupal.org/project/upgrade_status have had much more recent UX love would be good places to look for patterns in general.

So for the purposes of this issue, you want us to explicitly focus on this text that was added?

Provides a range of Drupal versions project is compatible with

Can you elaborate on why exactly you think this info is so critical and should be raised in visual importance? To me, the critical thing to answer is "Does this work with my version of core or not?" and IMO you could handle that in simpler, graphical terms (e.g. green checkmark next to active download link / red X next to disabled download link). The "what other versions is this compatible with?" seems like interesting info, but not relevant to the task at hand, so could be buried wherever... or am I missing some crucial nuance here?

webchick’s picture

StatusFileSize
new317.13 KB

If we did something like that... (yellow box intended to be a tooltip over the "X"; checkbox would read the opposite.)

Implements what's described in above comment.

Once again, just throwing out ideas for brainstorming; not suggesting this as a way forward.

xjm’s picture

xjm’s picture

Tooltips are really hard to get right from a usability and accessibility perspective. My guess as not-a-user-experience-expert is that it'd be better for it to use a "Details" pattern if needed.

I think you need to know what version of Drupal you need to install in order to also install the needed security update. "Not compatible with your version of Drupal." does not give you that information.

xjm’s picture

Sorry, my remark about "Details" is ambiguous in light of #3 which I had not read. I mean like:

"Not compatible with your version of Drupal. Details ▸"

"Not compatible with your version of Drupal. Details ▾
Requires numbers numbers numbers.
"

What's also not clear to me is whether the message is shown if it is compatible with your version of Drupal. IMO it shouldn't be.

xjm’s picture

There are designs on #2990476: If the site is on an insecure version of an old minor and there is a secure version of that old minor available, the update status report should link that release for fixing the update status report WRT security releases, so we should also go with something minimal here that just undoes the regression of adding confusing words and numbers, and continue to work on this page after. I do like Angie's idea of not having a download link if it's not compatible with your version of Drupal. I might go a step further and just display no download link at all, since the word download as not-a-link also seems like a UX issue.

gábor hojtsy’s picture

StatusFileSize
new560.82 KB

I think the current UI elements being discussed have a goal of indicating if you can update to them or not, while still being compatible with your current Drupal core. This is like Google Play Store's incompatibility marker (which is shown before app downloads and for some reason green):

I also agree with @xjm that if there is a security update of a contrib and you cannot update to it because it is not compatible with your core, then you need to figure out which core you need first, which is where this message is (also) useful.

Another thing that may happen is that you are to update core (eg. for a security release) and then some extensions may not be compatible with it anymore, but that is not indicated on this screen, so the individual extensions do not display whether the current versions you have are compatible with which core and therefore you cannot tell what your boundaries are of updating your core. (Even though that is also information Drupal itself has but does not expose here).

All of this is of course heavily going into the realms of "just do this with composer" and "we are reimplementing composer data here for human brain processing". And yes, that is what we are doing because we want to keep supporting tarballs I guess.

xjm’s picture

Version: 8.9.x-dev » 8.8.x-dev
Priority: Major » Critical

We have to support tarballs until we don't. As of a year ago, 50% of sites still used tarballs. Removing the update status report or making it purely informational is out of scope for this issue. :P All we need to do here is clean up the message.

After sleeping on this, I'm promoting this to critical, because we really need this and the issue it's blocking in 8.8 and that's blocked right now.

gábor hojtsy’s picture

All we need to do here is clean up the message.

Ok, but what do we want it to make users able to do? We can clean it up once we know that. Eg. it sounds like we don't care about whether a project supports an older version of core, so we could filter those out in the first place. In the screenshot core is 8.8.1 while the message explains the extension was also compatible with 8.8.0, which does not matter anymore here. That is one cleanup. What else to display depends on further refining the use case though.

IMHO talking about what to do with it is premature without defining first what the use cases it supports should be.

xjm’s picture

So what about something like replacing the download link with:

⚠️Not compatible ▸

Which expands to

⚠️Not compatible ▾
Requires Drupal core version(s) 8.0.1, 8.1.1 

(We'd format_plural() "versions". I mean not obviously the deprecated function but you know what I mean.)

xjm’s picture

We could potentially add some logic to only provide info on versions of core higher than yours unless it's only compatible with lower versions.

And as I said, the message should not display anything if the version is compatible.

webchick’s picture

Re: #15, I also struggle with "what are the specific problems we're trying to solve here?" as leaping ahead into design-land without that seems premature.

As best I can tell it's something like:

"As a site builder, I want the update status report to inform me of updates to my site, particularly security issues."
"As a site builder, if a particular update is not compatible with my version of Drupal, I expect to be informed of what steps I need to take to get into compliance."

Are there more? Are we also intending to solve like:

"As a site builder, I want to be informed through the update UI of all possible Drupal versions that I could use a particular update with."

^ Because that doesn't sound like an actual use case. ;) That sounds like something I'd go to Drupal.org project pages to find out, personally... On this page, I expect to get relevant information for this site.

What are the other user stories we're hoping to achieve through this information?

dww’s picture

Wow, flurry of activity. Yay. ;)

@webchick re: #5:

Can you elaborate on why exactly you think this info is so critical and should be raised in visual importance? To me, the critical thing to answer is "Does this work with my version of core or not?" and IMO you could handle that in simpler, graphical terms (e.g. green checkmark next to active download link / red X next to disabled download link).

Exactly. That's what I'm trying to say in #2. I think the thing that was added in #3096078 as if it was important and useful info at the same visual importance as a bunch of other stuff is mostly completely irrelevant to site builders, and what they actually need to know are the 2 points I wrote:

  1. One extremely important thing this UI should make more clear is if a given release is compatible with the version of core you're currently running...
  2. The other extremely useful bit of info that's currently rather buried is if the given release would be compatible with a recommended core update...

...

To that end, @xjm's #16 (or something like it) is way better than what I put at the end of #2.

+1 to the top-2 user stories in #18. Those seem like the right things for this report to help site builders understand. The last non-case of "show me all possible core updates that a given release is compatible with" (what was actually added) seems mostly irrelevant and confusing. That's why I tried to stop #3096078 from being committed in the first place, and was in favor of reverting it, but I was both too late and not convincing enough. ;) Happy to see this now considered a critical follow-up to actually fix it.

Thanks,
-Derek

dww’s picture

p.s. I understand this issue is now blocking a backport to 8.8.x, but there is no such info in the available updates report in 8.8.x at this time, any patches for this will have to target 8.9.x, be "tested" against 8.9.x, etc. Seems like 8.9.x is the more appropriate version for this issue, but ultimately I defer to @xjm on that.

dww’s picture

p.p.s. The other unspoken elephant in this room is that even if a given contrib release says its compatible with a given version of core, that's but one piece of the whole dependency tree. E.g. maybe you're still on PHP 7.1 and a new contrib release now requires 7.3. Or perhaps the latest release of a contrib you have now adds a new dependency on some other contrib you don't have. Nothing on this report knows about any of that or can tell you about either of those (or other) cases.

So while we can make approximate recommendations, we can't guarantee that what we're recommending you do will actually work. I'm not really sure what to do about that. Writing all the text in a conditional style in that implies "we think this will work, but you'll have to try it and see" would be crappy. Yet, we can't actually state with certainty that the releases we recommend you upgrade to will all work, either individually, or collectively. Hence, why-are-we-trying-to-re-implement-composer-in-update.module? ;) But yeah, I understand we don't yet require everyone to use composer, so we have to have something to help site builders get by without it.

Even with composer in the mix, it's nice to have something tell you automatically that you're missing updates, which composer on its own does not do.

xjm credited AaronMcHale.

xjm credited tedbow.

xjm’s picture

Here are the notes from the UX meeting earlier this week where we discussed the problem we're trying to solve (sorry, forgot to post them amid other activity:

Update status report semver:
- Make "not compatible" a details that replaces downlosd link
- Add a details under download link for compatible releases
- Followup for the 9.0 Usability review of the major verison update
- Followup to do a UX review of the update status report once other semver work is implemented in core and on Drupal.org as a part of #3110198: [META] Beta targets following Drupal 9.0.0-beta1 and 8.9.0-beta1

For this issue, we want to mitigate the UX regression from #3096078: Display core compatibility ranges for available module updates so that the update status report helps users understand which releases are available and whether a given release is compatible. We want to go with the minimal change so that D9 is in a shipable state and so the change is backportable to 8.8.x.

I'm adding issue credit for those who helped participate in the UX discussion.

Anyone up to implement a prototype of the above proposal from the meeting discussion?

dww’s picture

Assigned: Unassigned » dww

I'm in the middle of a very initial quick hack prototype of this. Stay tuned...

dww’s picture

Assigned: dww » Unassigned
Issue summary: View changes
Status: Active » Needs work
StatusFileSize
new8.94 KB
new67.18 KB
new86.09 KB
new63.72 KB
new78.85 KB

Super ugly. Totally un-styled. Probably not The Right Way(tm) to deal with the template changes (although I don't believe any of this has actually been released yet, so we should still be free to make such changes without BC worries). Probably not the right markup we want to end up with. Left some @todo for possible API changes to ProjectCoreCompatibility we might want to make.

That said, basically working prototype. ;)

NW for all sorts of things, including:

  • Improve implementation, remove @todo's, etc
  • Possibly updating existing tests.
  • Adding new tests.
  • Fix styling.

(added all those to the summary's remaining tasks list).

Sort of a PITA to actually test this. Ended up installing token 8.x-1.5 from tarball, hacked my local copy of core/lib/Drupal.php to claim I'm on 8.8.0, then manually forced a FALSE return from ProjectCoreCompatibility::isCoreCompatible() to see the incompatible cases happen.

Screenshots from Seven:

Compatible

Initial

Screenshot of available updates for a compatible release, initial state (details closed)

Open

Screenshot of available updates for a compatible release, details opened

Incompatible

Initial

Screenshot of available updates for an incompatible release, initial state (details closed)

Open

Screenshot of available updates for an incompatible release, details opened

dww’s picture

Issue summary: View changes

Putting screenshots from #26 into summary, other updates / cleanups.

aaronmchale’s picture

The like the approach by @dww in #26. If I remember correctly I think we agreed to not hold this issue up too much on specific wording and look at it in a follow-up, but my initial thoughts are that to avoid any confusion we should be a little more explicitly, for example instead of simply saying "Not compatible" we could say "This update has compatibility issues", that would just make sure there's no confusion about what "Not compatible" relates to. But again if we felt it's better to do that in a follow-up, happy to wait until then ;)

Great work everyone!

Edit: maybe it was #2991207 that we agreed to do text changes in a follow-up, these are both quite similar so maybe @xjm can clarify which one it was we agreed not to let text changes hold up.

dww’s picture

Version: 8.8.x-dev » 8.9.x-dev
Issue summary: View changes
StatusFileSize
new10.09 KB
new2.16 KB

Here's what I meant with the @todo in the patch. Technically, this isn't "in scope", but it seems like a useful API cleanup given the in-scope changes we do need to make to this class to make this all work.

I didn't touch the tests, so this would still fail. No reason to have the bot churn on it until we get closer to what we want and fix the tests to match.

Also, I know we want this to backport into 8.8.x, but meanwhile, all the patches and testing are going to have to target 8.9.x, so I'm moving the version accordingly. See #20.

Finally, hiding all the screenshots from the file table. They're all linked or embedded in the comments, so we don't need them in the file table in the summary.

Thanks,
-Derek

tedbow’s picture

  1. +++ b/core/modules/update/src/ProjectCoreCompatibility.php
    @@ -59,6 +68,7 @@ public function __construct(array $core_data, array $core_releases) {
    +   *   @todo No longer needed now that this is a protected member of the class?
    

    I actually think this is inscope to change in this issue we now need this on class level we should be able remove it here.

  2. +++ b/core/modules/update/src/ProjectCoreCompatibility.php
    @@ -131,7 +141,16 @@ public function setReleaseMessage(array &$project_data) {
    +        $release['core_compatibile'] = $this->isCoreCompatible($release['core_compatibility']);
    ...
    +          '#title' => $release['core_compatibile'] ? $this->t('Compatible releases') : $this->t('Not compatible'),
    

    Spelling should be core_compatible

    I didn't know why this was stored in the $release array but I see we use in the twig template to not output the download link.

    I guess we can't just
    unset($release['download_link'])
    here because of BC concerns if some overrode the template?

dww’s picture

Issue summary: View changes
StatusFileSize
new10.09 KB
new2.91 KB

@tedbow re: #30:

1. Great, glad you agree. Already fixed in #29.

2. Whoops! ;) compatibility^H^H^He is to blame. ;) Fixed.

I didn't know why this was stored in the $release array but I see we use in the twig template to not output the download link.

I guess we can't just unset($release['download_link']) here because of BC concerns if some overrode the template?

Yeah, I guess. :/ I've been deeply involved in a bunch of issues that try to touch core twig templates and I still don't really understand what we're allowed to change, when, and why. :( So I simply hacked this together, without caring too much about The Right Way(tm) to solve everything. I still consider this a prototype, and I'd rather focus on how we actually want this to look and behave first, then sort out how to implement it such that it can be committed.

For a UX review, I wonder if the details should go above (#26) or below the "Release notes" link. Even if we style this better, it still seems a bit jarring to have things in this order:

  • Download
  • [Compatible releases]
  • Release notes

Maybe this is better:

  • Download
  • Release notes
  • [Compatible releases]

And in the not compatible case:

  • Release notes
  • [Not compatible]

Added making a decision about this to remaining tasks.
Also re-ordered the remaining tasks a bit.

dww’s picture

Issue summary: View changes

@AaronMcHale re: #28 -- sorry I missed this earlier...

If I remember correctly I think we agreed to not hold this issue up too much on specific wording and look at it in a follow-up, but my initial thoughts are that to avoid any confusion we should be a little more explicitly, for example instead of simply saying "Not compatible" we could say "This update has compatibility issues", that would just make sure there's no confusion about what "Not compatible" relates to. But again if we felt it's better to do that in a follow-up, happy to wait until then ;)

I think this is that follow-up. ;) Since this is (part of) what's blocking a bunch of update.module patches from being backported into 8.8.x, it seems we need to get this correct, here and now. We can't keep punting the wording to the future, or we'll never be able to actually commit anything to 8.8.x. I believe the idea is "let's not completely redesign the entire available updates report UI" here. That much is true. ;) That needs to happen separately. But anything related to this compatibility range stuff should be fixed as part of this issue.

Specifically re: "This update has compatibility issues" -- I think that's still too vague. If we want to be more explicit, we should say something like "This update is not compatible with your version of Drupal" or something. It's not just "compatibility issues". It's fully incompatible. ;)

Added making a decision on these details titles to the remaining tasks...

Thanks!
-Derek

dww’s picture

Issue summary: View changes
dww’s picture

Issue summary: View changes

Also added this to remaining tasks:

  • Decide if we should also inform site admins about compatibility with recommended/available core update versions. See #2
webchick’s picture

Oof, reviewing the screenshots in #26, that DETAILS element REALLY QUITE YELLY and as a result, it completely visually overshadows the "Download" link, which is the actual thing you want to do here in the 90% case...

Hm.

webchick’s picture

StatusFileSize
new43.67 KB

Can we somehow re-use the more subtle details styling from the modules page? This is meant to be supplementary info, not "OMG, CLICK ME NOW, PLZ!!!!!"

An expanded module description showing other supplementary info.

webchick’s picture

As far as the outstanding questions in "remaining tasks," my 2 cents:

  • #4: For the 90% case (a project has a routine update which continues to be compatible with my version of Drupal), the "compatible releases" is purely supplementary info (and even in the 10% case where it's not; release notes are probably still more important). So +1 to sticking it at the bottom of the list.
  • #5: https://medium.com/microsoft-design/take-the-time-to-use-fewer-words-450... Always use fewer words in the UI, if you can. Because either of those counter-proposals would increase the number of words (and thus cognitive load), and because we don't have any data (more of a suspicion) to back up that the existing wording confuses people, I would recommend taking the proposal of changing "Not compatible" to a follow-up, if we want to pursue it.
  • #6: This once again is adding more text. It might be good text for them to know. I'm not sure here is the right place to communicate it. (This is more the Drupal project page's job.) We could spin this off to a follow-up as well, since it's not material to the immediate problem, which is getting them onto a version of Drupal that lets them get their (security) update. As long as the existing text solves that problem, I think we're good.
dww’s picture

@webchick: Thanks for the replies!

Re: #35: Yeah, absolutely. I kept trying to make it clear this is totally un-styled. The screenshots in #26 in no way represent what I (or anyone else) wants this to actually look like. ;) It's just proof-of-concept, fleshing out the required API changes to make it work, etc.

Re: #36: Good question. Thanks for the pointer to an existing pattern in core to try to re-use. All those styles live directly in core/modules/system/css/system.admin.css:

.system-modules details[open] {
  overflow: visible;
  height: auto;
  white-space: normal;
}
.system-modules details[open] summary .text {
  text-transform: none;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
}
.system-modules td details a {
  color: #5c5c5b;
  border: 0;
}
.system-modules td details {
  height: 20px;
  margin: 0;
  border: 0;
}
.system-modules td details summary {
  padding: 0;
  cursor: default;
  text-transform: none;
  font-weight: normal;
}

So, either we get to:
A) Duplicate those styles into core/modules/update/css/update.admin.theme.css in such a way they'll take precedent over the default details styles in Seven and Claro.
B) Add specific styles to Seven + Claro for this.
C) Do some hacky crap to add system-modules class and a <td> around the available updates report so those styles kick in (ugh).

I vote A, I guess, but the folks who really know about The Right Way(tm) to deal with markup/CSS changes in core should state their preference.

Re: #37:
- Position (4 - hope we don't renumber those): Great. I think the bottom of the pile is better, too.

- Title "Not compatible" (5) - Right, less is more. :) Note: there's no data about "existing wording" because this feature has never been released. ;)

- Compatibility with recommended updates (comment #2, currently 6 in remaining tasks): I was imagining that would be buried inside the message inside the details. So I'm less concerned about adding more text there, since someone already clicked on the "tell me more..." link. But sure, I guess we could punt that to yet another follow-up. I'm just already concerned we have a huge list of issues and patches that are interdependent that we're trying to resolve and backport all the way to 8.8.x, and every new "let's do that in a follow-up" adds to that complication.

Thanks again!
-Derek

webchick’s picture

Cool re: styling still being @todo. :) I did see that in the "remaining tasks" but wanted to be sure to emphasize the point so it was not lost. :P We also don't have to use the module page styling, it just is already there. Whatever works best.

Sorry, yes, I know this hasn't been released yet, but that also means no end user has been confused about the shorter text yet, so... ;)

Yeah, fair point about issue spaghetti. I guess if we're going to point those things out, I would recommend we do them in one place, like either at the top of the page, or in the "Drupal core"'s row. Otherwise you're going to repeat yourself over and over and over again on each "expando-thingy" on what the various current/recommended/latest versions are (these will not change row-to-row), which adds a lot of extra noise each time and makes the "meat" of the message harder to parse.

And if we're going to put it once, up there, then it doesn't seem like it has anything to do with this issue, which is about the compatible/not compatible messaging per row. Hence, the recommendation for a follow-up, since it sounds like it'd be a nice improvement regardless of what happens here.

Once again, just my 2 cents, tho.

dww’s picture

Re: #39 Righto. ;)

I guess if we're going to point those things out, I would recommend we do them in one place, like either at the top of the page, or in the "Drupal core"'s row. Otherwise you're going to repeat yourself over and over and over again on each "expando-thingy" on what the various current/recommended/latest versions are (these will not change row-to-row), which adds a lot of extra noise each time and makes the "meat" of the message harder to parse.

We can't put compatibility with the latest recommended core release up only once, since in general, each project on this page could specify different core_version_requirement constraints, and therefore, not all of them will be compatible with any given core release (either currently installed or recommended). That's why this stuff is already duplicated for each row. In practice, a huge number of your projects will all have the same compatibility, so all these messages are going to be duplicate, which is why we want to hide them in a collapsed <details> in the first place.

My point from comment #2 was that if we're going to say this over and over:

This module is compatible with Drupal core: 8.8.0 to 8.8.2

as that list grows, and potentially includes multiple ranges of compatibility, and it gets harder and harder to parse the list and figure out WTF, it'd be nice if it simplified things for you to tell you "is compatible with what you're currently running" (yay, we're already doing that with the title of the details link) and "would be compatible with the version of core we're recommending you upgrade to". But yes, this last part is complicated to get right (since there might be multiple versions of core being recommended in the core section) and adds clutter to an already cluttered list of stuff for mere mortals to read through and parse. So probably won't fix or punt to Yet Another Followup(tm) and not let it hold up this critical issue.

But, I'll leave that open for more feedback before officially crossing it off the remaining tasks as a final decision. I am not a UI expert. ;)

Thanks,
-Derek

aaronmchale’s picture

Re #32

Specifically re: "This update has compatibility issues" -- I think that's still too vague. If we want to be more explicit, we should say something like "This update is not compatible with your version of Drupal" or something. It's not just "compatibility issues". It's fully incompatible. ;)

Yeah that makes sense.

Re #36

Can we somehow re-use the more subtle details styling from the modules page? This is meant to be supplementary info, not "OMG, CLICK ME NOW, PLZ!!!!!"

An expanded module description showing other supplementary info.

Oh I like that idea :) The module page example does look cleaner.

Re #37

#5: https://medium.com/microsoft-design/take-the-time-to-use-fewer-words-450... Always use fewer words in the UI, if you can. Because either of those counter-proposals would increase the number of words (and thus cognitive load), and because we don't have any data (more of a suspicion) to back up that the existing wording confuses people, I would recommend taking the proposal of changing "Not compatible" to a follow-up, if we want to pursue it.

Very valid point, fewer words can be more effective, but you also need a happy medium where you need just enough words to effectively convey what the important part, without loosing the important part on a quest to use the fewest possible words.

Does "Not compatible" do that, well technically yes, but it does still have an ambiguity about it, the user might ask "Not compatible with what...", of course they can just expand the detail element to find out, but is it obvious enough that by expanding the detail element that's what they will find out?

Re #38

A) Duplicate those styles into core/modules/update/css/update.admin.theme.css in such a way they'll take precedent over the default details styles in Seven and Claro.

Personally I'd go with that one, I know there's the whole debate and discussions going on about how to deal with CSS changes.

dww’s picture

@AaronMcHale re: #41: Thanks, all great feedback.

Does "Not compatible" do that, well technically yes, but it does still have an ambiguity about it, the user might ask "Not compatible with what...", of course they can just expand the detail element to find out, but is it obvious enough that by expanding the detail element that's what they will find out?

As @webchick pointed out in #39, this is all just speculation at this point, since none of this has been released, we're not a few years into releases that are making these compatibility ranges/lists more verbose/complex, etc. We just have to make our best guesses, ship it, and see what happens. ;) Until we have any real evidence that "Not compatible" is actually confusing, Occam's razor says we should keep short.

Another reason to keep the details title at just "Not compatible" is that we might want to expand this stuff someday as part of #3076183: [Meta] Determine how available updates for modules should be handled if they are not compatible with the current version of Drupal core. The modules page already does a bunch of checks for if you can enable a given module or not, including core compatibility, missing dependencies, PHP version, and more. Perhaps we'll actually have a list of compatibility problems for you under "Not compatible", and it'd be a string break and UI change for site admins if these titles change later for that.

- - -

From the summary, is it safe yet to actually make these decisions:

4. Decide if the compatibility details area should go above or below: Below
5. Decide the correct text to use for the details titles: "Not compatible" and "Compatible releases"
6. Decide if we should also inform site admins about compatibility with recommended/available core update versions: Punt-to-followup for (non-critical, maybe not even backportable) discussion.

?

and for implementation details:

#38.A: Duplicate/custom <details> styles in update.admin.theme.css so the DETAILS AREN'T SHOUTING? ;)

Thanks,
-Derek

dww’s picture

Issue summary: View changes

Ugh, hate to ask, but Occam's razor has me thinking... if the update is compatible with your current version of core, does any site builder actually care to see the list of all possible compatible versions? I'd be shocked and amazed if anyone is going to see the Available update report, remember their recommended core release, go through 1-by-1 to click "Compatible releases" for every project, and parse the list of version #s in each one to see if they're ready to upgrade to a later core or not, etc. If we intend to give site builders the info they need to make good decisions about what version of core to upgrade to and when, I think we need to do what I propose in #2. Otherwise, I suspect we're fooling ourselves that anyone is actually going to read all this and process it themselves.

So... maybe we only add the details to a project for the "Not compatible" case, and avoid cluttering things at all in the compatible case?

dww’s picture

Issue summary: View changes
StatusFileSize
new10.33 KB
new2.85 KB

To move this along a bit, let's decide we're putting the release notes above the compatibility details in all cases.

p.s. I also noticed a bug in core/themes/claro/templates/admin/update-version.html.twig where I left a duplicate download link in place.

p.p.s. @tedbow, re: #30.2: "we can't just unset($release['download_link']) here..." because none of the core templates are written such that they check if download_link has a value or not. They all assume there's a value. And yeah, changing all that is more BC-breaking than the changes in this patch. *shrug*

dww’s picture

Issue summary: View changes
StatusFileSize
new11.97 KB
new1.4 KB
new55.26 KB
new66.42 KB
new48.86 KB
new60.61 KB

Okay, here's a stab at styling. Currently only dealing with Seven. Claro is still @todo. But this is getting closer (I hope)...

Compatible

Initial

Screenshot of available updates for a compatible release, initial state (details closed)

Open

Screenshot of available updates for a compatible release, details opened

Not compatible

Initial

Screenshot of available updates for an incompatible release, initial state (details closed)

Open

Screenshot of available updates for an incompatible release, details opened

dww’s picture

Issue summary: View changes

Notes on #45:

1. I don't love that it says "Compatible releases" for the compatible case. Maybe just "Compatibility" is better? "Releases" seems a bit weird here.

2. Still wonder if "Compatible releases" should just completely go away (see #43).

3. Maybe "Not compatible" needs to be red with an error icon or something?

4. Inside the message for "Not compatible", I wonder if the text should say more (I know, bad idea). But either add the word "only" or perhaps even add another sentence: "Your currently installed version ($version) is not supported." or something...

webchick’s picture

Yeah, all the app store examples in #3/#13 just focus on a simple "yes/no" binary of whether a release is compatible with the version you're running now. That version is already prominently at the top of the page. I don't think we need to repeat it over and over.

And #17 seems to agree with you to not show anything if it's already compatible. I think there was one comment (maybe by @tedbow?) that an argument for showing it in both cases is:

- I have core version 8.7.2.
- Module Y has an update, compatible with 8.7.0-8.7.9. It is a yellow row.
- Module Z has a security update, only compatible with 8.8.0+. It has a red row, and a "not compatible".

You are of course going to focus on the security problem first and foremost, and update your version of core to get it. But now module Y doesn't work anymore.

That said, I highly doubt you're gonna be astute enough to find that out ahead of time, because you'd need to clicking on every. single. row. to expand its details and hold it in your head. So +1 I think to dropping it entirely for compatible, and only showing details for "Not compatible," unless anyone else has counter-arguments. In the OS/App store examples, this is the same flow you'd get anyway. ("Oops, your app is now no longer compatible with Catalina, go bug the developer for an update.")

aaronmchale’s picture

Re #42

Another reason to keep the details title at just "Not compatible" is that we might want to expand this stuff someday as part of #3076183: [Meta] Determine how available updates for modules should be handled if they are not compatible with the current version of Drupal core. The modules page already does a bunch of checks for if you can enable a given module or not, including core compatibility, missing dependencies, PHP version, and more. Perhaps we'll actually have a list of compatibility problems for you under "Not compatible", and it'd be a string break and UI change for site admins if these titles change later for that.

Ah that's quite a good point, ok sure, I'm fine with just sticking with "Not compatible". Though, I wonder if it would make sense to add an ellipsis at the end, so "Not compatible...", just as a further indication that if they expand the detail element they'll get more information (this proposal is based on the assumption that we are going with the styled detail element shown in #36).

Re #42 and #44

Decide if the compatibility details area should go above or below: Below

To move this along a bit, let's decide we're putting the release notes above the compatibility details in all cases.

Agreed.

Re #43

So... maybe we only add the details to a project for the "Not compatible" case, and avoid cluttering things at all in the compatible case?

That sounds sensible, I think knowing that a module is compatible is enough, going on to explaining what versions it compatible with doesn't seem to be very useful information. As in, module X is compatible, great I'll install it, I'm not really interested in the compatibility range other than the fact it is compatible with my current setup.

Re #45

Nice :)

One thing I'd like to note though: I liked that in #6 there was a clear visual indicator to go along with if the module was compatible or not (the green tick or red cross), I think that's really helpful for if you're scanning the page. I have a visual impairment, so if I were l looking at a long list of updates, and having to go down the list looking at each update one by one to see if the text said compatible or not, I would find that a little tedious; But that clear visual indicator is really helpful.

Re #46

1. I don't love that it says "Compatible releases" for the compatible case. Maybe just "Compatibility" is better? "Releases" seems a bit weird here.

2. Still wonder if "Compatible releases" should just completely go away (see #43).

3. Maybe "Not compatible" needs to be red with an error icon or something?

4. Inside the message for "Not compatible", I wonder if the text should say more (I know, bad idea). But either add the word "only" or perhaps even add another sentence: "Your currently installed version ($version) is not supported." or something...

[1] Yeah maybe just text saying "Compatible" (with a green checkmark or something similar, see above).
[2] I think keeping the word "Compatible" is still useful to have.
[3] Making the "Not compatible" text red with a visual indicator sounds like a good idea.
[4] I like "Your currently installed version ($version) is not supported." (maybe "compatible" instead of "supported" to be consistent), but then on a new line the existing text "The module is compatible with...". That we we're stating the current situation, then explaining the reson.

dww’s picture

- Adds colors
- Changes summary text to just "Compatible" for the default case.

Slightly confused by @AaronMcHale in #48:

#46 (me), #47 (webchick) and #17 (xjm) all seem to be leaning towards removing all the compatibility details entirely for a compatible release. No new words / clutter. Just the same old download link. But in #48 you're saying to remove the details but leave the word "Compatible"? That seems a bit odd. I'd say we should either leave "Compatible" as a working details that shows the details, or remove it entirely. But adding a word (that's going to repeat a lot on this report) that seems fairly unnecessary, seems like a not-so-great-UI change...

Re: visual scanning -- Isn't scanning for "Download" (blue) vs. "Not compatible" (red) going to be sufficient? Do we really want/need to add green check boxes to the Download links?

I tried for a bit to get the error X icon on the summary, but I apparently don't have enough CSS-fu to make that work. ;) Any help on that welcome. If, indeed, we want an X icon next to "Not compatible" at all. I'm also worried a bit about icon overload, since we already have icons on each row about "up to date" (green check) vs. "update available" (yellow warning) vs. "security update missing" (red error).

Compatible

Initial

Screenshot of available updates for a compatible release, initial state (details closed)

Open

Screenshot of available updates for a compatible release, details opened

Not compatible

Initial

Screenshot of available updates for an incompatible release, initial state (details closed)

Open

Screenshot of available updates for an incompatible release, details opened

dww’s picture

StatusFileSize
new61.78 KB

whoops, uploaded 1 wrong file... here it is.

dww’s picture

Issue summary: View changes
StatusFileSize
new13.39 KB
new2.05 KB

Minor CSS cleanup, fixes (e.g. to make it work right when you expand the details so nothing crashes into anything else) and syncing the CSS between core/modules/update/css and core/themes/stable/css. End result looks the same for the purpose of the screenshots, so not uploading anything new for those.

I started looking at Claro, but it's very opinionated about <details> styles, so it's going to be more work to override all that and get it looking similarly there. @todo. ;)

dww’s picture

Issue summary: View changes

Added these to remaining tasks:

  • Decide #48: "Not compatible..." (with ellipsis)
  • Decide if we want icons next to 'Not compatible' and perhaps download link (#6, #16, #48, #49, ...)
  • Fix compatibility message to be aware of project type (not hard-code 'module' into the text)
  • Fix styling:
    • Seven: Mostly done
    • Claro: Todo
dww’s picture

Issue summary: View changes

Re: Fix compatibility message to be aware of project type (not hard-code 'module' into the text)
-- or maybe better yet, just say "This release is compatible ..." instead of 'module' or 'theme'.

dww’s picture

Issue summary: View changes
StatusFileSize
new14.09 KB
new1 KB
new135.88 KB

Yeah, "release" is more accurate, anyway. Way simpler fix / smaller interdiff.

Screenshot of available updates for an incompatible release, details opened

dww’s picture

Issue summary: View changes
StatusFileSize
new14.48 KB
new718 bytes
new81.92 KB
  • Decide if the not-compatible message should say the currently installed core version, and if so, above or below the ranges of compatible core releases. See #46.4, #48, #55

Screenshot of available updates for an incompatible release, details opened

p.s.: Again, to get these screenshots, I have to hack a FALSE return for isCoreCompatible() given the current state of releases. So ignore that it thinks 8.8.0 is incompatible with this stated range...

aaronmchale’s picture

Re #49

#46 (me), #47 (webchick) and #17 (xjm) all seem to be leaning towards removing all the compatibility details entirely for a compatible release. No new words / clutter. Just the same old download link. But in #48 you're saying to remove the details but leave the word "Compatible"? That seems a bit odd. I'd say we should either leave "Compatible" as a working details that shows the details, or remove it entirely. But adding a word (that's going to repeat a lot on this report) that seems fairly unnecessary, seems like a not-so-great-UI change...

That's a fair point, the word "Compatibility" would be repeated a lot, and actually if we only showed "Not compatible" and showed nothing when there are no compatibility issues that might make it easier to spot those rare cases where there is a compatibility issue while scrolling through a potentially long list. I'm happy to go with the majority here then :)

Re: visual scanning -- Isn't scanning for "Download" (blue) vs. "Not compatible" (red) going to be sufficient? Do we really want/need to add green check boxes to the Download links?

Yeah after looking at your screenshots of the different colours, and I think if we're now only showing "Not compatible" (and it's red), I think it would be pretty obvious when scanning down the list.

Looking at the screenshots in #49, something just jumped out at me (and this is assuming we don't show "Compatible", as per above). If a release is compatible we show a download like above the release notes link, if the release is not compatible instead we show the not compatible detail below the release notes. To me that seems a little inconsistent, since now we're not showing "Compatible" if the release is compatible, essentially we're showing either a download like or a compatibility detail. I agree that the compatibility detail should be below the release notes link, but I wonder if the download link should also be moved below the release notes link. The might also be good because visually it might encourage people to click the release notes link before clicking the download link.

Re #53

Re: Fix compatibility message to be aware of project type (not hard-code 'module' into the text)
-- or maybe better yet, just say "This release is compatible ..." instead of 'module' or 'theme'.

+1 I think release works well well.

dww’s picture

Issue summary: View changes

@AaronMcHale re: #56 thanks! Adding this to the remaining tasks:

  • Decide if the release notes should go above the download link in the compatible case (#56)

Personally, I'd vote no. In practice, in the compatible case, "everyone" just wants to download and "no one" reads release notes. Swapping this order seems to put the less likely task first (even if we wish it was more likely). Also seems like scope creep (although I admit it's hard to tell what's in and out of scope in this issue).

If anything, to address the inconsistency, I'd reconsider the decision to move compatibility below release notes. If we remove "Compatible" entirely, and only show the details for "Not compatible", I think it'd be fine to have:

[> Not compatible]
Release notes

Cuz in that case, if it's not compatible with core, that's even more important for you to know than whatever the release notes say (which may or may not even tell you about the core compatibility, even though that could be happening automatically on d.o release nodes -- #NeedsFollowup?)

benjifisher’s picture

Issue summary: View changes

We (@dww, @AaronMcHale, @Gábor Hojtsy, and I) discussed this issue on the #ux channel in Drupal Slack. I am not sure we reached consensus, but I believe we agree enough. If we can accept "good enough", then I think we can move forward with this issue and the chain of issues it is blocking.

I am making the following decisions. The numbers refer to the list in the issue summary.

  • 5: "Not compatible …". Personally, I prefer three dots ("...") but I think I lose this one in favor of a single "…".
  • 6: Too hard, out of scope. Do not try to re-implement composer.
  • 7: Yes, show green "Compatible" details element.
  • 8: Icons may be added in a follow-up issue. Or we may decide that the little triangles are good enough and that the report already has enough icons. Keep the Download link.
  • 9: Yes, in both cases start with a full sentence that explains what "Compatible" or "Not compatible" means.
  • 10: Keep the current order, and restore the Download link in the "Not compatible" case.

Personally, I largely agree with the points made in #42. I will not repeat those reasons here. I will add a few of my own:

Consider the case of the developer who tries to update a local copy of the site, runs into trouble, and then wants to discuss the situation with the rest of the team and/or client. Let's not remove the compatibility information just because the current release is compatible with the currently installed version of core.

Let's not remove the Download link, since the developer/site admin may want to update core and a contrib project at the same time. (Worst of all, because of UX and a11y, is to have a disabled link.)

Consistency is good for UX, so let's have the same 3 elements (Download link, Release notes link, and compatibility details) in both cases.

tedbow credited ckrina.

tedbow’s picture

Had another UX meeting on this today. With @xjm, @webchick, @benjifisher, me, and @ckrina

Here the consensus we came to:

  1. The updates report needs a bigger redo that is out of scope here. We should create or find an existing follow-up

    Some ideas to start the follow up, change to table and make each module much simpler to option expand to see more info

  2. Change the text inside the details to: "Requires Drupal core: 8.8.1 to 8.9.2"
  3. Expand by default for "Not compatible" modules
  4. Remove the colors on the details headings for accessibility and UX concerns
  5. No ellipse for the details headings(we don't use this pattern on other parts of core.

tedbow credited shaal.

tedbow’s picture

creding 2 more from the UX meeting

dww’s picture

Assigned: Unassigned » dww
Issue summary: View changes

Thanks for the meetings, decisions and updates!

Harvesting all the action items from #58 and #60 into remaining tasks.

I'll take a stab at this now, stay tuned...

dww’s picture

Issue summary: View changes
StatusFileSize
new15.51 KB
new734 bytes
  1. Add helper method for creating the details element
  2. Open details by default for incompatible case.
  3. Add sentence at top explaining compatibility summary in both cases.
dww’s picture

StatusFileSize
new15.48 KB
new3.37 KB

- Fix text for compatibility range message.

(whoops, reversed which interdiff I attached to which comment... sorry about that).

dww’s picture

Issue summary: View changes
StatusFileSize
new14.39 KB
new2.24 KB
new50.8 KB
new78.68 KB
new77.28 KB
new47.15 KB

- Remove red vs. green colors, always use grey.

dww’s picture

Issue summary: View changes
StatusFileSize
new13.42 KB
new2.59 KB
new80.38 KB
new52.3 KB

- Restore download link for incompatible case.

@todo: Maybe we don't need to pass the $release['core_compatible'] bool to the update-version.twig.html anymore? Maybe people want to be able to tweak this?

dww’s picture

Found some more CSS woes with Seven styles where the hover and focus for the details were causing it to remain blue. Trying to keep it grey, but use a bottom border (since text-decoration doesn't seem to work) for focus and hover...

Not sure I love this, but I'm trying to be consistent with the other Seven focus styles. /shrug

Release notes with focus

Screenshot of available updates for a compatible release, initial state (details closed), release notes has focus

Compatibility details with focus

Screenshot of available updates for a compatible release, initial state (details closed), compatibility details has focus

(Also fixing screenshot embeds in the summary from #68)

Main TODO remaining from the summary:

  1. Decide if we should add a twig template for the compatibility details or let it all be hard-coded markup.
  2. Decide if we should continue to pass core_compatible to the update-version.twig.html templates or not.
  3. Claro styles
  4. Fix existing tests
  5. Add new tests?

Gotta stop for tonight. If anyone else wants to pick this up and run, feel free. ;)

Thanks!
-Derek

dww’s picture

Issue summary: View changes

Adding this to the remaining tasks:

  • Decide what the hover / focus styles should look like
    • Seven
    • Claro

Other minor updates to remaining if anyone else wants to work on anything.

aaronmchale’s picture

Re #67

Remove red vs. green colors, always use grey.

Personally I feel like it would be better if the "Not compatible" detail label (not the contents) was red, because then when you're scanning down the list it's easier to spot the extensions which aren't compatible. If they are all grey that makes it harder to quickly find extensions which will need your attention.

Thanks for all the work on this

webchick’s picture

Rather than red, it's expanded by default, which will help to draw extra attention to it.

xjm’s picture

Status: Needs work » Needs review

We should set the issue NR when a new patch is posted so that tests are run; otherwise, tests get run on every patch all at once when it does get set to NR, causing a potential testbot backlog (which is about to happen now). The alternative is to add the -do-not-test suffix to patches which are incomplete prototypes or etc.

aaronmchale’s picture

Sorry just now catching up on this weeks UX meeting (which unfortunately I wasn't able to be at due to busy work).

I like the idea of expanding the "not compatible" detail element by default, as it draws your attention, agree that if we do that then there's no need for the ellipsis ("not compatible...").

Regarding colour, my thinking has always been to provide a visual indicator, but if the detail element is expanded then that's probably enough of a visual indicator on its own. With that in mind, and as people in the call mentioned, if we don't introduce the red colour then we don't need an accessibility review, and so can move this along quicker. Finally if (as proposed) a larger redesign of this page is done in the future, we'll have more opportunities to look at how we properly convey information. So with all that in mind, I'm ok with just leave "not compatible" in the default grey colour.

I like the idea of changing the core compatibility sentence to use wording like: Requires blah blah blah.

xjm’s picture

...Or CI has changed and it randomly picks the wrong patch to test.

In either case, please set the issue to NR when a new patch is submitted and set it to NW after, or manually queue a test for the patch, unless it's a prototype with a -do-not-test suffix. Thanks!

The last submitted patch, 68: 3102724-68.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

dww’s picture

Issue summary: View changes

@AaronMcHale re: #71: I agree that red for the not compatible summary would be better. However, for scanning, not compatible details are now open by default (#60.3 decision, #65.2 patch), which should help a lot. Also, neither of us were on the call where the decision to drop the colors was decided. Alas. ;) Not sure if it’s worth trying to keep redesigning this or just get something done enough to commit.

@webchick: re: #72 👍

@xjm re: #73 + #76:
I've been trying to save bot cycles and churn when we know the tests still fail.
I've been uploading (nearly) everything with the "Do not test" option selected. Apparently I missed on 1 or two. ;)
I can start adding do-not-test suffix to be extra clear (and to prevent accidents while uploading).
I don't want to fix the tests until we converge on what the actual output will be.

@AaronMcHale re: #74 👍

@testbot re: #76: Coding standards fixes -- well at least that much is useful feedback. 😜

@all: We're back up to 3 "Decide" tasks:

  1. Decide if we should add a twig template for the compatibility details or let it all be hard-coded markup.
  2. Decide if we should continue to pass core_compatible to the update-version.twig.html templates or not.
  3. Decide what the hover / focus styles for these <details> elements should look like:
    • Seven
    • Claro

Thanks everyone,
-Derek

dww’s picture

StatusFileSize
new13.8 KB
new531 bytes

Some other (hopefully) quick questions:

A) Can y'all confirm this is what you want the text of the compatibility details to look like? The meeting summary from @tedbow in #60 says that the compatibility range itself is supposed to say:

Requires Drupal core: 8.8.1 to 8.9.2

Earlier, in #58 @benjifisher said:

Yes, in both cases start with a full sentence that explains what "Compatible" or "Not compatible" means.

But I'm not sure on the exact wording y'all wanted for that. Here's what's in the latest patch/screenshots:

Compatible

Your version of Drupal core (8.8.0) is compatible with this update.
Requires Drupal core: 8.8.0 to 8.8.2

Not compatible

Your version of Drupal core (8.7.11) is not compatible with this update.
Requires Drupal core: 8.8.0 to 8.8.2

Is that cool?

B) Do we want not compatible stronger:

Your version of Drupal core (8.7.11) is not compatible with this update.
Requires Drupal core: 8.8.0 to 8.8.2

?

C) Should it say "... with this release" per #53 and later? I originally put "with this update" in the 1st sentence to not repeat ourselves with "This release is compatible ..." in the 2nd. But now the 2nd has been simplified to just "Requires Drupal Core: [ranges]".

Thoughts?

Thanks!
-Derek

p.s. This patch just fixes the CS bug mentioned in #76.

p.p.s. Edited example text in here to make sense. The screenshots are a hack where I force incompatible for a compatible release, since I don't know of any modules that have releases in the wild yet that would trigger the incompatible cases...

dww’s picture

StatusFileSize
new20.24 KB
new8.02 KB

This "fixes" the unit tests. Sort of. ;) We don't completely assert everything about the new <details>, so at least the unit tests do not cover ::createCoreCompatibilityDetails(). Doing a direct assertSame() on an expected array vs. a computed render array is not going to be fun, unless we love having expected code like this in our unit tests:

      'core_compatibility_details' => Array &2 (
            '#type' => 'details'
            'compatibility_range' => Array &3 (
                '#markup' => 'Requires Drupal core: 8.9.0, 8.9.2'
            )
            '#title' => Drupal\Core\StringTranslation\TranslatableMarkup Object &0000000052c097a1000000005256a49c (
                'translatedMarkup' => null
                'options' => Array &4 ()
                'stringTranslation' => Mock_TranslationInterface_02ce4cbd Object &0000000052c097e2000000005256a49c (
                    '__phpunit_invocationMocker' => PHPUnit\Framework\MockObject\InvocationMocker Object &0000000052c097e3000000005256a49c (
                        'matchers' => Array &5 (
                            0 => PHPUnit\Framework\MockObject\Matcher Object &0000000052c097db000000005256a49c (
                                'invocationMatcher' => PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount Object &0000000052c097e4000000005256a49c (
                                    'invocations' => Array &6 ()
                                )
                                'afterMatchBuilderId' => null
                                'afterMatchBuilderIsInvoked' => false
                                'methodNameMatcher' => PHPUnit\Framework\MockObject\Matcher\MethodName Object &0000000052c097dd000000005256a49c (
                                    'constraint' => PHPUnit\Framework\Constraint\IsEqual Object &0000000052c097dc000000005256a49c (
                                        'value' => 'translate'
                                        'delta' => 0
                                        'maxDepth' => 10
                                        'canonicalize' => false
                                        'ignoreCase' => true
                                        'exporter' => SebastianBergmann\Exporter\Exporter Object &0000000052c097df000000005256a49c ()
                                    )
                                )
                                'parametersMatcher' => null
...

However, a) ::createCoreCompatibilityDetails() might go away in favor of a twig template and b) I'm assuming we'll test that in the functional tests, once we get those working.

Anyway, patch includes a hacked drupalci.yml to only run Update module tests so we can start to see how this behaves...

Status: Needs review » Needs work

The last submitted patch, 79: 3102724-79.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

dww’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new21.43 KB
new1.77 KB

This patch fixes the assertions in the existing functional tests to work with the new layout/markup. So, all existing tests are now passing. Crossing that off remaining tasks.

Also fixed the CS bug I introduced in #79. ;)

Fleshed out the point on adding new tests:

  • Add new tests?
    • Make sure details are closed vs. open vs. by default for compatible vs. not compatible releases?
    • Assert the intro text is how we expect it to be for compatible vs. not compatible?
    • Any other new behavior in here we need test coverage for?

Do we need any/all of that?

Thanks,
-Derek

xjm’s picture

Title: Review / improve usability of #3096078 core compatibility ranges on available updates report » Improve usability of core compatibility ranges on available updates report
xjm’s picture

Untagging for usability review since we did that already.

The points in #81 should have test coverage IMO.

Since this is CSS-a-licious, we also need a code review from a frontend maintainer. Tagging for frontend framework manager review for now, although there are others who can provide a similar review.

And, of course, this is the kind of patch that should have thorough manual testing.

Thanks for all your work on this!

dww’s picture

Issue summary: View changes
StatusFileSize
new1016 bytes

Re: #83: Thanks for the feedback, and you're welcome. :)

I'd still love UX review / feedback on #78, but I guess I can keep pinging the #ux channel in Slack until that's decided.

Removing the ?s from the new tests point in remaining tasks, since that's now a definite TODO. I don't think there's anything for "Any other new behavior in here we need test coverage for?" -- it's either already in the (now updated) existing test coverage, or covered by the other two points in #81. So I deleted that one.

I was imagining "needs frontend framework manager review" should wait until we're done hacking Claro's styles, too. That's what "Markup and CSS" review point was a placeholder for. I thought it was premature to try to get @lauriii to spend any cycles on this just yet. But if they have time to look now, they could hopefully help answer some of the pending "Decide" tasks, and provide feedback on the approach for Seven styles (which would probably inform / improve how we go about trying to get Claro's styles working, too).

Re: manual testing, it's kind of a mess to see this work locally on a real site. :( So I added all this to remaining tasks:

  • Manual testing. Steps to see this in action:
    1. Install a clean 8.9.x site.
    2. Apply latest patch.
    3. Download an older version of a module with a newer release that specifies core_version_requirement. E.g. token 8.x-1.5 (since 8.x-1.6 is out, and that defines the core compatibility in the new format that triggers all this).
    4. Modify your copy of core/lib/Drupal.php and set const VERSION = '8.8.0'; 8.0.0 (see patch in #85).
    5. Visit /admin/reports/updates and check for updates and inspect the "compatible" case.
    6. To see what would happen for an incompatible release, hack your copy of core/modules/update/src/ProjectCoreCompatibility.php so that isCoreCompatible() always returns FALSE (see patch in #85). Ignore the fact that the message will say something like "Your version of Drupal (8.8.0) is not compatible. Requires Drupal core: 8.8.0 to 8.8.2" (or whatever).

Thanks,
-Derek

dww’s picture

Issue summary: View changes
StatusFileSize
new1016 bytes

Sorry, typo in the support patch and instructions. Fixing.

dww’s picture

Issue summary: View changes
StatusFileSize
new375 bytes
new134.08 KB
new134.56 KB

Woot! I asked in Slack if anyone had an official release of a contrib module that already requires 8.8.0. @berdir linked me to redis which is exactly what we need. This definitely simplifies manual testing! Updating the testing steps in the summary accordingly. Also update the screenshots, since now the "Not compatible" case makes sense.

dww’s picture

Issue summary: View changes
webchick’s picture

What we talked about on the UX call was just "Requires Drupal core: X to Y" and that's it. I don't personally see the need for the extra sentence there:

  • The details element already tells you it's "Not compatible" so "Your version of Drupal core ... is not compatible with this update." is just restating that same thing with more words, and forces your eye to keep jumping left every time you scan down the list of updates.
  • The top of the page already told you what version of core you're using (Drupal 8.8.2 or whatever), so once again this is repeating the information over and over makes it more difficult to find the information that you need to hone in on here

Removing words / eliminating repetition makes the key information that changes each row (is it compatible? which versions are compatible?) more scannable. If we find in the field that people are confused about what "not compatible" means, we could always revisit this, but IMO we should start with short and sweet.

dww’s picture

Re: #88 -- that all makes sense and is fine with me. Would definitely simplify the code, and remove one of the items that #NeedsTests. ;) I've just been struggling to keep track of who's deciding what, and didn't want to completely ignore @benjifisher's input on this point. Can we consider that a final decision and proceed to rip it back out?

Thanks,
-Derek

andrewmacpherson’s picture

Issue tags: +Accessibility

Regarding the fuss about using red...

The relevant WCAG success criterion is 1.4.1 "Use of Color". To assess it, answer the following:

  1. What is "red" trying to convey?
  2. Is that conveyed by some other means? If so, demonstrate it.
  3. Does the approach follow one of the "sufficient techniques" listed for WCAG SC 1.4.1 "Understanding Use of color"

In this case, I think technique G14 has been carried out: Ensuring that information conveyed by color differences is also available in text.

Re. #74: the default open/closed state of the details group can't be relied upon as the non-colour signifier for purposes of SC 1.4.1 Use of color. That's because the open/closed state is temporary, and users can be expected to toggle it while exploring the page. However the text of the summary element itself is sufficient here ("not compatible" vs "compatible".

Earlier versions of the text looked confusing to me. In the screenshots of #54, you have "Not compatible" followed soon by "is compatible" and I think those messages could be mixed up. Like, you have to parse out that it's not compatible with this core version, but is compatible with a different core version. If you're not reading carefully that might get mixed up. The messages as of #86 have removed this confusion.

P.S. remember to use the accessibility issue tags :-)

Crediting @rainbreaw, who also responded to @dww in Slack

dww’s picture

Issue summary: View changes
StatusFileSize
new20.77 KB
new1.63 KB
new108.09 KB
new107.66 KB

Thanks @andrewmacpherson and @rainbreaw for the info! Very helpful.

I do think red would improve the UX here, and would not be an accessibility problem. We already have a very dark red (#a51b00) that we're using on this page for high contrast with the light red (#fcf4f2 - 7.02:1) or light yellow (#fdf8ed - 7.19:1) backgrounds where these <details> might appear. I'd like to restore red for the "Not compatible" summary / details, assuming there are no objections.

But first, here's a patch and screenshots for #88.

dww’s picture

p.s. With permission, pasting @rainbreaw's Slack comments for posterity / education:

dww: I understand it's an accessibility problem to rely on color to convey any information. However, it seems like it shouldn't be a problem to use color as a supplemental way to express something, right? I'm working on https://www.drupal.org/project/drupal/issues/3102724 and earlier iterations of the patch used red for the <details> summary text that says "Not compatible". Later reviews have requested we remove the color for fear of introducing an accessibility problem. I don't care that strongly, and am happy to go along with it, but it seems like a bit of superstition / misplaced worry. Can anyone confirm / deny my hunch on this?

rain: I didn’t read through the issue in order to get the context of concern about using color as a supplemental indicator, but you are correct. Color may be used as an indicator as long as 1) it’s not the only way to get the information that the color conveys, 2) it has sufficient contrast (4.5:1 under most conditions for level AA, 7:1 under most conditions for level AAA), and 3) it’s meaning and legibility has been carefully evaluated so that you are confident it is clear. For some, red can be a problematic color when used for text on screens because it may take more for them to focus.

rain: When done well, using color as another source of meaning can be a huge positive, as some users may have difficulty understanding the meaning of the text, and others may not be sure of the meaning of icons. (edited)

rain: Keep in mind that color has different meaning to different people as well

... Then @andrewmacpherson chimed in, but they already posted above, so I won't re-paste the Slack thread that continued.

Thanks,
-Derek

dww’s picture

Issue summary: View changes
StatusFileSize
new21.66 KB
new3 KB
new107.12 KB
new106.86 KB

Restoring the dark red for "Not compatible". Leaving the screenshots of all grey from #92 in the summary for comparison.

dww’s picture

Issue summary: View changes

Minor summary cleanups, and officially crediting @andrewmacpherson, too.

dww’s picture

Adding #2980304: Seven theme's details/summary focus style is broken/missing in some browsers. as related. In general, Seven's focus styles for <details> are inconsistent and broken on many browsers. :( Including on the admin/modules page that's the inspiration for these styles -- there's no visible focus indication *at all* on Chrome or Safari.

I hacked on this for a while, and discovered that although some docs suggest it works, using text-decoration on the <summary> is very poorly supported by most browsers. In my testing, only works on Firefox, but not Safari nor Chrome. I don't have access to other browsers to play with. Ugh.

So I tried using a bottom-border on hover. That mostly works, but doesn't look very nice. That's basically the screenshot from patch #69.

Then I tried making the summary display: inline-block so that the border is only as wide as the text. That looks way better on Safari and Chrome. But that ends up completely removing the show/hide triangle icon on Firefox. 🤦‍♂️

So then I read more crap online about hiding the default triangle and defining your own, I found #2405059: Update Drupal's default menu icons to use SVG and harvested some triangle SVG icons and CSS hackery, twiddled with it some more, and came up with this. Ouch. But it's working "well", and looking basically right on FF, Chrome and Safari:

(These screenshots are all from Chrome, but they look nearly identical in Safari and FF):

Initial state

Screenshot of available updates for both compatible and incompatible releases, initial state

Focus: Release notes

Screenshot of available updates for an incompatible release, focus on release notes link

Focus: 'Not compatible' details summary

(Hit tab once after above screenshot):
Screenshot of available updates for an incompatible release, focus on 'Not compatible' details summary

Focus: 'Not compatible' details summary, collapsed

(Hit space once after above screenshot):
Screenshot of available updates for an incompatible release, focus on 'Not compatible' details summary, after hitting spacebar to collapse the details

🎉🤦‍♂️🤞

I'm really not sure I'm the right person to try to get this working in Claro. If anyone else wants to run with that, please do! 🙏

Thanks,
-Derek

dww’s picture

Issue summary: View changes
Related issues: -#2405059: Update Drupal's default menu icons to use SVG

Now that I actually read all of #2980304: Seven theme's details/summary focus style is broken/missing in some browsers. and saw the solution in there, that's *WAY* better than #96. So much simpler. Tested #94 in here in combo with the latest patch over there and got this working with way less treachery and weirdness. Bumped that to RTBC. If we can land that one ASAP (a major bug in its own right), that'll simplify life in here considerably.

Thanks!
-Derek

dww’s picture

While clicking around on my local test site for this issue, I noticed:
#3113992: The 'Update' page has no idea that some updates are incompatible
:( That's *definitely* out of scope for this issue, but it's at least major, perhaps another critical blocker...

Sorry,
-Derek

dww’s picture

Issue summary: View changes
ckrina’s picture

StatusFileSize
new150.47 KB
new93.79 KB

Here's the definition of details in Claro: https://www.figma.com/file/OqWgzAluHtsOd5uwm1lubFeH/Drupal-Design-system..., and here an screenshot of the defined styles including hover.

Anyway, I'm afraid adding a box inside a box here might me too much visual noise, so I'd try to implement the details without the wrapper. Which is actually following the styles for action-link component (https://www.figma.com/file/OqWgzAluHtsOd5uwm1lubFeH/Drupal-Design-system...). Specifically, I'd use the Action link component on its small size (not sure if it's been implemented yet). You can see here all the defined states:

benjifisher’s picture

Issue summary: View changes
Status: Needs review » Needs work

I added #3114149: Update report should show whether suggested project versions are compatible with recommended core version in response to one of the to-do items mentioned in the list of Remaining tasks.

#60 and others referred to last week's usability meeting. Here is a link to the recording: Drupal Usability Meeting - 2020-02-13.

Re #89:

[I] didn't want to completely ignore @benjifisher's input on this point.

Thanks for the consideration, @dww, but you can take the results of the meeting to be definitive. I did say in #58 that I was aiming for "good enough". I cleaned up the corresponding item in the "Remaining tasks" list.

Another point where the consensus went against me: as I recall, we agreed to remove the Download link in the Incompatible case. I am setting the status to NW for that.

dww’s picture

@benjifisher: Thanks for opening that follow-up, and for the updates.

Re:

Another point where the consensus went against me: as I recall, we agreed to remove the Download link in the Incompatible case. I am setting the status to NW for that.

Ugh. :/ A) that "decision" wasn't indicated at all in #60 or later. We've gone back and forth on this a few times already. I really don't want to change it again. If we have to, okay, but I'd really rather not.

Thanks,
-Derek

tedbow’s picture

  1. re #101

    Another point where the consensus went against me: as I recall, we agreed to remove the Download link in the Incompatible case. I am setting the status to NW for that.

  2. #102

    Ugh. :/ A) that "decision" wasn't indicated at all in #60 or later.

    Sorry I didn't know that was new decision that was made on the call I remember discussing but in #60 I was trying only mention things that had not already been agreed to
    In the screenshots in the comments #26, #45, #54, and #55 the "Download" had already been removed from incompatible versions.

  3. Re adding the color indicator
    from the comments from @andrewmacpherson #91 and @rainbreaw(copied from slack) #93 it seems there is a lot to consider to when getting the use of color correct.
    Since this issue is already 103 comments long, it is critical, and it is very hard to follow with the 2 UX meetings and discussions on slack, could add the color in follow up. I don't think @andrewmacpherson or @rainbreaw have indicated that it is accessibility issue if we don't use color.
dww’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new22.63 KB
new2.59 KB
new106.27 KB
new107.16 KB

Re: #101 / #103.1: Okay, re-removed. New screenshots for the summary.

I'm interdiffing vs. #94 since I'm backing out the hacks in #96 for now in the hopes that we solve that via #2980304: Seven theme's details/summary focus style is broken/missing in some browsers. instead.

Re: #103.2: I've tried extremely hard to keep the summary of this monster issue up to date. I don't know what more I can do to make it easier to follow. Multiple folks in earlier iterations agreed that color would be nice. The UX team meeting had a superstitious fear of using color by not understanding the accessibility implications and dreading possible delay for an actual review. I spent the effort to research it myself, then ask the experts, then report the findings here. I also verified that the color (which we're already using on this page) has >7:1 contrast with both possible backgrounds. There's a lot to consider, but we've considered it, and it's already implemented and screenshot'ed for everyone to compare and confirm it's easier to scan than the all-grey alternative.

This is already a follow-up to a critical issue that was (IMHO) rushed in prematurely. I don't want to add yet-more-follow-ups for things that are already done, researched, and working. Let's get this as good as we can (short of a complete redesign of the report) and then we can be done, instead of making the issue spaghetti even more complex.

Finally, no one is saying it's an "accessibility issue if we don't use color", that's a totally unfair red herring of an argument. We're saying that using color to supplement the meaning of "Not compatible" helps the UI, and perhaps helps some users understand something's not right with a given update if they don't fully parse and digest all the text. Please don't put words in my mouth.

Thanks,
-Derek

Status: Needs review » Needs work

The last submitted patch, 104: 3102724-104.patch, failed testing. View results

dww’s picture

Whee, fun! ;) Now 4 tests are failing because they can't find their download link. :/ Can we reconsider this decision and just go back to #94? Or do we really want to sprinkle checks and knowledge about core compatibility and download links throughout all of our tests?

xjm’s picture

@dww, yes, I think it is totally appropriate for tests to provide test coverage asserting that there is no download link for an incompatible release. So we should flip the failing assertions or move them to a separate case, and explain why in the test.

Having the above failures is a good thing -- it means our tests are working as expected and now we don't have to do as much work to provide additional coverage.

tedbow’s picture

re #104

Finally, no one is saying it's an "accessibility issue if we don't use color", that's a totally unfair red herring of an argument. We're saying that using color to supplement the meaning of "Not compatible" helps the UI, and perhaps helps some users understand something's not right with a given update if they don't fully parse and digest all the text. Please don't put words in my mouth.

The reason I mentioned that is because if making the other changes in this issue with the details element and the message did cause an accessibility issue without the added color then we would have to do them at the same time. We could not add the color in a follow up.

If making the other changes in this issue with the details element and the message did not cause an accessibility issue without the added color then we would not have to do them at the same time. We could add the color in a follow up.

I do agree that adding the color will add value. I just it thought might be easier to do it in a follow-up. But I don't want to hold up this issue arguing to split this out to follow-up if others think we don't need to.

Please don't put words in my mouth.

That wasn't my intention. sorry.

xjm’s picture

An additional aspect WRT the color that we discussed in the UX meeting is that it has additional design implications in each core theme if we use a new color for it. There are already lots of pinks, reds, yellows, greens, gold, blues, etc. on the page. The screenshots are missing the other colored warnings that might appear. If we let the element inherit normal font color from the parent, we don't need to worry as much about the design implications in all four themes.

It's about scope management. A followup for the color is completely acceptable since the critical part of the issue is to remove the cognitive burden of repetitive text on the page. Design and accessibility improvements with color can be done in any minor release. On the other hand, this particular issue is a requirement for backporting a critical in the next patch release of 8.8, which we hope to create as soon as packaging is fixed, possibly within the next week.

bnjmnm’s picture

StatusFileSize
new2.22 KB
new21.18 KB

Based on the clarification in #108 and #109, it does seem like the color changes could potentially delay the completion of the critical parts of this critical issue. There's clearly no accessibility concerns with this approach, but I've seen many large rabbit holes appear as due to color changes. Since these are changes that don't absolutely need to be done in the scope of this issue, I created a followup to make those changes after this issue lands #3114707: Add color to summary element to improve UX of core compatibility info on available updates report.

I should also mention that I want to see these color changes implemented. Once this issue lands I'll make sure to be involved in the followup either as patcher or reviewer. It's a good idea with good rationale, and makes everything easier to ingest. It shouldn't be a neglected followup.

I still get tripped up on what exact changes can be done in which themes, but I assume since a release manager has stated that it's OK to make these changes in a separate issue then we can do it (please chime in if there's anything that would prevent the color changes from being applied to Stable or other core themes).

dww’s picture

Issue tags: +Needs screenshots

Re: #108-#110:

Okay, I'm clearly out numbered. ;) Following the follow-up-follow-up. Still a bit sad the color improvements aren't going to make it into the same releases as the other UI fixes here. I thought the scope here was "Improve usability of core compatibility ranges on available updates report", which thoughtful use of color aids.

Meanwhile, we need new screenshots. Based on prior experience, I suspect #110 didn't solve the color problem and necessarily get us ready to commit, but instead re-introduced the weirdness where the summary is blue in some cases and grey in others, like it was in #92:

https://www.drupal.org/files/issues/2020-02-15/3102724-92.seven-initial-...

I'm clearly getting burned out trying to land this issue, so I'll probably step back and let y'all run with it for a while.

Thanks/sorry,
-Derek

tedbow’s picture

Status: Needs work » Needs review
StatusFileSize
new19.17 KB
new40.04 KB
  1. Here is patch to fix the fails in \Drupal\Tests\update\Functional\UpdateContribTest::testNormalUpdateAvailable()
    The contrib releases now need to have <core_compatibility>^8</core_compatibility> and the test needs to set a version of Drupal core to be installed.
    That way the updates will be marked as compatible with the currently installed version of core
  2. for UpdateCoreTestfails I think the problem with is
    +++ b/core/modules/update/templates/update-version.html.twig
    @@ -21,18 +23,22 @@
    +        {% if version.core_compatible %}
    +          <li class="project-update__download-link">
    +            <a href="{{ version.download_link }}">{{ 'Download'|t }}</a>
    +          </li>
    +        {% endif %}
    

    This won't work for core updates. This will never be set.. So the links aren't showing up.

    So we should either just unset the download link. That might be a BC concern.
    Or we should just set a flag like version.show_download_link based on if it is core or version.core_compatible is not empty.

Status: Needs review » Needs work

The last submitted patch, 112: 3102724-111.patch, failed testing. View results

tedbow’s picture

Status: Needs work » Needs review
StatusFileSize
new4.82 KB
new42.94 KB

this should fix #112.2

Status: Needs review » Needs work

The last submitted patch, 114: 3102724-114.patch, failed testing. View results

tedbow’s picture

  1. #114 failed because we need to update the fixtures that Drupal\Tests\update\Functional\UpdateContribTest::testSecurityUpdateAvailability() uses with <core_compatibility>^8</core_compatibility>
  2. We need a test that link doesn't show up for incompatible releases
dww’s picture

Status: Needs work » Needs review
StatusFileSize
new40.42 KB
new3.81 KB
new6.21 KB

Instead of #114, this is both way simpler and the tests now mostly pass. Interdiffs relative to both #112 and #114.

However, I still get 1 fail for this:

1) Drupal\Tests\update\Functional\UpdateContribTest::testSecurityUpdateAvailability with data set "8.x-1.0, 8.x-1.2 8.x-2.2" ('8.x-1.0', array('8.x-1.2'), 'SECURITY_UPDATE_REQUIRED', 'sec.8.x-1.2_8.x-2.2')
Release http://example.com/aaa_update_test-8-x-1-2.tar.gz is a security download link.
Failed asserting that false is true.

/.../drupal-8_9/core/tests/Drupal/TestTools/PhpUnitCompatibility/PhpUnit6/TestCompatibilityTrait.php:18
/.../drupal-8_9/core/modules/update/tests/src/Functional/UpdateTestBase.php:158
/.../drupal-8_9/core/modules/update/tests/src/Functional/UpdateContribTest.php:613

Unfortunately, aaa_update_test.sec.8.x-1.2_8.x-2.2.xml is a tangled web of <core_compatibility> definitions, and given the lack of comments on the fixtures, I'm not sure that changing them is okay without breaking something else. I'll leave this one for @tedbow to sort out. But in short:

  • The test case says currently-installed core is 8.0.0.
  • The test is expecting to see a 8.x-2.2 security release with a download link.
  • In that fixture, the 8.x-2.2 release says: <core_compatibility>^8.1.1</core_compatibility>.

Something's gotta give. ;)

dww’s picture

Issue summary: View changes

Sorry, I missed #116 (x-post)

Re: #116.2: See remaining tasks for the point on "Add new tests". ;) We need more than "a test that link doesn't show up for incompatible releases"...

Generally, keeping such TODO items in the summary is way easier to track than having them sprinkled throughout all the comments. To that end, updated the Seven styles TODO items again after #110.

Thanks,
-Derek

Status: Needs review » Needs work

The last submitted patch, 117: 3102724-116.patch, failed testing. View results

dww’s picture

Status: Needs work » Needs review
StatusFileSize
new40.5 KB
new1.16 KB

Oh right, core/modules/update/tests/src/Unit/ProjectCoreCompatibilityTest.php
I still don't love how that test works, trying to do assertSame() as it does on entire arrays. But instead of adding the new flag to each expected case, we can just ignore this flag, too (since we'll have real tests for the presence/absence of the download links elsewhere).

Status: Needs review » Needs work

The last submitted patch, 120: 3102724-120.patch, failed testing. View results

dww’s picture

StatusFileSize
new130.93 KB
dww’s picture

Issue summary: View changes

Based on UX meeting today, we agreed to move getting Claro styles perfect to a follow-up: #3114910: Improve Claro styles for core compatibility details on available updates report
Screenshots in #122 are Good Enough(tm) to ship this one.
Removing more things from remaining tasks. :) Yay!

Cheers,
-Derek

dww’s picture

Issue summary: View changes

Re: CSS styles and how they work...

#3113992-10: The 'Update' page has no idea that some updates are incompatible shows we're going to want to re-use these custom <details> styles on the /admin/reports/updates/update form, too.

We should probably refactor the CSS and inject a special class directly into the details element so they can apply in both cases. Or something. ;) Awaiting feedback from @lauriii and/or others who are more how-core-handles-markup savvy than I am.

Thanks,
-Derek

lauriii’s picture

  1. +++ b/core/modules/update/src/ProjectCoreCompatibility.php
    @@ -131,12 +138,49 @@ public function setReleaseMessage(array &$project_data) {
    -        $release['core_compatibility_message'] = $this->createMessageFromCoreCompatibility($release['core_compatibility']);
    

    Since this is optional array item, it seems fine to remove it. However, should we still add this back in Stable so that themes that haven't updated update-version.html.twig template would remain intact? We should also add screenshots how this page would look like in themes that haven't updated the template.

  2. +++ b/core/modules/update/src/ProjectCoreCompatibility.php
    @@ -131,12 +138,49 @@ public function setReleaseMessage(array &$project_data) {
    +        $release['core_compatibility_details'] = $this->createCoreCompatibilityDetails($release['core_compatible'], $release['core_compatibility_range']);
    

    Could we rename this "compatibility_details"? The current key is describing how this is rendered, not what is being rendered. How this is being rendered should be allowed to change but what is being rendered should remain the same.

    Edit: Maybe this is referring to details about compatibility and I was making premature assumptions about the relation to HTML details element which is used for rendering this. If that is the case, it seems fine to use the name as it is.

  3. +++ b/core/modules/update/src/ProjectCoreCompatibility.php
    @@ -131,12 +138,49 @@ public function setReleaseMessage(array &$project_data) {
    +   * Creates core a compatibility details element.
    ...
    +   * @todo Should this be a twig template?
    ...
    +  protected function createCoreCompatibilityDetails($core_compatible, $core_compatibility_range) {
    +    return [
    +      '#type' => 'details',
    +      '#title' => $core_compatible ? $this->t('Compatible') : $this->t('Not compatible'),
    +      '#open' => !$core_compatible,
    +      'message' => [
    +        '#markup' => $core_compatibility_range,
    +      ],
    +      '#attributes' => [
    +        'class' => [
    +          $core_compatible ? 'compatible' : 'not-compatible',
    +        ],
    +      ],
    +    ];
    +  }
    

    I'm wondering if we want to be this opinionated about which element this is rendered with? It seems like it would make sense to have a template for this which would render details element from a title, message and whether the release is compatible or not.

  4. +++ b/core/themes/claro/templates/admin/update-version.html.twig
    --- a/core/themes/stable/css/update/update.admin.theme.css
    +++ b/core/themes/stable/css/update/update.admin.theme.css
    

    The CSS additions seem quite opinionated and should probably be in a theme instead. However, it seems like this is already the case with this file. It seems pragmatic to just add these new rules to this file.

  5. +++ b/core/themes/stable/templates/admin/update-version.html.twig
    @@ -11,6 +11,9 @@
    + *   - core_compatible (bool): Is it compatible with the installed core or not?
    + *   - core_compatibility_details: Render array of core compatibility details.
    + *   - hide_download_link (bool|NULL): Should the download link be hidden?
    

    Nit 🔬👁: we don't usually document types like this in templates because there's no actual guarantees that the types would actually be these. For booleans, we usually say something along the lines of "A flag indicating whether the release is compatible with the installer core or not.". For render arrays, we usually just say something along the lines of "The core compatibility details".

tedbow’s picture

Assigned: Unassigned » tedbow

Assigning to myself to work on some of #125

tedbow’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new12.81 KB
new37.59 KB

This addresses #125. I am leaving this assigned to myself as I am working on the test failure in #120

  1. Add a todo to the remaining tasks for adding screenshots for unchanged templates.
  2. Considering 3) I talked with @lauriii and we agreed we can just add the details element directly to the templates. This allows simplify this class again because it again can just set message.

    This allows not setting the details element in the class and for themes to choose a different html element if they want.
    It allows removing the hide_download_link flag.
    So now that class is less tied directly to the report output and can also get back to 100% unit test coverage.

  3. see 2)
  4. confirmed with @lauriii that there is no changes needed for this.
  5. because of 2) we don't need some this. Updated the comments.

Status: Needs review » Needs work

The last submitted patch, 127: 3102724-127.patch, failed testing. View results

tedbow’s picture

Status: Needs work » Needs review
StatusFileSize
new10.11 KB
new44.54 KB
  1. +++ b/core/modules/update/templates/update-version.html.twig
    @@ -21,18 +23,24 @@
    +            <details open="{{ not version.core_compatible }}">
    

    This doesn't work for setting it to open.

    Fixed this and added test coverage.

    Also it no longer has the "Compatible"/"Incompatible" title.
    Added that back and added test coverage for:

    • "Compatible"/"Incompatible" text for details title
    • The download link being removed for incompatible updates
    • the details elements being open for incompatible releases and closed for compatible
  2. +++ b/core/modules/update/tests/modules/update_test/aaa_update_test.2_0.xml
    --- a/core/modules/update/tests/src/Functional/UpdateContribTest.php
    +++ b/core/modules/update/tests/src/Functional/UpdateContribTest.php
    
    +++ b/core/modules/update/tests/src/Functional/UpdateContribTest.php
    @@ -247,6 +247,9 @@ public function testNormalUpdateAvailable() {
    +      '#all' => [
    +        'version' => '8.0.0',
    +      ],
    

    re the problem @dww mention in #117 regarding test failures in \Drupal\Tests\update\Functional\UpdateContribTest::testSecurityUpdateAvailability()

    I think a good way to solve this is not to reuse the fixture for that test in \Drupal\Tests\update\Functional\UpdateContribTest::testCoreCompatibilityMessage().

    I made of copy of core/modules/update/tests/modules/update_test/aaa_update_test.sec.8.x-2.2_1.x_secure.xml which we reused for this new test and created
    core/modules/update/tests/modules/update_test/aaa_update_test.core_compatibility.8.x-1.2_8.x-2.2.xml for this new testCoreCompatibilityMessage()

    then I removed the changes we made to aaa_update_test.sec.8.x-2.2_1.x_secure.xml in #3074993: Use "current" in update URLs instead of CORE_COMPATIBILITY to retrieve all future updates which just to add core_compatibility values which weren't used in testSecurityUpdateAvailability()

tedbow’s picture

StatusFileSize
new4.56 KB
new44.56 KB
  1. +++ b/core/modules/update/src/ProjectCoreCompatibility.php
    @@ -7,12 +7,19 @@
    +   * The currently-installed version of Drupal core on this site.
    

    Should be "currently installed" no dash. Also don't need "on this site"

  2. +++ b/core/modules/update/templates/update-version.html.twig
    @@ -11,6 +11,8 @@
    + *   - core_compatible: A flag indicating whether the release is with the installed core or not?
    

    left out "compatible" here

  3. +++ b/core/modules/update/tests/src/Functional/UpdateContribTest.php
    @@ -715,13 +718,34 @@ public function securityUpdateAvailabilityProvider() {
    +      // If an update is compatible with the installed version of Drupal
    +      // core it should have a download link and the details element
    +      // should not be open by default.
    ...
    +      // If an update is not compatible with the installed version of Drupal
    +      // core it should not have a download link and the details element
    +      // should be open by default.
    

    Fixed comment wrapping

tedbow’s picture

Issue summary: View changes
StatusFileSize
new117.11 KB
new117.41 KB
new101.19 KB
  1. Update remain tasks. I think all remaining under "Fix styling " besides reviews, rtbc, etc
  2. Added screenshots. Also added ones with no template changes
tedbow’s picture

Issue summary: View changes

Added a note to the summary that very few themes are overridden this template.

See http://grep.xnddx.ru/search?text=version&filename=update-version.html.twig

tedbow’s picture

Assigned: tedbow » Unassigned

Unassigning myself. Think this is ready for reviews.

I will keep an eye on this to address reviews but also feel free to ping me in slack

tedbow’s picture

Issue summary: View changes

Moved and simplified manual testing instructions to new heading
"Manual Testing: How to"

dww’s picture

Issue summary: View changes
Status: Needs review » Needs work

@tedbow: Thanks for moving this forward, adding tests, etc.

My concerns with the new approaches:

  1. The #type => 'details' render element does more than spit out <details><summary>. Apparently IE11 doesn't support <details> properly (https://www.caniuse.com/#feat=details), so there's a JS polyfill that gets injected. Also some aria-related stuff. So doing this directly in the template means we lose all this goodness, and either none of this will work and be accessible on some browsers, or we have to duplicate all the stuff the render element does for us. I'm strongly in favor of going back to letting the render element do its thing and not having to worry about any of that here.

    andrewmacpherson 4 days ago
    So long as <details> is being added via Render Element API, then our polyfills get added automatically.

  2. This is no longer as easy to share/reuse for #3113992: The 'Update' page has no idea that some updates are incompatible (which is also a blocking critical).
  3. It seems like we have a lot of business logic directly in the twig templates now, which seems off to me (but maybe that's old thinking, and this is now The Right Way(tm) to do things?).
  4. I still think the CSS (I wrote) is totally whack. ;) I suspect we don't need any of it in the module and stable at all, and instead, we should do some Seven-specific CSS (that we can easily re-use at #3113992) to clobber Seven's default details styles. Claro is on its own with a separate issue. The module / stable markup/CSS doesn't have to care what this looks like. I was just hacking at trying to get Seven to look decent.

Also, fixed a critical typo in one of the summary updates: s/The details is not in the/The details is now in the/ ;)

tedbow’s picture

Assigned: Unassigned » tedbow

@dww thanks for the feedback
Assigning back to myself to address 1 and 2. You maybe right about 3 also.

dww’s picture

@tedbow: Thanks for working on this. While you're re-rolling, please restore "Not compatible" as the title for the details in that case, instead of "Incompatible". "Not compatible" is what the #ux team agreed to, and I don't want to silently change it out from under them...

Thanks again!
-Derek

tedbow’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs screenshots
StatusFileSize
new8.95 KB
new45.12 KB
new121.86 KB
new121.2 KB

addressing #135

  1. Changed back to details. But added via template_preprocess_update_version. Personally like this better because it keeps the ProjectCoreCompatibility 100% tested and separate from the report logic and keeps all the output related to the report in update.report.inc

    Also it avoids putting the html details element in the $project_data array so that non-core callers of won't this and possibly use it. So less place to worry about BC.

  2. I talked with @dww after this and we might not want to reuse this in #3113992: The 'Update' page has no idea that some updates are incompatible. In that use case we probably only need this message when for in compatible modules, so we only need the message.
  3. I agree with this. Using template_preprocess_update_version removes the logic from the twig file
  4. I didn't address the CSS in this patch

    I still think the CSS (I wrote) is totally whack. ;)

    I figure replacing @dww's whack css(I haven't confirmed it's whackness) with my whack CSS won't help. 😜

re #137

  1. fixed.
  2. updated the screenshots
tedbow’s picture

Assigned: tedbow » Unassigned
dww’s picture

Assigned: Unassigned » dww
Issue summary: View changes
Status: Needs review » Needs work

Re: #137: Fantastic! That all looks much better. 100% agree with doing the details render array in template_preprocess_update_version().

Assigning to myself to take a stab at non-whack CSS. ;)

Also updated remaining tasks and fixed some formatting bugs in the summary.

Thanks,
-Derek

dww’s picture

Assigned: dww » Unassigned
Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs tests +Needs frontend framework manager review
StatusFileSize
new48.46 KB
new11.59 KB
new3.78 KB
new107.15 KB
new107.69 KB
new145.66 KB
new100.32 KB

This seems a lot cleaner and better. Now the "opinionated" CSS lives in Seven, and the Update module and stable can be "agnostic". ;)

Makes it less delightful for Claro initially, but that's for #3114910: Improve Claro styles for core compatibility details on available updates report to sort out (and arguably, it'll be easier to do properly there without anything in Updates's CSS to get in the way):

Screenshot of available updates report with Claro as admin theme

Also attaching a screenshot of Stark (not that it really matters).

interdiff continues to be confused about all the changes to the test fixtures. :( So I'm also attaching the commit I made locally vs #138 (which is a more accurate diff between the two patches).

Nearly there! ;)

We now have all the tests we need, so removing that tag.

Summary of actually remaining tasks:

A) Fix focus styles (need to decide #96 vs. #2980304: Seven theme's details/summary focus style is broken/missing in some browsers.)

B) Fix hover styles (awaiting outcome of focus style implementation) -- maybe it doesn't matter for now?

C) Markup and CSS re-review (we've changed a lot of that since the initial review). Re-tagging for front end framework maintainer.

D) Code / implementation review (not sure who's going to do this, but it probably shouldn't be @tedbow or myself).

E) Manual testing

F) RTBC

Thanks,
-Derek

dww’s picture

Issue summary: View changes

Fixing screenshot embed in the summary, other minor tweaks.

dww’s picture

StatusFileSize
new50.47 KB
new1.72 KB
new126.96 KB
new126.24 KB

So as not to leave Claro in a yucky state for too long, here's an initial set of styles to basically restore what we had as of #122. Still not a complete solution, leaving that for #3114910: Improve Claro styles for core compatibility details on available updates report, but at least if that gets delayed/forgotten, things aren't too bad in the meanwhile.

Claro initial

Screenshot of available updates report with Claro as admin theme, initial state

Claro toggle both

Screenshot of available updates report with Claro as admin theme, after clicking on both details summaries

benjifisher’s picture

Status: Needs review » Needs work

The patch in #143 still contains the hacks to drupalci.yml.

benjifisher’s picture

Can you save me the trouble of reading through the comments and say again why we have things like

+++ b/core/modules/update/tests/modules/update_test/aaa_update_test.2_0.xml
@@ -22,6 +22,7 @@
       <term><name>Release type</name><value>New features</value></term>
       <term><name>Release type</name><value>Bug fixes</value></term>
     </terms>
+    <core_compatibility>^8</core_compatibility>
   </release>

and

+++ b/core/modules/update/tests/modules/update_test/aaa_update_test.sec.8.x-1.2_8.x-2.2.xml
@@ -30,7 +30,6 @@
    <name>aaa_update_test 8.x-3.0-beta1</name>
    <version>8.x-3.0-beta1</version>
    <tag>8.x-3.0-beta1</tag>
-   <core_compatibility>^8.1.1</core_compatibility>
    <status>published</status>
    <release_link>http://example.com/aaa_update_test-8-x-3-0-beta1</release_link>
    <download_link>http://example.com/aaa_update_test--8-x-3-0-beta1.tar.gz</download_link>
dww’s picture

Issue summary: View changes
Status: Needs work » Needs review

@benjifisher: Thanks for reviewing!

Re: #144: That's intentional. Until at least A-D from #141 are done, running the full test suite on every new patch in here just wastes time and DA $ for useless bot cycles. Added an explicit remaining step about it so we remove that in the right order.

Re: #145: The key comments to read for this would be #117 and #129.2. In short:

  1. We need <core_compatibility> in the release history XML to trigger any of this.
  2. We sometimes reuse the same XML test fixture for different test cases.
  3. Previously, the only tests that cared if your currently installed core is compatible with the releases in the fixture or not were the ones that were added in the parent issue to test the formatting of this compatibility range message in all sorts of twisted scenarios to try to cover every edge case.
  4. Now, incompatible or not will also change the markup of the report by removing the download link.
  5. Tests that are expecting to find a download link must use fixtures that say they're compatible with the installed version of core.
  6. So in #129, @tedbow writes/implements:

    I think a good way to solve this is not to reuse the fixture for that test in \Drupal\Tests\update\Functional\UpdateContribTest::testCoreCompatibilityMessage().

Cheers,
-Derek

tedbow’s picture

StatusFileSize
new24.81 KB
new26.73 KB

ok x-posting again with @dww. Saw his comment after I wrote most of . don't agree with anything he said but have a couple changes I think we should make.

  1. reverted drupalci.yml

    we can add it back if this patch needs a bunch more changes.

  2. re changes to aaa_update_test.sec.8.x-1.2_8.x-2.2.xml
    In #3096078: Display core compatibility ranges for available module updates we added <core_compatibility>^8.1.1</core_compatibility> to this fixture so we could reuse this fixture for the new test we were adding, \Drupal\Tests\update\Functional\UpdateContribTest::testCoreCompatibilityMessage().

    This was fine when core_compatibility wasn't having the side effect of hiding or showing the download link based on the current installed(mocked). But now with this issue hiding/showing the link, it breaks \Drupal\Tests\update\Functional\UpdateContribTest::testSecurityUpdateAvailability() which was the original test that used this fixture because it always checks for the download link.

    So instead of making testSecurityUpdateAvailability() more complicated to take this into account I just duplicated this fixture into aaa_update_test.core_compatibility.8.x-1.2_8.x-2.2.xml which keeps core_compatibility.
    The testSecurityUpdateAvailability() test doesn't actually need core_compatibility to be set because if it is not the compatibility message logic won't run and the download links will just show. This is already true for all the other fixtures that testSecurityUpdateAvailability() uses so I don't think it is issue remove it from 1 of it's fixture.

    Looking at the new fixture aaa_update_test.core_compatibility.8.x-1.2_8.x-2.2.xml there are releases in there it does not need. Removing those.

  3. re changes to aaa_update_test.2_0.xml and other aaa_update_*.xml with additions if core_compatibility to the XML.

    I think actually we don't need these changes. We may have needed this to be set in earlier versions of this patch but now it works without these changes. Just none of the new logic will run if it is not set. I think this is fine because \Drupal\Tests\update\Functional\UpdateContribTest::testCoreCompatibilityMessage() tests this fully.

    I added a note to #3110917: [meta] Fix update XML fixtures bad data to decide if we need this for all contrib xml fixtures.

  4. 🎉 These 2 changes half the size of this patch
dww’s picture

Issue summary: View changes
Issue tags: +Needs followup

Everything under both "Improve implementation" and "Add new tests" is now done, so crossing both of those off from remaining tasks...

Re: #147: Ooof. ;) Well, we won't know if the test changes you wrote are working for another hour or so. Therefore, I think reverting the change to drupalci.yml was premature. :P

But yes, hopefully the fixture dance is an improvement. I again wish we had legit comments for each fixture so it's easier for *anyone* other than you to actually make sense of the update tests right now. ;) Where's that follow-up? Is that supposed to be in #3110917: [meta] Fix update XML fixtures bad data or is there (going to be?) another one dedicated to the comments?

Thanks,
-Derek

dww’s picture

Issue tags: -Needs followup

@tedbow posted #3115435: Make clear why each XML update.module fixture is created the way it is -- thanks! This no longer needs a follow-up.

Glad to see the tests are still passing in #147!

Given that we've started documenting fixtures for #3113292: Update module has no tests for changes to status of the installed release (revoked, etc), I think we could already add comments to fixtures/tests in here, and not wait for #3115435. At least for the new fixtures added here. But that's a stretch goal, and we could commit this basically as-is.

benjifisher’s picture

Re: #146

Thanks for reviewing!

@dww, you are very generous. That was more like a pre-review. I just skimmed the patch to get an idea of the scope.

Re: #147

  • "don't agree with anything [@dww] said" ... is that what you meant to say?
  • (4) "These 2 changes half the size of this patch": I thought that might happen. There were a lot of lines of context for all those changes to the fixtures.

I will start the real review now. I might not finish until tomorrow AM.

benjifisher’s picture

Issue summary: View changes
Status: Needs review » Needs work

I tested the patch manually, with the Seven theme. It works as expected, matching the screenshots. I crossed this off in the list of Remaining tasks, along with the item for removing the changes to drupalci.yml.

I have not yet looked at the changes to the tests. I will try to get to that tomorrow.

I did not look too closely at the new CSS rules.

The code looks pretty solid. I just have a couple of comments and a few suggestions for improving the readability.

  1.   +++ b/core/modules/update/src/ProjectCoreCompatibility.php
      @@ -7,12 +7,19 @@
       use Drupal\Core\StringTranslation\StringTranslationTrait;
    
       /**
      - * Utility class to set core compatibility messages for module updates.
      + * Utility class to set core compatibility messages for project releases.

    Is this in scope? I will not complain if this change stays in.

  2.   +  /**
      +   * The currently installed version of Drupal core.
      +   *
      +   * @var string
      +   */
      +  protected $existingCoreVersion;

    At first, it seems we are adding the property, setting it in the constructor, and then using it in only two functions. The point is that setReleaseMessage() is a public function called from outside this class, and it needs some way to access this value when it calls the new function isCoreCompatible().

  3. Do we have any standards for the order of functions in a class? Maybe not. Since isCoreCompatible() is used before createMessageFromCoreCompatibility(), I would define isCoreCompatible() first. It seems a little odd to put it between createMessageFromCoreCompatibility() and its helper function getCompatibilityRanges().

  4.   +++ b/core/modules/update/update.report.inc
      @@ -101,6 +101,37 @@ function template_preprocess_update_report(&$variables) {
      ...
      +  $variables['show_download_link'] = !isset($version['core_compatible']) || $version['core_compatible'] === TRUE;

    Thank you for not using the pattern $var = (some condition) ? TRUE : FALSE! (Can I call that an anti-pattern?) Can we remove === TRUE? Even better, your use of the null coalescing operator two lines down suggests an alternative: $variables['show_download_link'] = $version['core_compatible'] ?? TRUE;.

  5. Ideally, the details element would expand into the empty space in the row below it when opened, but that seems really hard to do in a reliable way.

  6.   +++ b/core/modules/update/update.report.inc
      @@ -101,6 +101,37 @@ function template_preprocess_update_report(&$variables) {
      ...
      +function template_preprocess_update_version(array &$variables) {
      ...
      +  $core_compatibility_message = $version['core_compatibility_message'] ?? NULL;
      +  if ($core_compatibility_message) {

    I suggest removing the variable $core_compatibility_message and exiting early, unless you anticipate that this function will be expanded. That is,

      if (!isset($version['core_compatibility_message'])) {
        return;
      }
      $variables['core_compatibility_details'] = [
        // ...
        'message' => [
          '#markup' => $version['core_compatibility_message'],
  7. I notice that this patch removes the lines

     {% if version.core_compatibility_message %}
       <span class="project-update__core-compatibility-message">{{ version.core_compatibility_message }}</span>
     {% endif %}

from the three Twig templates, so it no longer matters that the property core_compatibility_message was never documented in the comments at the top of these templates.

dww’s picture

Thanks for the real review, this time. ;)

Won't re-roll until you finish, but a few quick replies to #151:

1. I think it's in scope, b/c part of the scope of this is what you just added to the summary:
* Shorten the text from "This module is compatible with Drupal core:" to "Requires Drupal core:"
The code used to be (wrongly) written as if this stuff only applies to modules. It works for themes, too. So I wanted to fix the code comments to match the reality as we first changed that message to "This release requires Drupal core..." and then eventually "Requires ...". I'm honestly afraid everything's not going to get backported correctly already, and if we spin off follow-up-follow-up-follow-ups for little crap like this, I think we'll all lose our stuff. ;)

2. Yup. Is there a concern here, or you're just documenting your findings?

3. No such standard that I know of. But sure, re-ordering it seems fine to me.

4. Oooh, I like $variables['show_download_link'] = $version['core_compatible'] ?? TRUE; for this -- nice one!

5. Yeah, I ran into CSS hell at various screen sizes without all this:

.project-update__compatibility-details details[open] {
  overflow: visible;
  height: auto;
  white-space: normal;
}

Stuff was crashing into things in yucky ways, so I figured it was safer to let the open details push everything else out of the way.

6. I'm sort of indifferent. I like early return to avoid indenting, but I like not assuming this is the only thing this function will ever do. I suppose we can add the indenting later if we decide to remove the early return. So sure, seems like a win.

7. Again, you're just documenting findings, right? I'm a big fan of accurate docs on twig templates, something we're not super consistent about in Drupal, so I tend to try to document everything I touch as I'm making changes. /shrug

So 3, 4 and 6 are the only action items, right?

Thanks,
-Derek

tedbow’s picture

@benjifisher thanks point this out in #147

don't agree with anything he said but have a couple changes I think we should make.

I meant to say "don't DISagree with anything he said" (he being @dww in #146

tedbow’s picture

Assigned: Unassigned » tedbow

Assigning to address #151 @benjifisher thanks for the review.

tedbow’s picture

Assigned: tedbow » Unassigned
StatusFileSize
new3.34 KB
new28.77 KB
  1. On the fence about this. If we get push back from a committer I think we just remove it.
  2. yep
  3. moved the function
  4. good catch. fixed
  5. Not sure
  6. I used
    if (empty($version['core_compatibility_message'])) {
        return;
      }
    

    It is not likely it will be set and be empty but if is(an alter?) we should not show the details either.

re @dww in #152

Won't re-roll until you finish, but a few quick replies to

Sorry I didn't see this until I had made the patch. I looked through your comments and I think we are in agreement.

Anyways I think @benjifisher has preference for smaller interdiffs so here is the patch.

tedbow’s picture

Status: Needs work » Needs review
benjifisher’s picture

Issue summary: View changes
Status: Needs review » Needs work

@dww, @tedbow:

Thanks for the feedback and changes in #152-#155.

From #152:

So 3, 4 and 6 are the only action items, right?

Right. Do you want me to be more explicit about action items vs. comments/documentation and suggestions vs. "required" changes? I have already written the points below, and they are not any more explicit than my review in #151.

Just two things on the changes between the two most recent patches:

  • The latest patch reintroduces the hacks to core/drupalci.yml. I will update that item in the IS.
  • re #151.6: the change looks good except that you forgot to remove the variable $core_compatibility_message, which is now unused.

Now for some comments on the tests.

  1.   +++ b/core/modules/update/tests/src/Functional/UpdateContribTest.php
      @@ -247,6 +247,9 @@ public function testNormalUpdateAvailable() {
           ...
           $system_info = [
      +      '#all' => [
      +        'version' => '8.0.0',
      +      ],

    I am not sure what the effect of this change is. I tried removing these lines and running the test: no failures. Is this another change that was needed in earlier versions of the patch?

  2.   @@ -715,13 +718,34 @@ public function securityUpdateAvailabilityProvider() {
          *   The expected core compatibility range.
          * @param string $expected_release_title
          *   The expected release title.
      +   * @param bool $is_compatible
      +   *   If the update is compatible with the installed version of Drupal.
          */
      -  protected function assertCoreCompatibilityMessage($version, $expected_compatibility_range, $expected_release_title) {
      +  protected function assertCoreCompatibilityMessage($version, $expected_compatibility_range, $expected_release_title, $is_compatible = TRUE) {
           $link = $this->getSession()->getPage()->findLink($version);
           $update_info_element = $link->getParent();
      -    $this->assertContains("This module is compatible with Drupal core: $expected_compatibility_range", $update_info_element->getText());
      +    $update_compatibility_details_element = $update_info_element->getParent()->find('css', '.project-update__compatibility-details details');
      +    $this->assertContains("Requires Drupal core: $expected_compatibility_range", $update_compatibility_details_element->getText());

    There are a few things I do not like about this function. I think the most significant is $update_info_element = $link->getParent() and that every reference to this variable includes another ->getParent(). Let’s get rid of both of these variables and just declare the one we actually want, currently $link->getParent()->getParent().

  3. Closely related, ->getParent()->getParent() is pretty fragile. I checked locally with the Stark theme, and I think we end up selecting <div class="clearfix"> inside <div class="project-update__version--recommended project-update__version">. I do not see any other methods on Behat\Mink\Element\NodeElement for going upwards in the DOM, so maybe it is not worth fixing unless we can come up with something simpler than this:

     $update_info = array_filter(
       $this->getSession()->getPage()->findAll('css', '.project-update__version'),
       function($node) use ($version) {
         return $node->hasLink($version);
       });
     $this->assertCount(1, $update_info);
     $update_info = reset($update_info);

    and then use $update_info everywhere we previously had $update_info_element->getParent(). You can choose a different name for the variable if you do not like $update_info.

  4. Still on the same function, some of the lines are very long. There are some exceptions, but we do have a coding standard to keep most lines of code to 80 characters or less. Please do something about this, at least for the longest lines. You can put function arguments on separate lines, as I did for array_filter() in the snippet above, and you can break a line before -> for a method call. Shortening variable will help a little: consider changing $update_compatibility_details_element and $expected_compatibility_range to something like $compatibility_details and $expected_range, for example.

  5. Still in the same function:

     // If an update is compatible with the installed version of Drupal core it
     // should have a download link and the details element should not be open
     // by default.

    and

     // If an update is not compatible with the installed version of Drupal
     // core it should not have a download link and the details element should
     // be open by default.

    There should be a comma after the "If" clause (i.e., after "version of Drupal core"). I am not sure about "not be open": my first thought is to replace it with "be closed", but maybe that would be harder for non English speakers.

  6.   +++ b/core/modules/update/tests/modules/update_test/aaa_update_test.sec.8.x-1.2_8.x-2.2.xml
      @@ -30,7 +30,6 @@
          ...
      -   <core_compatibility>^8.1.1</core_compatibility>
          ...
      -   <core_compatibility>^8.1.1</core_compatibility>
          ...
      -   <core_compatibility>^8.1.1</core_compatibility>

    Thanks for the explanations in #146 and #147. I see that this hunk is reverting changes to this fixture added in #3096078: Display core compatibility ranges for available module updates.

  7.  +++ b/core/modules/update/tests/src/Unit/ProjectCoreCompatibilityTest.php
     @@ -72,22 +72,26 @@ public function providerSetProjectCoreCompatibilityRanges() {
            'expected_releases' => [
              '1.0.1' => [
                'core_compatibility' => '8.x',
     -          'core_compatibility_message' => 'This module is compatible with Drupal core: 8.8.0 to 8.9.2',
     +          'core_compatible' => TRUE,
     +          'core_compatibility_message' => 'Requires Drupal core: 8.8.0 to 8.9.2',

    My only suggestion here is that we add a comment to testSetProjectCoreCompatibilityRanges() that setReleaseMessage() adds these two keys to the $project_data array.

tedbow’s picture

Status: Needs work » Needs review
StatusFileSize
new5.92 KB
new30.47 KB

@benjifisher thanks for the review

  1. Yep this is not need now. It had to do with making sure the compatiblity messages were set so the download links weren't removed.
    Now if core compatiblity can't be determined, in this case because Drupal core updates can't determined because the installed release is not set, the new logic is skipped.
  2. I remember we another need to find a specific update page element in \Drupal\Tests\update\Functional\UpdateTestBase::assertVersionUpdateLinks in that case we found it by label, like "recommend update", and then check for the link within it.

    I refactored that out to \Drupal\Tests\update\Functional\UpdateTestBase::findUpdateElementByLabel() so we can use it here. So once we have the update element with "Recommended" we make sure we have the link to the version, the details and the download link if we should.

  3. 3) fixed this
  4. I shortened the variable names. Also now we don't have ->getParent(). That fixed most of the long lines. I manually fixed another.

    I don't think we should change lines like
    $compatibility_details = $update_element->find('css', '.project-update__compatibility-details details');
    because that is pretty standard and readable

  5. added the commas and changed to "be closed". I think this is clearer
  6. I don't think this is inscope here. core_compatibility_message was already in this array and set by setReleaseMessage() without a comment. Also since we are testing a class with only 1 public method I don't think it is needed.
xjm’s picture

I keep forgetting to mention here that #2980304: Seven theme's details/summary focus style is broken/missing in some browsers. is a major bug, but an existing one. Since this issue does not significantly expand where the bug is exposed nor expose it on any content author path, I don't think it should be blocked on the focus fix. (That said, if we do get it resolved, that would be really good.)

lauriii’s picture

  1. +++ b/core/themes/claro/claro.theme
    @@ -1414,3 +1414,16 @@ function claro_views_pre_render(ViewExecutable $view) {
    +function claro_preprocess_update_version(array &$variables) {
    +  $variables['#attached']['library'][] =  'claro/update-report';
    +}
    
    +++ b/core/themes/seven/seven.theme
    @@ -374,3 +374,16 @@ function seven_views_pre_render(ViewExecutable $view) {
    +function seven_preprocess_update_version(array &$variables) {
    ...
    +}
    

    Why not attach this in the template with {{ attach_library() }}?

  2. +++ b/core/themes/claro/claro.theme
    --- /dev/null
    +++ b/core/themes/claro/css/theme/update-report.css
    

    Any thoughts on not shipping this CSS in Claro? We could let the details element render with the default styles. We could add better styles in #3114910: Improve Claro styles for core compatibility details on available updates report or #3072770: Available updates page.

    If we decide to use this we should use PostCSS because this is in Claro. We should also override the hover effect. Also the focus effect could be improved. We should also test this in high contrast browsers.

  3. +++ b/core/modules/update/templates/update-version.html.twig
    @@ -6,6 +6,8 @@
      * - version:  A list of data about the latest released version, containing:
    
    +++ b/core/themes/stable/templates/admin/update-version.html.twig
    @@ -6,6 +6,8 @@
      * - version:  A list of data about the latest released version, containing:
    

    We should mention the new core_compatible item here.

tedbow’s picture

@lauriii thanks for the review!

  1. I fixed this for the Claro but Seven doesn't have the update-version.html.twig file should we make the template just to attach the library?
    UPDATE: chatted with @lauriii about this he agreed we can leave this since there is no template.
  2. Ok now removing this for claro. I agree it would be better to look at the whole report in #3114910: Improve Claro styles for core compatibility details on available updates report
  3. Fixed and added the new core_compatibility_message item
benjifisher’s picture

Thanks for the updates, @tedbow! This patch addresses all the points I made in #157, except for #157.7, which you consider out of scope (#158.6).

I am setting the status to NW for the points below and for #160. Can we remove the "needs frontend framework manager review" tag now that we have that comment?

  1.   +++ b/core/modules/update/tests/src/Functional/UpdateTestBase.php
      @@ -195,7 +195,8 @@ protected function assertSecurityUpdates($project_path_part, array $expected_sec
          */
         protected function assertVersionUpdateLinks($label, $version, $download_version = NULL) {
           $download_version = $download_version ?? $version;
      -    $update_element = $this->getSession()->getPage()->find('css', $this->updateTableLocator . " .project-update__version:contains(\"$label\")");
      +    $update_element = $this->findUpdateElementByLabel($label);
      +    $this->assertNotEmpty($update_element, 'The update element exists.');

    Arguably, this is out of scope, but I think it makes sense to use the new helper function. I vote for keeping this change.

  2.   +++ b/core/modules/update/tests/src/Functional/UpdateTestBase.php
      @@ -274,4 +275,25 @@ protected function assertUpdateTableElementContains($text) {
      +  /**
      +   * Finds an update page element by label.
      +
      +   * @param string $label
      +   *   The label for the update, for example "Recommended version:" or
      +   *   "Latest version:".
      +   *
      +   * @return \Behat\Mink\Element\NodeElement|null
      +   *   The update element if found, otherwise NULL.
      +   */
      +  protected function findUpdateElementByLabel($label) {
      +    $update_elements = $this->getSession()
      +      ->getPage()
      +      ->findAll('css', $this->updateTableLocator . " .project-update__version:contains(\"$label\")");
      +    if (empty($update_elements)) {
      +      return NULL;
      +    }
      +    $this->assertCount(1, $update_elements);
      +    return $update_elements[0];
      +  }

    There is a lot to say about this function, but let’s start with an easy comment: the second line of the doc block is missing a * (comment leader).

  3. It is a little inconsistent to have ->getPage() on its own line but not ->getSession(). I will not insist, but I would prefer $this->getSession()->getPage() or (for consistency) each method call on a separate line.

  4. Using :contains in the CSS selector is much simpler than my original suggestion. :+1:

  5. Why return NULL? If we remove those three lines (the if block) then, when there are no results, the test will stop on the assertCount() (unless I am confused about how assertions work). As is, the calling function is responsible for checking with assertNotEmpty(), which I consider a drawback. It does mean that the calling function can give a more informative error message, but I do not think that outweighs the additional burden.

  6. If you agree with the previous point, then make sure to remove the assertNotEmpty() lines from both uses of findUpdateElementByLabel(): earlier in this file and in UpdateContribTest.php. And remember to update the @return comment.

benjifisher’s picture

Status: Needs review » Needs work

Oops. NW

lauriii’s picture

I think we can remove the needs FEFM review tag. ✌️

tedbow’s picture

Status: Needs work » Needs review
StatusFileSize
new2.59 KB
new30.21 KB

re #162

  1. 👍
  2. fixed
  3. fixed
  4. 👍
  5. My thought was that you could use this new function to confirm that update with a given label was not present.
    Such as
    $this->assertEmpty($this->findUpdateElementByLabel('Recommended update:'));
    and to keep it more like \Behat\Mink\Element\Element::find()
    But maybe I was overthinking it. We already are using:
    $assert_session->elementTextNotContains('css', $this->updateTableLocator, 'Recommended version:');
    in multiple places which works fine.

    fixing

  6. done
benjifisher’s picture

Status: Needs review » Needs work

@tebow, thanks for addressing the points in #162. I am satisfied there.

Sorry for not noticing this earlier, but

  1. Wrap @file comments to 80 characters in all three Twig templates (Update module, Stable, Claro).
  2. Add @see template_preprocess_update_version() comments to those templates.

Maybe also add a new screenshot for Claro to help with the final review.

Maybe it is time to remove the changes to drupalci.yml again. I will follow up this comment with some updates to the "Remaining tasks".

I am not sure what the policy is for templates in the Stable theme. I notice that the @file comments have minor differences: "Theme override" instead of "Default theme implementation" and no "@ingroup themeable". I checked a few other templates, and that seems to be the standard.

I did not notice #161 when I was writing the review in #162. For the record, the decision implemented there (in response to #160) was

  • Keep the template in the Claro theme.
  • Remove the CSS (the actual CSS file, change to .libraries.yml, preprocess function) from Claro. In other words, the only change to Claro in this patch is the template.
  • Keep the changes to Seven from previous patches (no template, but CSS file, update to .libraries.yml, and a preprocess function).
benjifisher’s picture

Issue summary: View changes

I am updating the "Remaining tasks" in the issue summary. I am not sure about

benjifisher’s picture

The testbot found a whitespace error that I missed:

+++ b/core/themes/seven/seven.theme
@@ -374,3 +374,16 @@ function seven_views_pre_render(ViewExecutable $view) {
+function seven_preprocess_update_version(array &$variables) {
+  $variables['#attached']['library'][] =  'seven/update-report';

There is an extra space after the =.

tedbow’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new168.31 KB
new6.78 KB
new30.56 KB

@benjifisher thanks for the review

  1. fixing wrapping in template @file
  2. added @see template_preprocess_update_version()
  3. fixed whitespace error from #168
  4. add claro screenshow
tedbow’s picture

StatusFileSize
new2.06 KB
new28.5 KB

reverting drupalci.yml changes

benjifisher’s picture

The text wrapping looks right, and I compared the three versions of the template file. I notice that the patches in #169 and #170 remove a line from the two templates in the theme directory:

+++ b/core/themes/claro/templates/admin/update-version.html.twig
@@ -3,14 +3,25 @@
  * @file
  * Theme override for the version display of a project.
  *
- * Available variables:

and

+++ b/core/themes/stable/templates/admin/update-version.html.twig
@@ -3,14 +3,25 @@
  * @file
  * Theme override for the version display of a project.
  *
- * Available variables:

Other than that, LGTM.

tedbow’s picture

StatusFileSize
new1.17 KB
new28.36 KB

fixing #171

benjifisher’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the many iterations, @tedbow! The latest patch has my stamp of approval!

lauriii’s picture

Status: Reviewed & tested by the community » Needs review
  1. Is there something that still needs to be manually tested or can we remove the needs manual testing tag?
  2. +++ b/core/modules/update/src/ProjectCoreCompatibility.php
    @@ -50,30 +57,29 @@ class ProjectCoreCompatibility {
    -  protected function getPossibleCoreUpdateVersions($existing_version, array $core_releases) {
    ...
    +  protected function getPossibleCoreUpdateVersions(array $core_releases) {
    

    While it seems unlikely that anyone would be extending this class, should we still be careful and avoid making changes to this function declaration?

  3. +++ b/core/modules/update/update.report.inc
    @@ -101,6 +101,38 @@ function template_preprocess_update_report(&$variables) {
    +  $variables['show_download_link'] = $version['core_compatible'] ?? TRUE;
    

    Why are we assigning this to a separate variable rather than directly using version.core_compatible in the template?

tedbow’s picture

Issue tags: -Needs manual testing
StatusFileSize
new4.02 KB
new28.07 KB

@lauriii thanks for the review

  1. Removing the tag. I am not sure if we leave that on encourage the committer to also do the testing. 🤷‍♂️
  2. This class has not been back ported to 8.8.x yet so I think this is ok.
    I would in favor of making this class final like we did for ProjectSecurityData, ProjectSecurityRequirement, and ModuleVersion.
    If we can do this in this issue great otherwise I will make a follow up.
  3. It is not as simple as using $version['core_compatible'].
    We should show the link
    if (!isset($version['core_compatible']) || $version['core_compatible'] === TRUE)
    I wasn't sure how you do isset() in twig.
    {% if version.core_compatible %}
    won't work because this is not set for the Drupal core project but we should still show the link.
    I just looked at it and this actually works
    {% if version.core_compatible is not defined or version.core_compatible %}
    I will change it but if that is too complicated for the twig file I can change it back

I also notice this

+++ b/core/modules/update/update.report.inc
@@ -101,6 +101,38 @@ function template_preprocess_update_report(&$variables) {
+  $core_compatibility_message = $version['core_compatibility_message'] ?? NULL;

This variable is not longer being used. I should have removed it in #155. Fixed

tedbow’s picture

re #174.2
Not to derail this issue I made #3116198: Make ProjectCoreCompatibility class final and internal

I think as long as we do it before this class gets backported to 8.8.x I think we are ok.

benjifisher’s picture

The changes to the Twig templates and the preprocess function look good (and consistent). I also checked that the preprocess function in Seven does not need to be changed and that show_download_link does not appear anywhere in the patch in #175.

I mentioned the left-over variable $core_compatibility_message in #157, but it was not in a numbered point, so I forgot to check it in my review #162. Thanks for removing it.

I do not have an opinion on declaring the class final, but I agree that we do not yet have to worry about BC since it has not yet been included in a release.

+1 for removing the "needs manual testing" tag. I have been testing manually, and I just tested again with both Stark and Seven.

Back to RTBC.

benjifisher’s picture

Status: Needs review » Reviewed & tested by the community

I got distracted by the cross-post and forgot to update the status.

tedbow’s picture

StatusFileSize
new28.1 KB

Here is a 9.0.x version

dww’s picture

@tedbow Re: #153: Thanks for clarifying. ;)

@xjm re: #159: Makes sense. I didn't think this issue should be blocked on that, simply that we needed a decision on if/how we were going to fix the focus styles and if we needed the hacky crap I did in #96 or not. I'm glad the decision was we can leave it broken here and fix it more generally in #2980304: Seven theme's details/summary focus style is broken/missing in some browsers.. Thanks!

@lauriii Re: #160.2: Sure, we can leave out the initial Claro CSS. I thought something not-perfect was better than nothing at all. Silly me! ;) I don't see anyone jumping in to help with getting #3114910: Improve Claro styles for core compatibility details on available updates report ready, so it seems very likely we're going to ship a version of this with no styles at all for Claro. Not my preference, but not my call.

@benjifisher Re: #167: I don't really know what to say. #2980304: Seven theme's details/summary focus style is broken/missing in some browsers. doesn't address hover styles, only focus. I don't think fixing hover styles is considered a major accessibility bug. I don't think we can reliably get the hover styles working properly without the extra <span> that #2980304 adds. I definitely don't want to block/delay this any further. Maybe we should punt this to a (follow-up)^3 to circle back and get the CSS right in Seven after both this and #2980304 land? Not my call. :defer-to-xjm: ;)

Re: #175

+++ b/core/modules/update/update.report.inc
@@ -101,6 +101,36 @@ function template_preprocess_update_report(&$variables) {
+  $core_compatible = !empty($version['core_compatible']);
+  if (empty($version['core_compatibility_message'])) {
+    return;
+  }

Super minor nit: We don't need $core_compatible if we're going to return early. That should come after the if.

Otherwise, everything looks great in here. Thanks @tedbow for taking this to the finish line, and @benjifisher and @lauriii for all the reviews!

Too bad we need separate patches for 8.9.x and 9.0.x now. :( If we're adding new patches for my micronit, it wouldn't hurt to re-upload patches so the 9.x patch is first (and only queued for testing on something that will work) and then the 8.9.x patch is on another comment so the RTBC re-testing stuff sees it as the last patch in the issue. Or change the version of this issue to 9.0.x-dev and upload 8.9.x first, then 9.0.x.

Thanks everyone!
-Derek

dww’s picture

Assigned: Unassigned » dww
Issue tags: +Usability

At risk of x-posting w/ tedbow (whom Slack says is idle / snoozing), I'm going to re-roll to clean-up #180. Stay tuned.

dww’s picture

Assigned: dww » Unassigned
StatusFileSize
new28.14 KB
new28.12 KB
new648 bytes

Such a micro change, leaving at RTBC. If someone else wants to +1 it, cool.

Thanks!
-Derek

benjifisher’s picture

I applied the patch from #182, did a quick manual test, and looked at the result in situ. +1 for RTBC.

tedbow’s picture

#182 looks good. I confirmed it only had the micro nit of moving the var mentioned in #180. that is indeed better. Thanks @dww

dww’s picture

Issue summary: View changes

Opened the follow-up for Seven hover styles: #3116331: details/summary doesn't have a hover style

Updating summary remaining tasks.

Also added a CR for this, since I think we need one to inform themers about the template / CSS changes, especially since we're modifying Stable:

https://www.drupal.org/node/3116334

Reviews/edits on that welcome.

I left the "introduced in version" field blank, since I'm not sure what that's actually going to be (hopefully 8.8.3, but TBD).

Almost there! :)

Yay,
-Derek

  • Gábor Hojtsy committed f8d4b11 on 9.0.x
    Issue #3102724 by dww, tedbow, bnjmnm, webchick, ckrina, Gábor Hojtsy,...

  • Gábor Hojtsy committed ba2063c on 8.9.x
    Issue #3102724 by dww, tedbow, bnjmnm, webchick, ckrina, Gábor Hojtsy,...
gábor hojtsy’s picture

Version: 8.9.x-dev » 8.8.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Yay, thanks all. Committed the respective patches to 9.0.x and 8.9.x. The 8.9.x patch did not merge into 8.8.x

tedbow’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new28.19 KB

rerolll

dww’s picture

Status: Needs review » Reviewed & tested by the community

Confirmed that #189 applies cleanly to current 8.8.x branch of core.
Confirmed that the only differences between #189 and #182 are patch context lines.
RTBC.

Thanks!
-Derek

  • Gábor Hojtsy committed 91251a0 on 8.8.x
    Issue #3102724 by dww, tedbow, bnjmnm, webchick, ckrina, Gábor Hojtsy,...
gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Superb, thanks!

gábor hojtsy’s picture

Published the change record too :) https://www.drupal.org/node/3116334

dww’s picture

YAY!!! :) 😁 🎉

I edited the CR to say this was introduced in 8.8.3 (hope that's accurate).
Not sure what to do about 8.9.x and 9.0.x branches. Is there going to be a 9.0.0-alpha2? Should we ignore 8.9.x?

Thanks,
-Derek

gábor hojtsy’s picture

Currently there is a Drupal 9 alpha2 planned for next week yes. For 8.9.x it will go into 8.9.0.

  • alexpott committed c5b2a89 on 9.0.x
    Issue #3118958 by lauriii: Follow-up to #3102724: CSSLint failure
    

  • alexpott committed 7ce03c2 on 8.9.x
    Issue #3118958 by lauriii: Follow-up to #3102724: CSSLint failure
    
    (...

  • alexpott committed 9c19684 on 8.8.x
    Issue #3118958 by lauriii: Follow-up to #3102724: CSSLint failure
    
    (...
hestenet’s picture

Small request - could we update the IS or perhaps the Change Record with a screencap of what the final product looks like?

This might also be helpful for us on the d.o side in: #3054376: [META] Changes/additions on drupal.org preparing for Drupal 9's release (and specifically this comment)

dww credited alexpott.

dww’s picture

@hestenet re: #199: See the User interface changes section of the summary. Those screenshots are accurate. Seven is as shown. Claro is also as shown, awaiting improvement at #3114910: Improve Claro styles for core compatibility details on available updates report.

Cheers,
-Derek

dww’s picture

Re: #200 WTF? I didn't touch issue credits at all. Weird. :/

hestenet’s picture

Thanks @dww - when these issues get so long it's hard to be sure what the latest is.

Status: Fixed » Closed (fixed)

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