Steps to get the leave preview box:
- Go to edit node
- Click on Preview button at the bottom.
- Click on logo or website title on Navbar.
Actual box:
Cancel button and Leave preview are not inline.

Expected:
Cancel button and Leave preview should be inline.



| Comment | File | Size | Author |
|---|---|---|---|
| #114 | Screenshot 2023-03-14 at 9.40.27 AM.png | 128.39 KB | andy-blum |
| #113 | interdiff_104-113.txt | 1.3 KB | pradipmodh13 |
| #113 | 3149863-113.patch | 1.41 KB | pradipmodh13 |
| #112 | interdiff_109-112.txt | 395 bytes | akram khan |
| #112 | 3149863-112.patch | 1.41 KB | akram khan |
Comments
Comment #2
komalk commentedComment #3
komalk commentedOverride the classes in
/core/assets/vendor/jquery.ui/themes/base/dialog.cssAdded new file dialog.css.
Here is the fixed review the patch attached before after patch screen shot for the reference.
Comment #4
mherchelCouple of issues by looking at the code:
1) The CSS needs to be only loaded when needed. You should do this by extending an existing library
2) Why the jQuery UI copyight?
3) Indentation is incorrect
4) this will affect every jQuery UI. Is this intentional? If so, we need to make sure there are no regressions.
5) Indentation is incorrect. You'll also want to conform to the nesting style that we're using throughout Olivero.
Comment #5
mherchelComment #6
mherchelComment #7
komalk commentedComment #8
komalk commentedDid all the changes as mentioned in #4.
There are no regressions checked with other theme also working properly as expected.
Review the patch attached before after patch screen shot for the reference.
Comment #9
mherchelWhat's the difference between the core CSS and the CSS in this patch? Why not extend the library instead of completely overriding the CSS?
Comment #10
komalk commentedPlease review the patch.
Created a separate library and extended dialog using libraries-extend.
Comment #11
komalk commentedPlease review the patch #11.
Created a separate library and extended dialog using libraries-extend.
Comment #12
ramya balasubramanian commentedHi @komalkolekar,
Steps to test:
1) Download and install the Olivero themes inside the themes folder.
2) Enable and set as default and set 'Olivero' as the admin theme also.
3) Edit the node and click the Preview button.
4) Click the site title and check the dialog box.
5) There Preview and cancel button should be in an aligned position.
After patch:
Before patch:
@komalkolekar,
Please try to fix the linting errors. Please have a look at the below screenshot.
Comment #13
ramya balasubramanian commentedUpdated linting file.
Linting errors:
Comment #14
komalk commented@Ramya Balasubramanian Thank you for the review.
Please review the patch #14 fixing linting issues as mentioned in #13.
Comment #15
indrajithkb commentedHi @komalkolekar patch looking good, but am experiencing one issue by default button text font-weight:700 but on hover,focus,active it's changing to font-weight:normal(overriding by core/assets/vendor/jquery.ui/themes/base/theme.css) which is not expected behaviour we need to keep the font-weight:700 for all states.
current behaviuor:
Expected:
Comment #16
komalk commented@Indrajith KB Thank you for the review.
#15 did the changes attached the screen short for the reference
Comment #17
indrajithkb commentedhi @komalkolekar please see the #9 comment and check both css. Right now you just copied all the styles from core css (we extending the library so no need to write the styles again). just add your styles which helps to fix the issue. please update the patch.
Comment #18
indrajithkb commentedComment #19
komalk commented@Indrajith KB Thank you for the review did the changes mentioned in #17.
Comment #20
komalk commentedrefer the patch #20
Comment #21
indrajithkb commentedHI @komalkolekar patch is looking good. Can you please try to follow the proper nesting style which we are using throughout Olivero (Comment #4 and 5th point from @mherchel). It will be more appreciable if you are updating accordingly.
Comment #22
komalk commented@Indrajith KB Thank you for review update the patch with proper nesting style.
Comment #23
komalk commentedforget to run the css lint.
Review the patch #23.
Comment #24
indrajithkb commentedHI @komalkolekar great work thanks for the patch.
Issue has found fixed, not adding the screenshots again.
am adding as RTBC +1
We can wait for the review from @mherchel
Comment #25
steinmb commentedjQuery UI is on it's way out of core https://www.drupal.org/node/3067969 and gone in D9 and this theme is aiming for core inclution. Would not including code like this make it harder to get it approved and committed?
Comment #26
kostyashupenkoJust a reroll, but honestly i don't like the way about to manage inline buttons from this patch at all. Styles provided are not universal for all languages:
For example FR language

It can be any language actually and styles might be broken if language is not EN in terms of this patch.
I see 2 points how we can deal with it:
1. I'm not against if one button will be under another, i mean why it must be inline ?
2. In case if inline is really expected - then this task needs additional fixes or with
data-dialog-optionsattribute with widerwidthproperty, or we can even rewrite width for all dialogs -> by default width is 300pxOr maybe we can totally rewrite dialog component from core with own design and custom styles ?
Comment #27
mherchelThis is a relatively minor issue that most people won't encounter. I don't want to add technical debt by doing a complicated fix.
@kostyashupenko is correct that this should work across language. and that having the buttons wrap isn't too bad.
Instead of the fix above, maybe we can reduce the width/height/font-size of the buttons so they fit? This would be a global fix to the jQueryUI dialogs within the theme.
Comment #28
matija5 commentedI like what @kostyashupenko said, not being against if one button is under another. Comparing to small screens, this also happens with other buttons if I narrow screen to 300px wide and the buttons width is bigger than parent.
Comment #29
hansa11 commentedI agree with the points that @Kostyashupenko has mentioned in #26, having a button under the other and not inline is not that bad and it should be a global fix to all the dialogs within the theme.
I'll take a look at this one OR @kostyashupenko since this is your suggestion, you can assign it to yourself
I'll probably start on it in the second half tomorrow, if you wish to pick this one up, please feel free to assign it to yourself :)
Comment #30
hansa11 commentedComment #31
hansa11 commentedComment #32
hansa11 commentedPatch details:
1. Extended the core's library for
dialog.2. Fixed the buttons to be inline.
3. Added few more styles to give
ui-dialog boxthe Olivero touch.Please review.
Before Patch:
After Patch:
Thanks!
Comment #33
hansa11 commentedComment #34
sd9121 commentedComment #35
sd9121 commentedHi @hansa11
Great work on the dialog box, I like how you have matched it to the Olivero styles.
I have reviewed it and this applies well to me.
Comment #36
mherchelComment #37
hansa11 commentedLooking into this.
Comment #38
hansa11 commentedBefore Patch:

After Patch:

Please review.
Thanks!
Comment #39
mherchelThis is looking good (with one change). I really like the idea of extending
core/drupal.dialog, as there are a number of jQueryUI issues that are caused by our larger form controls.The only change is that we need to set
flex-wrap: wrapon.ui-dialog-buttonset, so that the text will wrap if the button text is longer (which can happen when the text is translated - see #26)Comment #40
hansa11 commentedComment #41
hansa11 commented@mherchel: Thank you for the review :)
Added the wrap for long words, please review.
Thanks!
Comment #43
hansa11 commentedComment #44
hansa11 commentedComment #45
hansa11 commentedComment #46
mherchelLooks great. Tested with long text (buttons wrap as expected), and verified CSS linting.
Comment #47
mherchelComment #48
lauriiiSorry for the delay on my review. I was taking time off for 2 weeks ☀️
This change looks like a great improvement! I think this is at least worth a normal priority so changing that.
According to https://developer.mozilla.org/en-US/docs/Web/CSS/word-break#Values,
word-break: break-wordis deprecated. Wondering if we could leave this out from here and come up with a solution to this in #3177475: Olivero: Ensure long words break properly when zoomed in to provide proper reflow.Comment #49
komalk commentedWorked on #48.
Instead of
word-break: break-wordusingoverflow-wrap: break-word;work as expectedAttached screenshot for reference.
Review the patch.
Comment #50
ranjith_kumar_k_u commentedThe above patch works fine.
Before patch
After patch

Comment #51
ranjith_kumar_k_u commentedComment #52
lauriiiWhy do we need to change this to inline-block? Asking because I didn't find any relevant feedback and there's not explanation in #49.
Comment #53
komalk commented1.
word-wrap: break-word;- Not sufficient to get the desired output the word overflows out of the window.2. To avoid the overflow -
display: inline-block;Attached the screenshot for reference one is without using
display: inline-block;and one is with using.Please correct me if I am wrong.
Comment #54
djsagar commentedHi,
#49 is resolving this bug for prove i shared attachment please review,
Thanks!
Comment #55
lauriiiAccording to the CI, the CSS source file is not synced with the compiled CSS file.
Comment #56
kostyashupenkoHello, the thing asked in previous comment is fixed - now both files synced. But can anyone please point me of why
overflow-wrap: break-word;anddisplay: inline-block;were used for.ui-buttonselector? On my side all works fine without these two properties. I did tests in Chrome/FF/Safari/IE11. Tests were done with short text and long text (like multiple lines for each button). Maybe i don't understand something, but i removed these two for now.So this task needs re-tests
Comment #58
benjifisherPlease do not ask the testbot to try again until #3207086: [HEAD BROKEN] Consistent failure in MonthDatePluginTest is fixed.
Comment #59
alexpott#3207086: [HEAD BROKEN] Consistent failure in MonthDatePluginTest is fixed. I have not reviewed the code.
Comment #60
lauriiiBased on #59, this still needs a review.
Comment #61
gauravvvv commentedPatch #56, seems fine to me. Adding after-patch screenshot for reference.
Moving to RTBC +1.
Comment #62
gauravvvv commentedComment #65
catchRestoring status after HEAD was broken.
Comment #66
lauriiiSince this impacts positioning of buttons in all dialogs, I think it would be useful to get a review from the Olivero maintainers.
Comment #67
rinku jacob 13 commentedi think the patch #56 is applicable for drupal 9.3.x-dev.
i tested the patch with drupal 9.3.x-dev. i got the solution correctly.Adding screenshot for the reference
Comment #68
Agnesh Tank commentedVerified and tested patch#56 on Olivero 9.3.0-dev version with 9.3.x-dev
Patch applied successfully and result is Acceptable.
Testing Steps:
Testing Output:
After applying the patch the button alignment for the Cancel & preview button started showing properly in the popup dialog box
Comment #70
sakthivel m commentedComment #71
sakthivel m commented#70 Please review the patch
Comment #72
mherchelHaven't reviewed this yet, but I want to add a note that jQueryUI is being deprecated.
Comment #73
chetanbharambe commentedVerified and tested patch #71.
The patch does not apply successfully.
Please refer attached screenshots.
Moving to Needs work.
Comment #74
kishor_kolekar commentedre-roll patch #71
please review the patch.
Comment #75
chetanbharambe commentedVerified and tested patch #74.
The patch does not apply successfully.
Please refer attached screenshots.
Moving to Needs work.
Comment #76
xjmNormal priority bug under the normal issue priority definition:
(If it were actually only related to jQuery UI it could be demoted to minor, or it can be re-demoted if it turns out that the Dialog replacement, once added, does not have the same issue. But in this case it's about the modal.)
Comment #77
xjmI closed #3213125: Olivero: Save button and discard changes button are not aligned to each other in Discard Changes? the dialog box for quick-edit. as a duplicate of this issue.
Comment #78
kostyashupenkoComment #79
bnjmnmThe current patches seem to add a good amount of CSS for something that seems like it can be addressed with only a few lines. All the additional CSS is of particular concern since it would impact all dialogs, not just the node preview one.
Two options come to mind:
For example, this single rule addresses the reported issue without altering the button appearance much.
Also worth considering that the button lengths are going to be different depending on the language the site is in. Whatever solution works for Engligh should probably grant some additional spaces for potentially longer labels on non-English sites. (though also important to keep in mind that buttons apoearing on different lines is also not a major concern)
Comment #80
vikashsoni commentedApplied patch #74 working fine
After patch the button alignment is good and working fine for ref sharing screenshot
Comment #81
radheymkumar commentedpatch #74 working fine sharing screenshot --
Comment #82
bnjmnmRemoving credit for #81, a second set of screenshots is not necessary immediately after ones were provided, and the colors are different from Olivero so it's not clear if Olivero is even the theme represented.
The next best steps are addressing #79 -- the current fix is very elaborate and difficut to truly review, it adds a bunch of CSS not specific to the reported issue. A small amount of CSS that targets this specific issue is preferable.
Comment #83
cindytwilliams commentedPer bnjmnm's comments in #79 and #82, here is a patch that targets just this dialog in this theme, sets the min-width to 400px and aligns the buttons on the left.
This is 100px wider than the default, granting additional space for longer button labels in other languages.
Mobile remains unchanged.
Comment #84
ranjith_kumar_k_u commentedFixed CS issue.
Comment #86
kristen pol@cindytwilliams It's useful to provide an interdiff when updating a patch: https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa...
Checked and the patch applies cleanly to 9.3, 9.4, and 10. Needs testing for all versions so tagging.
Comment #87
Satyajit1990 commentedI have verified with the version 9.4 and It looks good to me.
Tested patch #84
Testing steps :
1. Install Drupal 9.4.x-dev version.
2. Go to Appearance -> Set Olivero theme as admin and default theme
3. Edit the node and click the Preview button.
4. Click the site title/logo and check the dialog popup.
5. Preview and cancel button should be in an aligned position.
6. Now apply the patch and clear the cache.
Verify the popup dialog box button alignment for Cancel & Preview
Testing Output:
After applying the patch the button alignment for the Cancel & preview button showing properly in the popup dialog box
Comment #88
kristen pol@Satyajit1990 Thanks for testing. Would you test on versions 9.3 and 10 as well? The same patch applies cleanly to all versions. You can use simplytest.me for testing the other versions as, right now, DrupalPod only is defaulting the Drupal version so it's the same as what's on the issue (9.4 in this case). Thanks.
Comment #89
Satyajit1990 commentedHi Kristen,
Verified with the version 9.3 by using simplytest.me
And It works for me after applying patch #84
Screenshot for reference :
I am unable to verify with the version 10 as getting syntax error after applying the patch

Comment #90
kristen polThanks for testing on Drupal 9.3.
1. Testing on Drupal 10 is still needed.
2. This needs code review from a frontend developer. The
!importantmakes me wonder if this is a good approach.Comment #91
kristen polI have found out from @catch that, since the patch applies cleanly to 9.3, 9.4, and 10 and it was already tested on 9.4 then we don't have to test on 10.
At this point, it just needs a review from the Olivero team so I'll mark RTBC since:
1. Patch applies cleanly to 9.3, 9.4, and 10.
2. Patch appears to only address issue in the issue summary.
3. Title and issue summary are fairly clear (though it's not using the template).
4. Tests pass.
5. Manual testing passes on 9.4.
6. Not sure specific test could be added for this.
Comment #93
larowlanStill needs a +1 from @mherchel
It would be nice if we could use css layers.
Putting jquery UI css into a lower layer would avoid the need for !important here I assume
Comment #94
bnjmnmThe issue summary used the node preview dialog as an example of the issue, but the solution should not be targeted at just node preview dialogs. this is something that could happen with any dialog with multiple buttons in the pane where they occupy > 300px (the jQuery ui dialog default width)
Providing a specific width so this specific dialog is wider doesn't address the underlying issue either. An explicit width assumes the buttons will not be any longer when translated into other languages. We need a solution where the modal width is dynamically calculated based on it's content as it initializes
This could be addressed by listening to the
dialog:aftercreateevent and setting the dialog minimum width to accommodate the combined width of the button pane buttons (+ their margins)Comment #95
ameymudras commentedThanks @bnjmnm for the suggestion, Ive tried to use
dialog:aftercreateevent to calculate the min-width for the UI dialog. I have made some css changes too to get rid of specific min-widthComment #97
kristen polThanks for the update. Tagging for testing with new patch.
Comment #98
Harish1688 commented@ameymudras,
Tested the bug with version 10.1 and tried the patch 3149863-95.patch that's working fine for me.
attached the screenshot, good for RTBC.
Comment #99
bnjmnmThe problem with the width calculation is that .ui-dialog-buttonset is set to float: right. Fortuately, fewer floats are a good thing.
Give .ui-dialog-buttonset a float: none and a margin-left: auto (and reverse it for RTL)
Then make .ui-dialog-buttonpane display:flex as well. Doing this makes it so the margin-left: auto in .ui-dialog-buttonset positions it the same way float: right BUT! in a manner that results in a properly calculated dialog width.
Remove the media query here so it is always flex and the buttons stack when the viewport is narrower than their total width
On mobile devices, this approach can result in a dialog wider than the viewport, which shouldn't happen. Fortunately, I think this JavaScript can be removed entirely. I think it's a clever solution, but it also looks like quite a bit of logic for a fairly small UI change which should be avoided when possible if only to have less code to maintain long term. Fortunately, I believe a CSS only solution is possible.
Also, the issue summary has things like screenshots of CSS lint and the simpletest home screen that should be cleaned up. Those don't belong in an issue summary as their absence would not result in any less understanding of the issue reported. The issue summary does not need to mirror the comments, it only needs to be updated with broad information regarding diagnosis and outcome.
Comment #100
ameymudras commentedComment #101
gauravvvv commentedCleaned up Issue summary.
Comment #102
gauravvvv commentedTried to address comment #99 feedback. I have added patch for same. Please review
Comment #103
_utsavsharma commentedTried to fix CCF for #102.
Please review.
Comment #104
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #105
gauravvvv commentedFixed CCF, attached interdiff for same.
Also we're not using any variables in the file, so I have removed the import of variable file as well.
Comment #106
nayana_mvr commentedVerified the patch #105 and tested it on Drupal version 10.1.x with Olivero theme. The patch works fine and I have added the before and after screenshots for reference.
Comment #107
smustgrave commented#101 updated issue summary so removing that tag.
+1 For me as this does solve the issue at hand. Not moving as still need review from olivero maintainers.
Comment #108
andy-blumThis looks good, and I think would probably be fine, but the fact that we're targeting all ui-dialogs in Olivero is reason enough to make sure this is bulletproof. As much as the design looks better with the buttons in alignment, it's more important that we don't introduce regressions in the UI.
This is targeting all buttons that are the last child in their wrapper, including the close button. This doesn't appear to change anything as that button doesn't have a margin, but since we're already digging into the buttonpane and buttonset wrappers later, we might as well limit the scope of this rule.
Since we're setting the buttonset to
display:flex;, I think we ought to consider a few things:flex-wrap: wrap;to the buttonset element, that will allow buttons to wrap to the second line if they need it, before wrapping extremely long text and overflowing the button's boundaries.gapproperty, we don't have to worry about margins on any hypothetical 3rd buttons.Comment #109
pradipmodh13 commentedHello @andy-blum,
Added flex-wrap: wrap in ui-dialog-buttonset for global implementation.
Please review.
Comment #110
pradipmodh13 commentedComment #111
andy-blumI know it's sandwiched between the images, but still needs point #2 from my earlier review:
Comment #112
akram khanadded patch and fixed CCF #109
Comment #113
pradipmodh13 commentedHello @andy-blum,
Added gap property for button layout to handle global implementation.
Please review.
Comment #114
andy-blumThis looks good to me. Thanks @pradipmodh13
Comment #116
smustgrave commentedSeems to be random failure.
Comment #118
lauriiiCommitted 1d97f05 and pushed to 10.1.x. Thanks!
Comment #119
quietone commentedIt looks like manual testing was done in #144. I am removing the tag.