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.
See #1848064: Allow to filter modules by arbitrary search strings on the Modules page.
I think it would be *really* useful to have a similar search field on that page as well, especially when you are looking for a specific class that failed on the testbot. Right now, you often have to open the file to figure out the group and name so that you can find it on the huge list.
screenshots of patch from #1
Remaining Tasks
- (done See #35) accessibility testing. Contributor Task doc for how to do accessibility testing: https://drupal.org/contributor-tasks/accessibility-review
- (done See #50) open follow-ups (See #23)
Follow-ups
- #1925492: Small optimization for search on modules page
- #1925498: Convert t() to format_string that added class to the description, when search added to test list (this one is postponed on this issue)
- #2021065: hide the table header when empty search on the test overview page
- #2021067: remove the field set for tests on the test overview page
- #2021071: too tiny text for description and class on the test overview page
- #2021077: make search also match the test groups on the test overview page
- ?
Comment | File | Size | Author |
---|---|---|---|
#57 | noall.png | 86.74 KB | YesCT |
#55 | 1919470-55-testing-search-field.patch | 7.71 KB | Wim Leers |
#55 | interdiff.txt | 4 KB | Wim Leers |
#54 | interdiff.txt | 1.18 KB | joelpittet |
#54 | 1919470-54-testing-search-field.patch | 6.88 KB | joelpittet |
Comments
Comment #1
BerdirWow, that was easier than expected.
- Copied the JS, I expected to have to make changes but it actually just seems to work? Should we move it into a separate file/library so that it is better re-usable? Adding system.modules to that page feels wrong?
- Added the form fields and classes
- Added the class name behind the description to make it easy to also search by that.
And it just works, see attached screenshots. Amazing :)
Comment #2
sunYes, we intentionally designed the JS to make it re-usable later on. I think we want to move the behavior into a new JS file; e.g., /misc/tablefilter.js
In http://drupal.org/project/admin_ux (which I'm using persistently), I've replaced the entire test label with the class name. Since the d.o testbot does not output the human-readable labels anymore, it only makes sense to do that in the local UI, too.
Closely related: #697760: Replace getInfo() in tests with native phpDoc + annotations (following PHPUnit)
Comment #3
Wim Leers:)
It works, but it's doing more than it has to on the tests page; the tests page is simpler. So the JS can be even simpler than it already is.
To generalize this, we'd have to make things too abstract to make all aspects configurable I think.
OTOH, I think the JS on this page should do automatic uncollapsing of collapsed rows, if a collapsed row matches?
Unnecessary for tests filtering.
Unnecessary for tests filtering.
Unnecessary for tests filtering.
Unnecessary for tests filtering.
Comment #4
YesCT CreditAttribution: YesCT commentedrelated #1919558: add the test class to make it easier to match with the bot
Comment #5
BerdirOk, here's an update.
- Removed some unnecessary parts of the JS and renamed methods.
- Performance is a bit a problem, There are 800+ table rows, while I don't notice any issues on my desktop, it is quite slow on my laptop but the other JS also has performance issues.
- Due to that, I also increased the minimum characters to 4, there are way too many matches below that anyway. Might require a description/hint?
- Added some basic handling to only show groups when the search string is removed. Currently does not check if those groups were collapsed or not before, which is a bit weird. Need some help with that :)
- Also added a flag to prevent doing the above if it's not necessary, e.g. while typing the first 3 characters
Comment #6
tim.plunkettMy laptop is pretty quick, so I didn't notice any real slowness. That said, this is an identical approach to the module page, so it should be fixed for both if there is a huge problem.
The only visual bug is if your search doesn't match anything, the modules page hides everything but this still shows the table header, which looks very strange.
Extra blank lines
This seems like a performance improvement that could be mimicked in the module filtering.
I would combine these two lines, personally.
This is unused, and looks the same as showTestRow
I can see why 2 would be too slow, but just testing it, I found having 3 characters do nothing be frustrating. Can we try bumping it down?
Is that something happening in D8? Is there an issue?
Should this mention the 4 character limitation?
This should be format_string, I'm pretty sure.
Comment #7
BerdirI'm not sure the modules search needs this. Unlike this, searching already starts at the second characters, so there's only a single character on which we would not have to search on. And there are also considerably more tests than modules (close to 900 table rows..)
But I'm happy to apply it there as well if this is the correct approach to do something like this.
It is a weird thing to translate agreed, but what about rtl languages? What do you think about replacing the name with the classname? then this would no longer be necessary... We should probably discuss that in a separate issue, though.
Changed the other things....
Comment #8
YesCT CreditAttribution: YesCT commentedno : after the todo
See
http://drupal.org/node/1354#todo
Also, to be consistant with the todo just a few lines after.
That of course is a tiny, nit, so patch attached for it.
But while I was reading it, the wording of the todo seemed strange. It was saying what the code did not do, instead of what the todo was todo. So I reworded the comment with what it sounded like the todo was hoping would be accomplished.
Comment #9
YesCT CreditAttribution: YesCT commentedI also tested manually.
Still working great.
Search starts after 3 chars.
There is a tooltip type of popup with the instructions that say to enter at least 3 chars.
Here is what it looks like when there are no matches, as @tim.plunkett mentioned in #6
Comment #10
YesCT CreditAttribution: YesCT commented@tim.plunkett asked about the autofocus todo comment.
Perhaps this is the info looking for. It's a won't fix and but also mentions just using #attributes. I'm not sure what that means for this though.
#1174936-13: Allow FAPI usage of the autofocus attribute
Comment #11
YesCT CreditAttribution: YesCT commentedaside form #9 and #10
all the comments from @tim.plunkett have been addressed.
Here are the two follow-ups for the remainder from #7
#1925492: Small optimization for search on modules page
#1925498: Convert t() to format_string that added class to the description, when search added to test list (this one is postponed on this issue)
Comment #12
Wim LeersThis is in fact a mutex, and it should be documented as such. It should be documented how this helps improve performance, because at first glance it looks very odd.
Comment #13
BerdirRight now, when you either start typing or delete characters, when you are between 0 and $min characters, I'm first hiding everything in the table and then display the group grows. (Happy to change that if someone has a better suggestion).
So it does a lot of processing that is completely unnecessary. With the flag, it only does that (hide all then show group rows) once when you switch from $min characters to $min - 1 characters. Might not be necessary for the modules page because there is only a single character where this happens and we're simply displaying everything.
Comment #14
Bojhan CreditAttribution: Bojhan commentedWhy is tests in a fieldset?
Comment #15
YesCT CreditAttribution: YesCT commented#8: drupal-Add_a_search_field_to_the_test_overview_page-1919470-8.patch queued for re-testing.
Comment #17
YesCT CreditAttribution: YesCT commentedtagging for reroll http://drupal.org/patch/reroll
Comment #18
star-szrRerolled to fix a minor conflict with #1901670: Start using PHPUnit for unit tests.
Comment #19
star-szrMissed the tag.
Comment #20
star-szr@Bojhan/#14 - that sounds like a separate issue to me, this patch doesn't add or change fieldsets.
Comment #21
nod_tag
Comment #22
YesCT CreditAttribution: YesCT commented#18: 1919470-18.patch queued for re-testing.
Comment #23
xjmThis is totally freaking awesome. I tested with and without overlay and it works great. I can't provide a JS code review though--@nod_, @tim.plunkett?
If it looks good codewise I'd just as soon get this in RIGHT NOW so that we all can start using it RIGHT NOW, and then handle the following in followups:
Despite that it's after feature freeze, I think it's fine to put this in by itself and add followups, since this is a developer-facing feature and a very non-intrusive patch.
Things we should do before commit:
Also, I'm marking this as a task, because it is going to save every single D8 developer time.
Comment #24
nod_Js is good, based off the module filter code so nothing to worry about.
For those raising the point that we should be using the same JS in the module and simpletest filter, well, we need the same markup first.
Comment #25
xjmAlright then. Thanks @nod_! Let's then do the accessibility testing and file some followups.
Comment #25.0
YesCT CreditAttribution: YesCT commentedUpdated issue summary, embedded screenshots in issue summary
Comment #25.1
YesCT CreditAttribution: YesCT commentedadding remaining tasks section
Comment #26
YesCT CreditAttribution: YesCT commentedHere is a easy url to use for accessibility testing: http://simplytest.me/project/drupal/8.x?patch[]=http://drupal.org/files/1919470-18.patch
Comment #26.0
YesCT CreditAttribution: YesCT commentedmaking url work
Comment #26.1
YesCT CreditAttribution: YesCT commentednoting follow-ups that were already made
Comment #27
Bojhan CreditAttribution: Bojhan commented@xjm That's fine, I guess if you need you can always move the button towards the top.
Comment #27.0
Bojhan CreditAttribution: Bojhan commentednoting #23 has the list of follow-ups to open
Comment #28
YesCT CreditAttribution: YesCT commentedSimplytest.me is having trouble with #1969680: Installation fails with MyISAM - key too long
So, this Contributor Task doc, for manual accessibility testing might help in the mean time: http://drupal.org/node/1853532
Comment #29
BerdirSimpletest.module can currently not be installed on simplytest.me due to the PHP configuration.
Comment #30
mgifford#18: 1919470-18.patch queued for re-testing.
Comment #31
YesCT CreditAttribution: YesCT commented#18: 1919470-18.patch queued for re-testing.
Comment #33
jenlampton#18: 1919470-18.patch queued for re-testing.
Comment #34
star-szrNeeds a reroll.
Comment #35
s_leu CreditAttribution: s_leu commentedAdding a rerolled patch for this.
Regarding the autofocus @todo i don't see a reason to add this because we are executing JS anyway, so i think it's an unecessary overhead to do a feature testing for support of this attribute and then adding it conditionally instead of just using .focus(). Or what would be the reason to do so?
I test the page with the keyboard shortly, and everything is accessible that way. The rest of the accessibility testing seems unnecessary because this page is working in the same way as the module list page.
Comment #36
s_leu CreditAttribution: s_leu commentedComment #38
Berdir#35: 1919470-35.patch queued for re-testing.
Comment #40
Berdir#35: 1919470-35.patch queued for re-testing.
Comment #41
star-szrThanks @s_leu!
Just wanted to note that #35 is not a straight reroll, here is an interdiff generated by patchutils. The two main changes I saw were that format_string() is used instead of t(), and this:
Also check the indentation within \Drupal\simpletest\Form\SimpletestTestForm::buildForm(), it's a bit off now.
@s_leu - Next time you reroll and want to make additional changes, I recommend posting two separate patches if possible (first just a direct reroll with no changes) with an interdiff :)
Comment #42
s_leu CreditAttribution: s_leu commentedOk to clean that up, here's a straight reroll, a patch including the improvements and an interdiff containing only the improvements after the straight reroll
Comment #43
star-szrPerfect, thanks @s_leu :)
Comment #44
s_leu CreditAttribution: s_leu commentedAdded another change that takes care about the last remaining todo in the JS, it adds code to respect the opened test actions after the search string gets deleted again.
Comment #45
YesCT CreditAttribution: YesCT commentedI did a quick read through and standards wise looks ok to me. (for example the whitespace indent is fixed)
Comment #47
nod_JS needs a little bit of work.
$(this).show(), don't need to put that in the .each(), it can be just before the .each() and will work just as well.
it's drupalSettings now, not Drupal.settings.
not .parents() but .closest(). and the .children()[0] is pretty ugly, no better way to select that?
Comment #48
s_leu CreditAttribution: s_leu commentedAdded nod_'s suggested changes.
Comment #49
YesCT CreditAttribution: YesCT commented@xjm (or other)
this is tagged with needs followup. Does it need follow-ups that are not already created and listed in the issue summary?
If follow-ups are already created and linked, I think we can remove the needs followup tag.
Comment #50
YesCT CreditAttribution: YesCT commentedAh, I thought the things in #23 are addressed with follow-up issues. Here are the follow-ups.
Next: accessibility review
https://drupal.org/contributor-tasks/accessibility-review
Comment #50.0
YesCT CreditAttribution: YesCT commentedadded conttributor task doc
Comment #51
BerdirSee #35, @s_leu did a keyboard test and this is the same behavior and form structure as on the module search page, so I think we are good in regards to accessibility testing?
Comment #51.0
Berdiradded follow-ups from #23
Comment #52
nod_Thanks for the reroll s_leu, a few small details if you don't mind.
- I'd prefer we use the global
drupalSettings
variable instead ofsettings
(the settings parameter will be removed from the behaviors for attach and detached functions).- can we have
.trigger('focus');
instead of.focus()
? there is an issue out there to remove all shorthand version of those things with proper .trigger and .onOther than that, js is RTBC as far as I'm concerned. Thanks :)
Comment #52.0
nod_updating remaining tasks
Comment #53
joelpittetAs requested in #52 by @nod_
Comment #54
joelpittetFirefox was choking on keyup because of all the DOM searching so I added a little timeout delay of 200ms to allow the search a breathing period to cancel the filter function call.
Comment #55
Wim LeersReally? I can't reproduce that. But given that Berdir has also indicated performance can be a problem on this page, let's keep this, but instead of using custom code, let's use
Drupal.debounce
, which exists precisely for this purpose.In this reroll:
Drupal.debounce
.searching
variable tosearched
, which is what it really is about. It's *not* a mutex as I said in #12. It's now also documented to prevent future confusion.Comment #56
nod_Thanks, that's what debounce is for indeed. Changes are all good on my side.
Comment #57
YesCT CreditAttribution: YesCT commentednice!
the no select all checkbox when filtered,
is consistant with how the search works on the modules (Extend) page too.
Comment #58
joelpittet@Wim Leers thanks, didn't know of debounce:) I have a couple other things that could make this preform better but that can go in a follow up. RTBC:)
Comment #59
Dries CreditAttribution: Dries commentedCommitted to 8.x. Thanks.
Comment #60
xjmThank you thank you! Yay!
Comment #61
YesCT CreditAttribution: YesCT commentedoh yay!
Comment #62.0
(not verified) CreditAttribution: commentedupdated remaining tasks, noting comment where accessibility testing was done.