Closed (fixed)
Project:
Drupal core
Version:
9.5.x-dev
Component:
Umami demo
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Sep 2018 at 09:38 UTC
Updated:
17 Apr 2023 at 22:24 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
lauriiiComment #3
kjay commentedConfirming that I'll add this design work into my current tasks and post here when the style guide is updated with the required details.
Comment #11
lendudeTried to reproduce this on a more current version of Drupal than the screenshot and the elements are more visible now and obscure the underlying elements even more.
Updated the screenshot to the newer version.
Comment #13
markconroy commentedI'm going to bump this to major. What we are seeing in the screenshots is not acceptable for a demo of how great Drupal is. And I think a fix such as "let's just put a white background colour behind the preview info" would be a good start to have it acceptable. After that, maybe we could look at a fresh design for this component.
Comment #14
lauriii+1 that we could approach this with a quick fix first!
Comment #15
markconroy commentedLooks like this is an issue with Drupal core generally, not just with Umami.
In node.preview.css we have:
We can remove all of that, and just leave in the
padding: 10pxto fix this issue.Here's some screenshots:
Umami currently
Umami if we remove the position: fixed CSS

Olivero currently

Olivero if we remove the position: fixed CSS

In the mean time, let's remove this from the Umami issue queue and move to to the theme system.
Comment #17
markconroy commentedComment #18
lauriiiI'm not sure we should be making this change this broadly. It seems like this could break some pre-existing themes. Even if it wouldn't, it would be changing the behavior in those themes. If we were to introduce that kind of change, we'd probably want to evaluate that a bit more. I think it would be easier to land a solution that fixes this in the scope of Umami. āŗļø
Comment #19
rkolleri've applied the patch to a fresh 10.1.x-dev install with the demo_umami profile. the change looks straight forward and good. the only small detail i consider at least distracting on wider viewports is the position of the view mode switcher. it is shifted to the left compared to the position of the search field which is more or less in the center of the browser window. i've intentionally dragged the browser window to the maximal possible width to illustrate the offset/shift (screenshot is taken in safari 16.1 - but tested also in the latest version of firefox).

one other detail i've noticed which is definitely out of the scope of the issue probably. but the tabbing order is sort of unexpected. if you start tabbing from the
start to content editinglink you get next to the select list, then theswitchbutton. but me as a user would expect to get to the language selection (english/espanol) next but instead i tab into the admin toolbar. would i make sense to move the node preview container div down the DOM after the the toolbar-administration div?Comment #20
markconroy commentedThanks Lauriii. I'll move this back to Umami, get a small fix for it there, and see how we progress then for Drupal core.
Comment #21
markconroy commented@lauriii this is ready for a review again.
Comment #22
lauriiiDiscovered another issue which we should fix for optimal preview UX: #3342891: 'node' variable in page.html.twig is not available on preview node page.
I pushed some changes to the MR to make the preview bar slightly nicer.
The "switch" button should also not be visible when JavaScript is enabled. The button is visible because there's some CSS in Umami that overrides the
.js .js-hidestyles. I added!importantto thedisplay: noneto avoid other CSS accidentally overriding that. We could also fix this in Umami but it feels a bit silly. That change probably shouldn't go to stable.Comment #23
markconroy commentedLooks good to me. Will we RTBC it?
And perhaps create a follow up to see why we need to use !important. Umami should not be overriding .js-hide.
Comment #24
lauriiiIf the changes look good for you, go for it!
I think we may want to keep the
!importantthere because it helps prevent accidental overrides.Comment #25
smustgrave commentedWhen I apply the MR changes and this is what I see. Is it okay for the view mode to overlap the search field?
Comment #26
lauriii@smustgrave did you clear caches after applying the patch?
Comment #27
smustgrave commentedMaybe weekend work wasn't my friend after all. Thought all the changes took affect.
Clearing cache fixed it.
Comment #28
larowlanAgree, this is much better, manually tested before and after - looks good to me.
I committed this locally and was about to push when the !important in system module gave me pause.
I know it *should* be hidden, but its possible this will cause an unexpected regression for someone who (wrongly) had put some other specificity on a component that has js-hide to change the display.
E.g I could envision a scenario where someone did this
With css
But with this change their previous ID based selector would no longer win.
So can we do this without changing system js.module.css?
See https://codepen.io/larowlan/pen/zYJXZVj for a pen of the above, put the !important in and see the behaviour change.
Comment #29
markconroy commented@lauriii @larowlan I've removed that
!important. I don't think it is needed as demo_umami profile and umami (theme) does not have any override that I can see for.js .js-hide. I can't find the string.jsor.js-hideanywhere inside the demo_umami directory.Here's 2 screenshots, showing the "Switch" not visible when JS is enabled and then showing it visible when JS is disabled.
Comment #30
smustgrave commentedPreview still looks good to me.
Comment #35
lauriiiCommitted cc24ab0 and pushed to 10.1.x. Also cherry-picked to 10.0.x and 9.5.x. Thanks!
Comment #36
luenemann