Updated: Comment #32
Problem/Motivation
Proposed resolution
Move the list of candidate blocks into the sidebar of the block listing.
Remaining tasks
None blocking commit. Followups should be filed for adding frontend tests for the list filtering functionality and the block add/modal workflow.
User interface changes
API changes
BlockListController
now implementsEntityListControllerInterface
.- The interim autocomplete route and its controller are removed.
- Some hook implementations are removed.
- The separate form controller and theming for the old "place blocks" page are removed, because the page no longer exists.
- The render array structure of
admin/structure/blocks
is changed.
Related Issues
#2055853: [meta] Improve the place block UX; Separate interaction from the create block UX; Improve the existing blocks-by-theme layout
#2056513: Remove PluginUI subsystem, provide block plugins UI as one-off
#2050227: Add local action plugin deriver to use YAML discovery for static definitions
#2061777: Provide dynamic registration of local_action plugins
#2029731: Improve help for blocks module
Comment | File | Size | Author |
---|---|---|---|
#54 | blocks-ui.interdiff.txt | 1.6 KB | pameeela |
#54 | block-2058321-54.patch | 46.97 KB | pameeela |
#51 | block-2058321-51.patch | 45.55 KB | tim.plunkett |
#50 | block-2058321-50.patch | 45.43 KB | tim.plunkett |
#49 | interdiff.txt | 917 bytes | tim.plunkett |
Comments
Comment #1
tim.plunkettWill set to NR when #2056513: Remove PluginUI subsystem, provide block plugins UI as one-off goes in.
Tests will fail even then, this is not ready for review yet.
Comment #2
tim.plunkettBlockers have gone in!
Screenshots to come later today.
Comment #3
tim.plunketts/later today/right now/
Expanding the block category details elements
Filtering the available blocks
Block add form in a modal
Comment #4
dawehnerAt least from my observations the derivative classes never ended up in the actual plugin folders?
I thought we decided to use an alter hook for now?
i guess some of them should get some docs?
Slightly out of scope.
just wondering whether Json::encode should be used instead of consistency (yes there is no special sigh here).
Comment #5
tim.plunkettI copied from MockMenuBlockDeriver, but that looks like it might be one of the only ones :) But it doesn't matter because:
Right, I forgot to switch to an alter hook. Will do.
This JS is borrowed directly from system.modules.js, which is borrowed from simpletest.js, which I believe nod_ wrote. So I'll leave it to him.
Yes, I'll just revert those changes.
This is also copied directly, from ConfigSync in this case. I don't think it matters.
Comment #7
Bojhan CreditAttribution: Bojhan commentedOeeh, nice! Great work tim!
We really gotta fix Seven's design in regards to sidebars. But that isn't part of this issue.
Comment #8
xjmThis is an essential part of #2055853: [meta] Improve the place block UX; Separate interaction from the create block UX; Improve the existing blocks-by-theme layout, so bumping to critical.
Comment #9
tim.plunkettThis addresses @dawehner's review, and fixes a CSS bug on small screens.
Comment #10
tim.plunkettSummoning the JS team, block.admin.js is an adaptation of system.modules.js, which was copied from simpletest.js
Comment #11
nod_block.admin.js
has only one thing to fix:if (query.length == 0) {
this does not pass JSHint validation, it should be
if (query.length === 0) {
Other than that, all good for me :)
Comment #12
webchickEDIT: moved comment over to #2055853-6: [meta] Improve the place block UX; Separate interaction from the create block UX; Improve the existing blocks-by-theme layout, since it concerned the design, not the implementation.
Comment #13
tim.plunkettjbeach pointed out a flaw in showing a details element with jQuery, which is present on the modules page (where I copied my code from), see #2060573: Standardized filter/search behavior; surface filter matches regardless of their containing box's open state; for that.
This fixes that bug, and addresses #11.
Comment #14
tim.plunkettThis includes further improvements from that JS issue (which is now RTBC).
I've attached two versions of this patch. One has the categories initially collapsed, like all the previous patches. The other has them initially open.
Collapsed:
Open:
Comment #16
webchickI will say, even as someone who has a pretty good idea where all of these blocks come from, I actually do like the open version better. Especially since the list of blocks can change randomly based on other configuration in the site (modules enabled/disabled, views created, etc.).
Comment #17
tim.plunkettUgh, that was a bad rebase, it accidentally reverted the views block patch from #2057831: Exposed filter blocks do not work anymore.
Interdiffs were correct.
Comment #18
Bojhan CreditAttribution: Bojhan commentedThere is a small bug, this might be dialog related though. Once I add a block and it exits the modal, onto the block page it trows me out of the overlay. The modal dialog is also strangely attached to the top of the page, rather than a little more vertically centered.
Comment #19
EclipseGc CreditAttribution: EclipseGc commentedPretty sure this should be translatable. I don't care if it's in a follow up, but it needs doing.
I'm probably not the person to RTBC this, but I will say I definitely support this. As much as I like the Plugin UI code, it doesn't belong in core (yet), and it was written too early in the life cycle of D8. Having used this new UI (at various stages) I like where this is going. FWIW I'm very ++ here.
Eclipse
Comment #20
tim.plunkettOpened #2060859: Make Block plugin's "category" a translatable string for #19, thanks!
Comment #21
tim.plunkettBetween @Bojhan, @webchick, and @Dries, we seem to have consensus on going with 17B (the expanded by default).
I personally liked collapsed by default, but @Bojhan's points in #2055853-9: [meta] Improve the place block UX; Separate interaction from the create block UX; Improve the existing blocks-by-theme layout are convincing. Also, it will help us focus on @Berdir's #1888702: Use configuration selection instead of derivatives for some blocks for improvements to faulty block derivatives.
So, any further reviews, please focus on 17B.
(retitling to prevent a bad commit message)
Comment #22
dawehnerWhat is the replacement for that test, I can't find it ...
Comment #23
tim.plunkettWe've removed the autocomplete controller completely. We now have JS-only filtering of block labels, instead of autocomplete of block plugin IDs.
Comment #24
dawehnerJust to write done from yesterday night, there should be tests for the generated blocks list on the right side.
Comment #25
tim.plunkettGood idea. This test checks the category structure, and then proves you can move them around with an alter hook. Should be sufficient.
Comment #26
xjmThis patch looks great. Love the diffstat, once again.
I tested the patch manually with @Dries, @webchick, and @effulgentsia. The current version has no usability regressions over what's currently in HEAD, and two clear improvements:
I have just three questions:
So we're adding the custom block local action back on this page since we got rid of the other form it was on and now there's no place block local action to confuse it with. That makes sense.
It seems a little odd that custom block is altering its own local actions here. I can see that we have to add the local action on a per-theme basis, rather than just once, but this is a lot of code to do just that.
Maybe this is just a side effect of me not understanding why local actions have to be special and different and have all this stuff around them, and therefore out of scope, but I think this will probably come up in a maintainer review and so want to make sure I understand.
So the equivalent of this test for the new UI is purely a JS test; let's add a followup for that for FAT? @nod_ / @jessebeach, thoughts?
admin/structure/block
with the newly-placed block added. (WebTestBase::drupalPlaceBlock()
deliberately creates blocks through the API rather than the UI.) I don't think there was anything in HEAD covering this previously; it was one of the gaps in test coverage related to the now-removed plugin UI stuff. Thoughts?Comment #27
tim.plunkett1) Yes, this alter was requested by @dawehner, I previously abused derivatives to do it (see the interdiff in #9 for the switch).
We have no standard approach to dynamic paths for a local action, and the consensus (pwolanin, dawehner and I) landed on alter.
3) We can't test that it takes you into a modal. It's just unpossible. All of our dedicated modal tests are completely faking it by setting the test content to a bunch of JSON and xpathing it. So if we try to test this, it will just use the regular paths as though JS was disabled. \Drupal\block\Tests\BlockTest already covers this.
Comment #28
xjmSo sounds like two FAT test scenarios to add, then: one for the filtering and one for the add link and modal.
Are there existing local actions issues we can reference in the summary? Thanks!
Comment #29
xjmClosest things to API changes in the patch.
BlockListController
now implementsEntityListControllerInterface
and so has to add a couple methods, which would affect anyone subclassing this form for whatever reason. Otherwise, we're just changing the ArrayPI structure of theadmin/structure/blocks
form (obviously) and removing:Comment #30
xjmOh, and after looking at the interdiff in #9, I agree that the alter for the local actions is a step up over using derivatives for it. ;) Let's file a followup though to discuss whether there's a less insane way to handle stuff like that.
This patch is good to go from my perspective, but I'll give @dawehner a chance to weigh in on it again too.
Comment #31
tim.plunkett\Drupal\filter\Plugin\Menu\AddFilterFormatLocalAction is an example of another.grep -nr @LocalAction *
will show you them allxjm meant she was looking for a link to #2050227: Add local action plugin deriver to use YAML discovery for static definitions
Comment #32
dawehnerOn the longrun we might want to have a dynamic plugin registration much like hook_entity_info() ...
Opened a follow up: #2061777: Provide dynamic registration of local_action plugins
The interdiff of #25 looks fine, so I am fine with the patch. Given #2058321-11: Move the 'place block' UI into the block listing I assume that the JS is fine.
Comment #32.0
dawehnerUpdated issue summary.
Comment #32.1
xjmUpdated issue summary.
Comment #33
benjy CreditAttribution: benjy commentedI also tested this and it looks good. However there are a few styling issues on both the iPhone and iPad. Screenshots attached.
How come we removed the link to "add custom blocks"? Couldn't we link to this to: block/add?
Comment #34
tim.plunkettThose screenshots are wrong. You didn't properly clear either the Drupal or browser cache. I know this because the styling looks wrong, but also because you have a "Place blocks" local action.
Comment #35
tim.plunkettTalked through this with @benjy, realized I was missing some media queries.
#2061863: Make two column node CSS reusable is a follow-up to stop copying this CSS everywhere.
#2056173: Regression: Two-column layout is broken by vertical toolbar is a bug well be seeing here now, since its the same CSS.
Comment #36
tim.plunkettIncluded one line from debugging, didn't mean to.
Comment #37
benjy CreditAttribution: benjy commentedLooks good now. Opened a follow up for iPhone issue which also appears at admin/content. #2061873: Toolbar and Page pushed over at admin/content on iPhone
Comment #38
larowlanJust tested this on an Android. You can't press the save blocks button in the modal because when you scroll to the button, it jumps back to the top of the modal before you can press the button. Will file a follow-up on Monday as that isn't this issue's fault
Comment #39
larowlanOut of scope: does anyone else think this is overkill just for a local action link. Seems Like yml files would suit better.
I can't see where this is replaced. But I'm reviewing on my mobile without dreditor so might have missed it. This was the only link to edit the custom block content entity other than contextual links, which I'm not sure have a non Javascript fallback.
Comment #40
tim.plunkett@larowlan your first question was asked in #29 and answered in #31
As far as the second part, we no longer have an operations dropbutton, because the old "Place blocks" operation is now the link with the block plugin title. This was by design.
Can't they just get to the custom block content entity edit from the listing page? Also, it could be a local task on the block configure form possibly.
Either way, that's a question for the parent issue.
Comment #41
larowlanThis is the block listing page. There is no other page.
Comment #42
larowlanWhich means we need admin/content/block listing using views?
Comment #43
tim.plunkettCustom block needs its own listing. And that could use views. This cannot because we don't have draggableviews in core. (Please continue this discussion on #2055853: [meta] Improve the place block UX; Separate interaction from the create block UX; Improve the existing blocks-by-theme layout or open a follow-up)
Comment #44
xjmThis issue is (alas) currently blocked on something like #2062439: Provide listing of custom block entities.
Comment #45
xjmPer the docs gate, this issue needs to update
block_help()
foradmin/structure/block
.Comment #45.0
xjmUpdated issue summary.
Comment #46
tim.plunkettBlocker went in.
I don't know what else it should say. Suggestions welcome.
Converted the local action to YAML.
Comment #47
larowlanThere was no reference to the old place blocks in block_help() so assigning to xjm for feedback on expectations regarding hook_help() here.
If nothing, then RTBC.
Comment #48
benjy CreditAttribution: benjy commented1. At admin/structure/custom-blocks the empty listing text could be improved however I think that's out of scope here.
2. Also, this confused the hell out of me.
Do we want a follow up for 2?
Comment #49
tim.plunkettMy mistake! The change in #46 wasn't done all the way.
#48.1 is blocked by #1850080: Entity type labels lack plurality, cannot generate UI text based on label if plural is needed
Comment #50
tim.plunkettARGH. Wrong patch, correct interdiff.
Comment #51
tim.plunkettRerolled for #1957142: Replace config() with Drupal::config()
Comment #52
BerdirI understand the combination of this being RTBC and the review in #2055853-6: [meta] Improve the place block UX; Separate interaction from the create block UX; Improve the existing blocks-by-theme layout makes #1888702: Use configuration selection instead of derivatives for some blocks a bug, for those block derivates that could have large numbers. Will update the issue over there with what it currently does ASAP and which blocks should be derivates and which shouldn't. I guess most others will stay.
Who wants to change the configuration/derivative issue to a (major?) bug? :)
Comment #53
tim.plunkettIf this goes in, I will.
Comment #54
pameeela CreditAttribution: pameeela commentedNew patch with a slight update to block_help() per #45.
Comment #55
tim.plunkettThank you so much @pameeela! Now we don't need to wait for xjm.
Comment #56
webchickProbably makes sense for Dries to sign off on this interim step, since he had some pretty serious reservations about it back a week or so ago.
Comment #57
Dries CreditAttribution: Dries commentedI'm ok with this being committed as an interim step. There seems to be consensus that this interim step is a big step forward. Just keep in mind that the final solution could look quite a bit different (see #2055853-22: [meta] Improve the place block UX; Separate interaction from the create block UX; Improve the existing blocks-by-theme layout) as there are still major UX issues with this interim solution.
Comment #58
Dries CreditAttribution: Dries commentedCommitted this 8.x. Thank you.
#2056513: Remove PluginUI subsystem, provide block plugins UI as one-off might need a re-roll because of this; not sure yet.
Given that this is an interim step, I don't think we need to write up a change notification just yet. It is probably good to track it already? I'm leaving this as critical.
Comment #59
jessebeach CreditAttribution: jessebeach commentedNice! This is really a significant interim step. I'm loving the steady improvement this UI is going through. Small steps let us lock in improvements.
Comment #60
tim.plunkettThis only removes a form alter, and the form and controller we just moved in #2056513: Remove PluginUI subsystem, provide block plugins UI as one-off, which was never documented in the first place.
Any real change notice will come from the parent issue.
This still needs follow-ups for adding FAT tests, but nothing left to do in core.
Comment #61.0
(not verified) CreditAttribution: commentedUpdated issue summary.