Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Style changes for the moderation sidewbar that need to be clearly defined from the discussion in #3030786 will be done in this ticket.
Proposed resolution
- Group the tasks and display them consistently
- Custom log position is consistent and below the buttons
- All links are displayed as buttons
- Improve the color of the ghost buttons
- Use colors for different action buttons using type_style_moderation module
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#32 | 3032643-ui-improvements-with-ghost-buttons-32-interdiff.txt | 1.05 KB | sasanikolic |
#32 | 3032643-ui-improvements-with-ghost-buttons-32.patch | 8.11 KB | sasanikolic |
| |||
#32 | 32-hover:focus-state.png | 85.99 KB | sasanikolic |
#32 | 32-normal-state.png | 84.55 KB | sasanikolic |
#24 | Patch 22 - custom log between.png | 68.69 KB | sasanikolic |
Comments
Comment #2
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedHere are two versions that came up to my mind after all the discussions, one with "ghost buttons" and one with links only.
Note that if we go with the links solution, I'd possibly add the ">" before the links with font awesome or material icons.
Looking forward for your feedback.
Comment #3
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedComment #6
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedPatches don't apply because they're based on #3032635.
Comment #7
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedCould we also change the font for the moderation sidebar (at least for the buttons)? It's super bulky and doesn't really fit button labels.
Comment #8
BerdirRight now we have 3 different things:
* Action: Immediately publish/unpublish, discard draft: regular button
* Sidebar-Link: Translations/Revisions
* Link to a page: entity usage, confirm forms, view/edit
And we also have red to indicate destructive things (although delete is much more destructive than discard draft, but it also only goes to a confirm page). And edit is a half-action kinda and also very common, which is why our original idea was to use a ghost button for that.
Maybe delete should also be in the bottom list as a red link.
maybe there should even be three sections? those on top, the quick_draft_form and those below? not sure how yet to name them yet.
yeah, because the template currently then does exactly what I suggested above. This would then become easier if we have 3 top-level keys and if the weights in the quick actions from match the default order.
People can then still use stuff like that if they want a different order, but we can keep the default template simpler.
Comment #9
BerdirAlso, I only saw specific hardcoded things in the patch I think, make sure to e.g. install entity_usage to see where that ends up now.
Comment #10
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedI fixed the weights and the templates in the following patch. Local tasks as entity_usage button are placed in the secondary area now.
I also tried putting the delete button below as a ghost button and as a link, but doesn't look the right position to me.
Comment #12
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedRerolled and based on https://www.drupal.org/files/issues/2019-02-15/3032635-sidebar-layout-ch....
Comment #13
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedComment #14
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedSorry for the spam, posting the patches against 8.x-1.x and template changes in issue #3032635 here.
Comment #16
johnchqueThis will create problems as 'secondary' can be null. I think we should initialize it as [];
Comment #17
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedI added the change mentioned above.
Comment #18
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedComment #19
BerdirThis is a patch against #2988331: Content translation moderation because it conflicts with that in a few cases. We definitely want to get that in first, as that fixes a lot of bugs while I'm sure this will need some more discussion.
It will obviously not apply on d.o, but I would suggest that if you make further changes here, you always work against the latest patch in the other issue.
Comment #20
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedHere is a rebased patch for 8.x. branch.
Comment #21
BerdirThis should work better ;)
Comment #22
samuel.mortensonThis is close, but there were three things I wanted to change:
1. Ghost buttons normally invert color/background on hover, so I added that.
2. The "danger" links should look like action buttons - I know there's a confirmation for deleting the node but discarding the draft has no confirmation so it should feel dangerous.
3. I didn't like the new placement of the revision log field - I get how this is probably nice for people that fill it out, because you want to fill it out before making the action, but not all users fill this out every time and it broke up the actions in a way that I thought didn't look nice. This is totally my opinion so I'm happy to chat about this more if you'd like.
If you're OK with the changes above, you can mark the issue as RTBC and I'll commit. Otherwise we can iterate on the design more.
Comment #23
BerdirThanks for the feedback! I'll check this internally, there's also always the option to override something if we can't agree, that's fine. Will think about the position, it kind of made sense to me because even if you don't fill it out, you need to be aware of doing so before you press that button. But we'll try it out.
Comment #24
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedThe button changes from @samuel.mortenson make sense to me. Looks much better imho and hover should behave as a button, not as a fake link inside a button.
A few remarks though:
- The weight is not consistent, in the published state the custom log message is above the delete content, in the draft state it's below.
- Let's fix the alignment of the check icon and text position, as they are currently way off. Let's left and bottom align it - or does that happen because of our global form styles? Could you post how does that look on a clean environment?
Attaching our screenshots for comparison.
Comment #25
miro_dietiker> 1. Ghost buttons normally invert color/background on hover, so I added that.
Can you point me to some real Drupal styleguide that defines this?
We found such definitions in many other styleguides and adopted it in a first iteration. Furtheriterations with UX research showed that inversion on hover creates visual irritation and we try to never do this and instead apply a 20% change on BG / FR color. This, by trying to shift it into the direction of higher contrast on hover, not less.
As a comparision, material.io only applies a slight effect, typically adding BG. They however reduce text readability with their hover in most cases, but only slightly - so it doesn't hurt that much:
https://material.io/design/interaction/states.html#hover
Comment #26
samuel.mortenson@miro_dietiker I don't think there's a Drupal styleguide for this, I think it's just common for ghost buttons to behave this way. I would rather go back to the old button styling (or something similar, they should look like buttons) than just underline the text inside the button, which was the styling in #21.
Comment #27
kevinfunkLove the new look! What everyone's thoughts on updating the colors so we don't have two blue buttons?
Comment #28
samuel.mortenson@kevinfunk https://www.drupal.org/project/type_style has a sub-module, type_style_moderation, that allows you to set colors for Workflow transitions. That's how I'd recommend setting colors, because otherwise we would have to hard-code color mappings for transition IDs, which may differ across sites.
An integration for Moderation Sidebar used to live in DF: https://github.com/acquia/df/commit/fc688c8c30c395fffa9eff67d4a5d65588a2...
Comment #29
kevinfunkThat's understandable. Thanks @samuel.mortenson.
Comment #30
miro_dietikerComment #31
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedComment #32
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedHi @samuel.mortenson, I took a look at this issue again as we'd like to move forward.
I noticed that the focus effect was missing for the sidebar link and added that. Also changed the hover color from white to a slight greyish like we use for the text above, as I feel that is a bit too much contrast for a ghost button. What do you think?
We are also missing the active state for the links, might be a good addition for accessibility?
Comment #34
samuel.mortensonI'm doing a release today and wanted to get this in after tagging. I reviewed #32 and think it's good enough to move forward with. For active state on links - please file a new issue is this is needed, I'm not an expert on that but it seems like a good addition. Thanks for being patient everyone!
I'm going to ask people using the new release to review the UI changes so that the next release (8.x-1.4) isn't too surprising for everyone.
Comment #36
acbramley CreditAttribution: acbramley at PreviousNext for Service NSW commentedJust a note that this causes breaking changes for alter hooks and template overrides, see #3137427: Document render/TWIG changes introduced by 1.4 these need to be documented in the release notes at the very least.