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.
Right now the offcanvas tray displaces the "main canvas" which under a certain width look weird.
Should we really use displace() and try to show the main canvas when the tray is open at widths < 400 px?
Comment | File | Size | Author |
---|---|---|---|
#57 | 2793849-57.patch | 4.43 KB | tedbow |
#57 | interdiff-52-57.txt | 1.2 KB | tedbow |
#52 | interdiff-41-52.txt | 2.06 KB | tedbow |
#52 | 2793849-52.patch | 4.42 KB | tedbow |
#41 | interdiff-37-40.txt | 968 bytes | tedbow |
Comments
Comment #2
nod_Wouldn't be an issue if we were doing real offcanvas on any screen size.
Comment #3
nod_Maybe to be more constructive, we may want to do a real offcanvas thing and shift all the content to the left/right, hiding the element we're configuring even on desktop because changes require a page reload to be seen. It's not like there is a live preview of what is changing.
Comment #4
tedbow@nod_ maybe it offcanvas was badly named. And we should address that but...
A big part of the approved UX designs were that you could see the entire screen when the tray was opened.
We added #2782885: No indication what page element is being configured with Outside In so you could see the active element.
On smaller widths this is just not possible. The admin toolbar menu also does where at smaller widths it doesn't tried to displace the body.
I think because the forms in offcanvas are going to be wider that the admin menu we should let it take over the entire screen at smaller widths.
Here is a first try at that. It has to explicitly set the width of the tray to 100% to get around dialog.css which does
Comment #6
tedbowWhoops! Fixed the JavaScript error
Comment #7
tedbowPutting under parent to organize separating offcanvas into core dialog system.
Comment #8
tedbowThe patch work but it has the weird effect of when you open the tray and the tray doesn't have a vertical scroll(most of the time?) the page behind the dialog scrolls.
Comment #9
GrandmaGlassesRopeManWhen the tray is open, append a class to the body to prevent scrolling. This class will be empty if the body is above the
460px
threshold.Comment #10
tedbow@drpal nice fix. I just changed the class name from
js-stop-scrolling to js-tray-open.
Thought we should a more general name so we could use it for other css we would want when the tray is open.
Comment #11
GrandmaGlassesRopeManComment #12
phenaproximaReviewed, and I don't see any red flags leaping out at me. But it should probably have a test. I'm pretty sure Mink has support for resizing the browser window, so there's no real reason not to test this.
Comment #13
tedbowOk I gave a try at the test but it doesn't seem to work.
Comment #14
tedbowComment #17
tedbowOk. It looks the resizing is actually working. isVisible doesn't seem to be working
I have left a couple debugging lines in this patch that makes screenshots(you will have to update path to use)
Here are the resulting screenshots
Narrow width without tray open
Narrow width with tray open
So maybe isVisible is the wrong thing to check here
Comment #19
tedbowOk I re-wrote the test to check for the padding on the main-canvas-wrapper element instead or isVisible(). Basically the main-canvas-wrapper element should NOT have padding when at more narrow width.
I had to test for +-20px on the actual breakpoint because stark theme failed exactly on the break point. I wanted to test 2 themes like the rest of the tests in this module.
Comment #20
tim.plunkettTrailing comment
Can you post a test-only patch in addition to the updated patch, to prove it fails?
The test looks good, but let's prove it does what it says.
Comment #21
tedbow@tim.plunkett thanks for review.
fixed comment
Also here is a test only patch.
/me crosses fingers
Comment #23
tedbowUpload patches in wrong order. TEST_ONLY patch failed which was expected.
Comment #24
tim.plunkettThat's awesome, yay for JS tests
Comment #25
alexpottThis causes two new issues for me.
The content is totally squashed on the right if just above the width
if you start editing at really low width and then expand out the settings tray doesn't pad right
Comment #26
tedbow@alexpott thanks for the review and screenshots!
This was caused by the dialog.css
It forces all dialogs to 92% at lower widths.
I have changed our css to override 92% to 100% for our dialog at
max-width: 48em
. Really it doesn't make sense at a lower width. Sense our css is loaded later it will override dialog.cssI realized that on 'dialogContentResize.outsidein' we also need to pad the body. Fixed
Comment #28
tedbowIn #26 I forgot to update the width used in the test. There also unrelated failures b/c 8.3.x was broken but hopefully that is fixed.
Comment #31
tedbowRandom test failure,ArgumentPlaceholderUpdatePathTest, back to RTBC, rinse and repeat ;)
Comment #34
tkoleary CreditAttribution: tkoleary commentedComment #35
tedbowJust a re-roll b/c #2784571: Outside-in Accessibility: Allow escape from edit mode with ESC key was just committed and it changed all event namespaces in offcanvas.js from ".outside_in" to ".offcanvas.js"
Comment #37
tedbowRe-roll was wrong. There were few commits to this module happening very quickly on Friday.
Comment #38
GrandmaGlassesRopeManComment #39
Wim LeersLet's document why we pick this number.
Comment #40
webchickComment #41
tedbowAdded to comments to document minDisplaceWidth and related css as per #39
Comment #42
webchickCredit.
Comments look good to me.
Comment #43
webchickOk, confirmed via testing that this does what it says on the tin. Let's doooo eeeet! (Also, YAY for tests!)
Committed and pushed to 8.3.x and cherry-picked to 8.2.x.
Thanks!
Comment #45
webchickOops. I spoke too soon! Doesn't cleanly cherry-pick. Need a patch for 8.2.x as well, since it seems like a legit bug fix for the stable release.
Comment #47
webchickOops, I see. The modules were out of sync because #2784571: Outside-in Accessibility: Allow escape from edit mode with ESC key wasn't back-ported (thanks, @tedbow!). Did that, and now...
Cherry-picked to 8.2.x as well. Thanks! :D
Comment #48
xjmThe test introduced by this patch is failing in HEAD, so rolling back for now until it can be fixed.
E.g. https://www.drupal.org/pift-ci-job/575041
Comment #50
xjmIt also failed in #41 BTW. ;)
Comment #52
tedbowOk, I see what happened. Even though from #37 to #41 there was only a comment change in the meantime #2815831: Move Off-canvas related CSS from drupal.outside_in library to drupal.off_canvas got committed and that css selector needed to select the "main-canvas" from an id to a class.
The test needed to updated. This patch does that.
Comment #53
xjmI think our comment line length standards still apply to CSS and JS; aren't these way too long? Edit: Not that this blocks commit for an experimental module since the standard doesn't seem to be tested at least for eslint, but simple to fix.
Comment #54
xjmComment #56
tedbowSince this was reverted it needs to go back to 8.3.x.
Test failed in #52 because #2815831: Move Off-canvas related CSS from drupal.outside_in library to drupal.off_canvas
was not backported to 8.2.x. I added comment on that issue.
Comment #57
tedbowHere is patch the fixes the comment lengths. I somehow messed up my eslint settings :(
Comment #59
tedbowFor any reviewers and committers, I think this is ready to be RTBC again for 8.3.x but can't be committed to 8.2.x until #2815831: Move Off-canvas related CSS from drupal.outside_in library to drupal.off_canvas is backported to 8.2.x
Comment #60
Wim Leers#52 and #57 interdiffs look sane.
Comment #61
tedbow@Wim Leers thanks!
Ok for any committers out there. #2815831: Move Off-canvas related CSS from drupal.outside_in library to drupal.off_canvas should probably be committed to 8.2.x first. then this issue can be committed to 8.3.x and 8.2.x.
Right now this only applies to 8.3.x because #2815831 was not committed to 8.2.x.
Comment #62
tedbowGreat #2815831: Move Off-canvas related CSS from drupal.outside_in library to drupal.off_canvas was committed to 8.2.x also
So now outside_in should identical again for 8.2.x and 8.3.x. Can do git check just in case:
git diff 8.2.x..8.3.x core/modules/outside_in/
This should now be good to go for both branches.
Comment #63
webchickOk, take 2! :)
Committed and pushed to 8.3.x, cherry-picked to 8.2.x. YEAH!
Comment #69
tedbowChanging to new settings_tray.module component. @drpal thanks for script help! :)