Currently postponed on #3208766: Add UUID to sections
Problem/Motivation
Some complex page layouts leverage multiple section containers for long-form content, where reordering sections would be helpful.
Proposed resolution
Allow re-ordering of sections through the UI in mobile-friendly, accessible manner.
Completed tasks
- Determine the best UI for re-ordering sections
- Write patch with functionality
- Write tests
- Community review and confirmation
- Usability review
Remaining tasks
Additional tasks and optimizations prior to follow-up review:
- #3080606-77: [PP-1] Reorder Layout Builder sections: Move the "Reorder sections" trigger to be in-line with each section, alongside the remove X and the "Configure section" link. This is inspired by http://www.drupal.org/project/lb_ux. Reasons for this include: the "reorder sections" is something likely done while looking at a given section, and scrolling back to the top takes you away from that focus. Also, the "Save layout" and "Discard buttons" are actual buttons that perform a standard operation, and it's easy to scroll past that and miss the "Reorder sections" link
- #3080606-77: [PP-1] Reorder Layout Builder sections: By having the reorder section be triggered from a specific section, we can highlight that section in the tabledrag. Compare to the highlight effect when you use the "Move" contextual link for any block in Layout Builder. See also the Block UI, after placing a new block, it scrolls to and highlights the newly placed box.
- #3080606-77: [PP-1] Reorder Layout Builder sections: Add a second column to the tabledrag with the human-readable label of the layout plugin used for each section. This additional metadata will be very helpful when trying to keep track of which section is which, especially if you haven't added custom labels to your sections (by default they are only numbered). If needed, it should be possible to specify a greater width for the off-canvas sidebar.
- #3080606-84: [PP-1] Reorder Layout Builder sections: Try to make the UI for reordering sections as much like the UI for reordering components as you can. That applies to the interaction in the off-canvas sidebar. It also applies to the link that opens the sidebar. For reordering components, I think that is a contextual link, along with Configure and Delete. Would it make sense to have similar contextual links, or a drop button, for sections?
- #3080606-84: [PP-1] Reorder Layout Builder sections: I see links to some screenshots in #74, but nothing under "User interface changes" in the issue summary. Once the suggestions in #77 are implemented, it will help to get updated screenshots and add them to the issue summary.
- Receive @tim.plunkett (subsystem maintainer) review signoff (per #3080606-55: [PP-1] Reorder Layout Builder sections and #3080606-60: [PP-1] Reorder Layout Builder sections, as stated in #3080606-77: [PP-1] Reorder Layout Builder sections).
- #3080606-85: [PP-1] Reorder Layout Builder sections: I think this issue needs a change record, so I am adding the tag for that. It might also need a release-note snippet at the end of the issue summary.
User interface changes
Needed, see #3080606-84: [PP-1] Reorder Layout Builder sections or remaining tasks above for process to create UI changes.
API changes
None anticipated.
Data model changes
None anticipated.
Release notes snippet
TBD
Follow-up issues
TBD
#3293787: Section reorder through click-and-drag
#3293789: Replace "Show Content Preview" checkbox with collapseable sections
Screenshots
New reorder section task
Off canvas to reorder sections
Comment | File | Size | Author |
---|---|---|---|
#105 | Screenshot from 2023-05-31 08-51-21.png | 13.75 KB | DanielVeza |
#105 | Screenshot from 2023-05-31 08-50-54.png | 15.14 KB | DanielVeza |
#100 | interdiff-72-100.txt | 5 KB | DanielVeza |
#100 | 3080606-100.patch | 21.29 KB | DanielVeza |
| |||
#97 | interdiff-71-72.txt | 3.08 KB | alexahumada |
Issue fork drupal-3080606
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
Chris Burge CreditAttribution: Chris Burge at University of Nebraska commentedI agree 100% this is a need. The current workaround is to 1) create a new section, 2) manually copy any section settings, and 3) move blocks to the new section in the same configuration.
I don't think the backend portion should be overly challenging. The difficulty will be designing an [accessible] UI. IMHO, the drag and drop interface used for blocks won't work well. It would be challenging in the same way that reordering in complex, nested Paragraphs is challenging (i.e. the contents of the page are significantly taller than the browser viewport and you end up with an unwieldy interface).
The block move interface may be a better example to mimic. When section re-ordering is activated, the settings tray opens and and the sections in the body are labeled "Section 1", "Section 2", etc. Instead of re-ordering blocks, you're re-ordering sections:
Comment #4
cantrellnm CreditAttribution: cantrellnm at Oxbow Labs commentedA patch to get the ball rolling on this issue. No tests written yet.
I created
MoveSectionsForm
based on theMoveBlockForm
as suggested by Chris. Anyone have a better way to sort and re-insert the sections on form submit? What I've got seems to work at least.I've added a "Move sections" link to the actions for
DefaultsEntityForm
andOverridesEntityForm
. Maybe the link should be somewhere else and/or a trait likePreviewToggleTrait
?Comment #5
Chris Burge CreditAttribution: Chris Burge at University of Nebraska commentedComment #6
tim.plunkettClosing #2956204: Allow Layout Builder sections to be reordered as a duplicate, even though it long pre-dates this issue.
Comment #7
Chris Burge CreditAttribution: Chris Burge at University of Nebraska commented@tim.plunkett - Good catch. We somehow missed the original issue.
Review of patch #4:
@cantrellnm - Thanks for creating this patch. It works in my manual testing.
Action label
I would suggest we consider using "Re-order sections" as an action label as it is more descriptive/precise than "Move sections".
I'll defer to someone with a UX background, but I imagine the patch will get some feedback on how the link (or maybe change to button) is presented to editors:
Tab Focus with Keyboard Navigation
When an editor is using keyboard navigation and activates "Add section" or "Add block", the tab focus is moved to the off-canvas element when it is opened. When an editor is using keyboard navigation and and activates "Move sections", the focus is unchanged. They have to tab through the rest of the page before getting to the off-canvas element.
Code standards
Coder returns the following re coding standards:
Comment #8
WebbehRenamed 'Move sections' to 'Re-order sections' in the two occurrences - see attached patch. I also created interdiff for changes between #4 and #8, although I think I may have done this incorrectly (as it's showing more changes than what I made?).
Feel free to ping me on the Drupal Slack if you spot a mess-up with the patch and interdiff, I'm always up to learning from my mistakes!
Comment #9
zviryatko CreditAttribution: zviryatko as a volunteer and commentedSeparate UI is good for accessibility but is there any reason to not allow dragging of an entire section, anyway we have a flat structure so why to not provide a drag-n-drop for sections?
Comment #10
Chris Burge CreditAttribution: Chris Burge at University of Nebraska commentedFrom #2:
A drag-and-drop interface might be workable if we could minimize section heights: 1) hide their blocks (or at least toggle off content preview), 2) hide "Add section" elements, and 3) hide "Add block" elements. This would increase the complexity of the feature request, however.
Comment #11
cantrellnm CreditAttribution: cantrellnm at Oxbow Labs commented@Webbeh It looks like the
MoveSectionsForm
got dropped out of patch #8, and the interdiff is compared with the latest Drupal commit instead. (As a result this interdiff is for patch #4.)Action label & Code Standards
This patch addresses the code standards issues and changes "Move" to "Reorder" in the form as well. (I have a preference for "Reorder" over "Re-order" but that can be changed of course.)
I'm also unsure of the best place for the "Reorder sections" link and defer to any UX experts, but for now I've changed it to be styled as a button beside the others.
Tab Focus
I'm not sure why focus isn't changing to the dialog after it opens. I found suggestions that using the
data-disable-refocus
attribute might help, but it didn't work when I tried it. Any ideas for how to fix this?Comment #12
Chris Burge CreditAttribution: Chris Burge at University of Nebraska commentedComment #13
WebbehRe #11, thank you @cantrellnm!
Comment #14
Chris Burge CreditAttribution: Chris Burge at University of Nebraska commentedThis patch looks really good. A few items for feedback:
Action label
Re the action label - Visually, I do like it better as a button. And it is an action that will affect the entire display. Also, I agree it should be "reorder" instead of "re-order". (Fixed in the issue title.)
Tab focus
Re tab focus, give this a try in
DefaultsEntityForm
andOverridesEntityForm
. It worked for me:('true' as a string works.
true
as a boolean doesn't)Form Title
I missed this on my last review, but I think we should consider dropping the host entity's label from the
MoveSectionsForm
title. The 'Reorder sections' action is already scoped to this particular display, and we don't need it as context.With entity title:
Without entity title:
That would involve removing the
MoveSectionsForm::title()
method and hardcoding the title in layout_builder.routing.yml:Drag-and-drop interface
I revisited a potential drag-and-drop interface with our UX designer, and we couldn't figure out a good way to make it work.
Unless there's a workable solution for drag-and-drop (that doesn't significantly increase the complexity of this patch), my vote is stick with the UI provided in the current patch.
Comment #15
cantrellnm CreditAttribution: cantrellnm at Oxbow Labs commentedTab Focus
Thanks, Chris! I had tried setting
data-disable-refocus
totrue
but not'true'
, so that's fixed now.Form Title
The form title has been hardcoded to 'Reorder sections' as suggested.
Drag-and-drop interface
I agree we should stick with the current patch's form for now. An additional UI would be complicated enough I think it deserves its own issue and discussion (without delaying this basic implementation of a useful feature).
Comment #16
Chris Burge CreditAttribution: Chris Burge at University of Nebraska commentedComment #17
Chris Burge CreditAttribution: Chris Burge at University of Nebraska commentedTests continue to pass, so we haven't broken anything. At this point, I think we're ready to update unit tests to test the new reorder section functionality. It probably needs it own test class - mabye
Drupal\Tests\layout_builder\FunctionalJavascript/MoveSectionFormTest
.Comment #18
cantrellnm CreditAttribution: cantrellnm at Oxbow Labs commentedI've created
Drupal\Tests\layout_builder\FunctionalJavascript\MoveSectionsFormTest
as suggested (heavily based onMoveBlockFormTest
).While doing so I thought about the discrepancy between the "Show/Hide row weights" button and using "Delta" instead of "Weight" for that value in the table. I did that because
Section
doesn't have a weight property likeSectionComponent
does, but maybe it should.Any opinions on that? I'm not sure what other repercussions adding weight to
Section
might have.Comment #20
cantrellnm CreditAttribution: cantrellnm at Oxbow Labs commentedAdded
$defaultTheme
to the test to fix the deprecation notice.Comment #21
Chris Burge CreditAttribution: Chris Burge at University of Nebraska commentedComment #22
rensingh99 CreditAttribution: rensingh99 at Red Crackle commentedHi,
I have reviewed the patch #20 and it worked as designed.
Below are my updates.
1 it's added the button "Reorder sections" on the layout page.
2 When I clicked on this button pop-up open with section list to change the order of section.
3 After saving the "Reorder sections" form it changed the order of section.
I have also run the included test in the patch.
Below is the output screenshot of the patch.
The patch is working great.
Thanks,
Ren
Comment #23
tim.plunkettThanks for the work on this so far!
This needs a post_update function to clear caches in light of the new routes and UI elements
This is the default value and does not need to be specified here.
No need for an #id here
This is unnecessary. If you must, you can
assert($section_storage instanceof SectionStorageInterface);
, but even that is overkill IMOWhy duplicate the class and ID?
This @var is unnecessary.
Can you mix and match # and non-# keys like this? I don't recall this working
Nit: no blank line
That's quite a few array_* functions in a row, perhaps a comment would clear up what is happening here.
Why the need for the cast?
Is classy really required here? If not, stark should be used.
Shouldn't be performing asserts in a setUp method. (I realize this may have been copied from somewhere else, but if so that place itself is wrong)
This is duplicated now, is there a better way to genericize this?
Comment #24
Chris Burge CreditAttribution: Chris Burge at University of Nebraska commentedRe #23.1 - If
'data-disable-refocus' => 'true'
is removed, then the tab focus is not moved to the off-canvas element when it is opened. See #7 (Tab Focus with Keyboard Navigation), #11 (Tab Focus), #14 (Tab focus), and #15 (Tab Focus).Comment #25
tim.plunkettSorry, I misread RenderElement. It has this:
In this case, the LB code should switch to using the #ajax part. Then it can use TRUE instead of the internal implementation detail of string "true".
Comment #26
Chris Burge CreditAttribution: Chris Burge at University of Nebraska commentedComment #27
Chris Burge CreditAttribution: Chris Burge at University of Nebraska commentedGeneral comment first: Because
MoveSectionsForm
was adapted fromDrupal\layout_builder\Form\MoveBlockForm
, this code review turned into a bit of a code review onMoveBlockForm
's existing code, too.Post update function is added.
RenderElement::preRenderAjaxForm()
does set$element['#attributes']['data-disable-refocus'] = "true"
; however, this is ignored whenDrupal\Core\Render\Element\Link::preRenderLink()
renders$element['#markup']
. No changes made in patch.MoveBlockForm
. That's where this code came from. Follow-up issue forMoveBlockForm
?MoveBlockForm
that this one was adapted from. Follow-up issue forMoveBlockForm
?MoveBlockForm
, and so far as I can tell, it functions correctly. No changes made in patch.MoveBlockForm
. Follow-up issue forMoveBlockForm
?::testMoveSections()
. There's only one test. Code is fromMoveBlockForm
. Follow-up issue forMoveBlockForm
?MoveSectionsFormTest
. Do you mean re-use across tests? I'm seeing duplicate code inDrupal\Tests\layout_builder\FunctionalJavascript\MoveBlockFormTest::moveBlockWithKeyboard()
and near-duplicate code inDrupal\FunctionalJavascriptTests\TableDrag\TableDragTest::moveRowWithKeyboard()
. We could add a Trait to core's TableDrag test. Please advise. (No changes made in patch yet)Comment #28
Chris Burge CreditAttribution: Chris Burge at University of Nebraska commentedUpdated patch with path fixed.
Comment #29
tim.plunkettThis continues coming up, bumping to major.
Comment #30
CarlHinton CreditAttribution: CarlHinton as a volunteer commentedUpdating the patch file for the latest version of core
Comment #31
CarlHinton CreditAttribution: CarlHinton as a volunteer commentedCorrecting that patch file
Comment #32
CarlHinton CreditAttribution: CarlHinton as a volunteer commentedThird time lucky
Comment #33
Chris Burge CreditAttribution: Chris Burge at University of Nebraska commented@CarlHinton - could you post an interdiff?
Comment #34
CarlHinton CreditAttribution: CarlHinton as a volunteer commentedAdding patch 34 - which fixes some addional coding standard errors within Layout Builder - and also got this to work for me using Core 8.8.5
Also adding interdiff file
Comment #35
CarlHinton CreditAttribution: CarlHinton as a volunteer commentedLooks like I did it again - I left in my www/ path
Comment #36
CarlHinton CreditAttribution: CarlHinton as a volunteer commentedOh dear - this is embarising
Comment #37
Chris Burge CreditAttribution: Chris Burge at University of Nebraska commented@CarlHinton - Can you provide some context for the changes you're making? For example,
\Drupal\layout_builder\Form\MoveSectionsForm
has been removed; however, the 'layout_builder.move_sections_form' route still defines it as the Form class to return. Also - why was test coverage removed?Comment #38
CarlHinton CreditAttribution: CarlHinton as a volunteer commented@Chris Burge - thank you for pointing this out to me, the Form should still be added - but for some reason the git diff has completely removed it - very annoying - I will see if I can get that back in
Comment #40
tim.plunkettComment #41
Chris Burge CreditAttribution: Chris Burge at University of Nebraska commentedAttached is a re-roll of #28. (#28 still applies to 9.1.x - just with fuzz on two files).
Comment #42
Chris Burge CreditAttribution: Chris Burge at University of Nebraska commentedIt looks like we're getting a deprecation notice. I'll post an updated patch tomorrow.
Comment #43
Chris Burge CreditAttribution: Chris Burge at University of Nebraska commentedUpdated patch attached.
Comment #44
Chris Burge CreditAttribution: Chris Burge at University of Nebraska commentedPatch applies without fuzz and tests pass.
Here's a summary of where we are with the review process (review in #23 and response in #27).
With the exception of the final item, I just need to know if we need to file a follow-up issue for
MoveBlockForm
. For the final issue, I need clarification.3: Follow-up issue for
MoveBlockForm
?Review comment from #23:
This is unnecessary. If you must, you can assert($section_storage instanceof SectionStorageInterface);, but even that is overkill IMO
5: Follow-up issue for
MoveBlockForm
?Review comment from #23:
This @var is unnecessary.
10: Follow-up issue for
MoveBlockForm
?Review comment from #23:
Is classy really required here? If not, stark should be used.
11: Follow-up issue for
MoveBlockForm
?Review comment from #23:
Shouldn't be performing asserts in a setUp method. (I realize this may have been copied from somewhere else, but if so that place itself is wrong)
12 I'm only seeing one instance in
MoveSectionsFormTest
. Do you mean re-use across tests? I'm seeing duplicate code inDrupal\Tests\layout_builder\FunctionalJavascript\MoveBlockFormTest::moveBlockWithKeyboard()
and near-duplicate code inDrupal\FunctionalJavascriptTests\TableDrag\TableDragTest::moveRowWithKeyboard()
. We could add a Trait to core's TableDrag test. Please advise. (No changes made in patch yet)Review comment from #23:
This is duplicated now, is there a better way to genericize this?
Comment #45
ndf CreditAttribution: ndf commentedJust reviewed this as an editor. It works very well.
But I got lost a bit when I had applied a new ordering, did not save yet, and then opened the reorder-dialog a second time.
To improve usability I would like to suggest:
After saving a new revision will be created. Thus the 'before save' and 'new' should only be there when "You have unsaved changes" is shown to the user.
Comment #46
ndf CreditAttribution: ndf commentedA different (or additional) UX pattern that would be helpful is with up- and down-icons next to the gear and cross icon on each section.
See this attached image with a mockup:
With this pattern a cancel- or revert- buttons specific for reordering are not needed, because the editor can use the standard 'Reject changes' button.
Comment #47
Chris Burge CreditAttribution: Chris Burge at University of Nebraska commented@ndf - Thanks for testing out this patch and for providing feedback. I agree the UX could be improved; however, I'm not sure if that's in scope for the current issue. The UX recommendations also apply to moving blocks around (not just sections). I'll defer to a subsystem maintainer.
Comment #48
ndf CreditAttribution: ndf commentedHi @Chris . Most UX remarks are indeed nice to have. But I would like to advocate for
Because that remark seems most simple to implement and will make the current patch easier to use.
Comment #50
NWOM CreditAttribution: NWOM commented#43 works perfectly when applied to D9.07. Thanks!
Comment #51
sj.suraj CreditAttribution: sj.suraj commented#43 is working very fine even with Drupal v8.9.x. Thanks!
Comment #52
xmacinfoBase on #43, changing to Needs work.
Comment #53
dpagini CreditAttribution: dpagini as a volunteer commentedBased on what in #43 @xmacinfo? Can you be more specific? Maybe that is the wrong comment number...? The user who set this to "Needs review" did so in comment 43.
Comment #54
xmacinfoSorry, I meant #44
Comment #55
Chris Burge CreditAttribution: Chris Burge at University of Nebraska commentedSetting to 'Needs Review'. There's no work to be done without a subsystem maintainer review. Everything in #44, with one exception, is asking if we should create a follow-up issue for
MoveBlockForm
. The remaining item is minor and deals with duplicate code.Comment #56
nimoatwoodway#43 works perfectly. Thanks!
Installation details:
Drupal 9.1.4 Installation with default language DE and those modules installed:
Also tested with EN translation.
Comment #58
Ollie222 CreditAttribution: Ollie222 commentedThe patch in #43 applied cleanly to Drupal 9.2.0 and looks to work well.
Install includes modules
bootstrap_layout_builder 2.0.1
bootstrap_styles dev-1.0.x 6ed42a2
layout_builder_modal 1.1.0
section_library 1.0.0-beta2
Comment #59
dpagini CreditAttribution: dpagini as a volunteer commentedI am using this patch successfully for a few months now. Changing to RTBC to get more eyes on it after the few comments above that the points in #44 were about potentially future work...?
Comment #60
alexpottWe still need a subsystem maintainer review as per #55 and the patch does not apply to 9.3.x.
Comment #61
yogeshmpawarWorking on re-roll.
Comment #62
yogeshmpawarComment #63
WebbehUpdated IS to explicitly define next steps.
Comment #65
tim.plunkettdrupalPostForm()
is deprecated. Instead, usedrupalGet()
on the path, and then$this->submitForm(['layout[enabled]' => TRUE], 'Save');
Also tagging for usability review.
Comment #66
Chris Burge CreditAttribution: Chris Burge commentedComment #68
dpagini CreditAttribution: dpagini as a volunteer commentedHow does this issue get a subsystem maintainer to review it? I'm just coming back to this one... will give #66 a try and report back if there are any issues, but as I mentioned previously we have been using this patch for almost a year now with great results.
Comment #69
idiaz.ronceroJust to add "pressure": tested and works like a charm on a 9.3.9 install, this should be commited to core as soon as possible, is a very much missing feature of Layout Builder.
Comment #70
xmacinfoBased on previous 2 comments, marking as RTBC.
Comment #71
Chris Burge CreditAttribution: Chris Burge commentedRe-rolled for 9.4.x
Comment #72
WebbehUpdated IS for community review (justification for RTBC). Next steps should still match the tags for review.
Comment #74
Rinku Jacob 13 CreditAttribution: Rinku Jacob 13 commentedI have applied patch #71 for drupal 9.4.x-dev.The patch looks good to me . Adding screenshots for the reference.
Comment #75
benjifisherWe might review this issue at #3291116: Drupal Usability Meeting 2022-06-24, in about 30 minutes.
Is anyone available to walk us through the changes on Zoom?
Comment #76
benjifisherWe discussed this issue at #3291116: Drupal Usability Meeting 2022-06-24. That issue will have a link to a recording of the meeting.
For the record, the participants in the usability meeting were AaronMcHale, rkoller, tim.plunkett, worldlinemine, and me.
@tim.plunkett will post a comment with a summary of the discussion.
Comment #77
tim.plunkettI joined the UX team to discuss this approach.
The off-canvas tabledrag approach is great, there are some tweaks and improvements to be made.
Reasons for this include: the "reorder sections" is something likely done while looking at a given section, and scrolling back to the top takes you away from that focus. Also, the "Save layout" and "Discard buttons" are actual buttons that perform a standard operation, and it's easy to scroll past that and miss the "Reorder sections" link
See also the Block UI, after placing a new block, it scrolls to and highlights the newly placed box.
This additional metadata will be very helpful when trying to keep track of which section is which, especially if you haven't added custom labels to your sections (by default they are only numbered)
If needed, it should be possible to specify a greater width for the off-canvas sidebar.
I'll let @benjifisher remove the tag, but that is my understanding of our consensus. Thanks!
Someone please assign the issue to me once this is implemented so I can provide the subsystem maintainer signoff.
Comment #81
tim.plunkettComment #82
WebbehBased on #77, updating IS.
@benjifisher - when you remove the UX tag, can you also reclassify it within the IS?
Comment #83
Rinku Jacob 13 CreditAttribution: Rinku Jacob 13 at Srijan | A Material+ Company for Drupal India Association commentedComment #84
benjifisherI notice that there is a contrib project Layout Builder Reorder. It does not have any releases, but it does have some code. I guess it will be obsolete when this issue is committed.
I think that #77 is a good summary of the usability meeting last week. Let me add a couple of points.
Try to make the UI for reordering sections as much like the UI for reordering components as you can. That applies to the interaction in the off-canvas sidebar. It also applies to the link that opens the sidebar. For reordering components, I think that is a contextual link, along with Configure and Delete. Would it make sense to have similar contextual links, or a drop button, for sections?
I am removing the tag for a usability review and adding one for an issue summary update. I see links to some screenshots in #74, but nothing under "User interface changes" in the issue summary. Once the suggestions in #77 are implemented, it will help to get updated screenshots and add them to the issue summary.
I am also adding the tag for a follow-up issue. In addition to the mechanism of this issue, using the off-canvas sidebar, I think there should be a click-and-drag option, just as there is for components. As part of the follow-up issue, we should provide a way to collapse sections: perhaps replace the "Show content preview" checkbox with a set of radio buttons with three options (section outline, component outline, content preview).
Comment #85
benjifisherI am adding #2995689: Allow reordering blocks without a pointer device as a related issue. It was helpful to review that during the usability meeting last week.
I think this issue needs a change record, so I am adding the tag for that. It might also need a release-note snippet at the end of the issue summary.
Comment #86
WebbehBased on #84 and #85, adding next steps and requests into IS. We're so close, y'all.
Created follow-up issues:
#3293787: Section reorder through click-and-drag
#3293789: Replace "Show Content Preview" checkbox with collapseable sections
Comment #87
Chris Burge CreditAttribution: Chris Burge commentedI'm glad to see this issue moving forward. If we're going to put a 'reorder sections' link on each section, it would make sense to use a contextual link for that.
+1 for spinning off a couple of follow-up tasks.
Comment #88
roalrome CreditAttribution: roalrome commentedHey guys newbie to Drupal here, can anybody help me installing the patch?
I researched and fond that to install patches they go here:
Do I have to add the patch reference to drupal/core or what module/name should I put there?
Comment #89
podarok#71 is working well for us in Open Y distro
Comment #90
WebbehI don't think this is RTBC yet, per the remaining tasks we have in #77 and #85 (as seen in the Issue Summary).
Marking as Needs Work for these. If we want any of the feedback in the Issue Summary in child issues, please let me know so I can create those as well.
Comment #91
NWOM CreditAttribution: NWOM commentedWould it be possible to somehow re-order the sections without using the action button at the top? This way compatibility with modules like Layout Builder Widget (moves layout builder form to entity edit page) would be possible.
Comment #93
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedThanks, For having this issue and the patch for
~9.0
.Noted, that the patch is not applying to the
10.0.x
branchComment #94
alexahumada CreditAttribution: alexahumada at Ayuntamiento de Cádiz commentedUpdated patch for 10.0.x/10.1.x.
Comment #95
alexahumada CreditAttribution: alexahumada at Ayuntamiento de Cádiz commentedComment #96
smustgrave CreditAttribution: smustgrave at Mobomo commented@alexahumada can you please provide an interdiff and how the previous patch no longer applies per the new policy. But definitely an interdiff as the file size goes up from the previous patch of #71
Also per #90 there are still some remaining tasks.
Comment #97
alexahumada CreditAttribution: alexahumada at Ayuntamiento de Cádiz commentedHi @smustgrave,
sorry i forgot about the new interdiff policy.
The old patch can't be applied to Drupal 10 because some changes in code in 10.0.x and 10.1.x branches, notably some css classes present in #71 patch have been removed. Also, difference in size is caused by Drupal 10 using PostCSS to transpile pcss files to css using yarn, which require changes to new .pcss.css files.
I'll try to work on the remaining task we have in #77 and #85, but sadly this new patch only addresses Drupal 10 compatibility.
Comment #98
WebbehI suggest removing credit to Rinku Jacob 13 for the beforepatch/afterpatch screenshots.
Comment #100
DanielVezaThe patch from #72 still applies to D11, yay!
Updated the patch to fix the CCF and updated the tests since they were failing.
Comment #101
DanielVezaSetting to needs review, if tests come back green I'll jump onto IS and the CR.
Comment #103
podarokI've put #100 in https://git.drupalcode.org/project/drupal/-/merge_requests/4075
Let's make our lives better with MR
Comment #104
smustgrave CreditAttribution: smustgrave at Mobomo commentedCould issue summary and follow up tags be removed based on #86.
Also the change record?
Think the MR failures are random so running the tests again.
Comment #105
DanielVezaUpdated the IS to add some screenshots of the functionality.
Comment #106
DanielVezaAdded a draft CR. Happy for review and more information added as needed.
Comment #107
smustgrave CreditAttribution: smustgrave at Mobomo commentedThanks for the quick updates.
Tested out a little by adding 3 sections.
The reorder work but noticed something weird
If I change the sections to say 3,1,2 it renames the sections to 1,2,3.
It moves the content in the blocks correctly but was a little confusing.
Is that desired behavior?
Comment #108
darvanenPersonally I would find it more confusing if sections were arbitrarily numbered based on their starting position rather than sequentially down the page.
Comment #109
smustgrave CreditAttribution: smustgrave at Mobomo commentedSo is more about bulk moving blocks vs sections right? Since the sections rename
Comment #110
darvanenNot necessarily, sections can have different layouts/number of columns. But if you think of a section as a 'group of blocks' then sure, it's about moving the blocks (but also the layout containing them).
Comment #111
WebbehThe default 'Section #' only appears if a section lacks a user-provided label. I think it makes sense to keep them numbered based on how they are stacked on the page at the time you are re-ordering sections, otherwise it becomes a meaningless label.
One option might be to make clearer these are automatically named because they have no label (e.g. 'Unnamed Section #'), but I realize the Layout tray width is troublesome.
Comment #112
DanielVezaI agree with this
Comment #113
podarokCR looks good
MR tests are passing
Comment #114
tim.plunkettfrom #77
Will take a look either tomorrow or at DrupalCon
Comment #115
DanielVezaSetting back to NR for @tim.plunkett to give his thoughts as subsystem maintainer as per #114
Comment #117
cboyden CreditAttribution: cboyden at UC Berkeley Web Platform Services commentedI've updated the MR to address the first of the remaining tasks: Moving the Reorder trigger so it's inline along with the Remove and Configure triggers for each section.
I started to take a look at the 2nd task, highlighting the section in the off-canvas tabledrag now that we know which section the request was called from. In the Move Blocks UI, the block is identified by its UUID. Layout sections do not have UUIDs (see #3208766: Add UUID to sections). If the section does not have a label, the only way to distinguish it is by its delta. Is a highlight going to be doable with just the delta?
Comment #118
smustgrave CreditAttribution: smustgrave at Mobomo commentedMaybe this is blocked by #3208766: Add UUID to sections
Comment #119
smustgrave CreditAttribution: smustgrave at Mobomo commentedlooking at this again I feel like it should be postponed on #3208766: Add UUID to sections but if anyone disagrees please put back to NR.
Comment #120
darvanenSounds right to me, let's make it official