Searchable modules page

Frando - March 9, 2009 - 20:31
Project:Drupal
Version:7.x-dev
Component:base system
Category:feature request
Priority:critical
Assigned:Unassigned
Status:reviewed & tested by the community
Issue tags:D7UX, Needs usability review, Usability, User interface, vertical tabs
Description

This patch depends both on #396466: Support custom success callbacks in ahah.js and #323112: Vertical Tabs.

The current modules form is horribly broken usability wise, especially once you have many many modules installed.

This patch adds vertical tabs to the module admin page, and search too! Awesome, isn't it.

Search is done via AHAH, and a new vertical tab is inserted containing the search result. Searching is fast, because we don't rebuild all caches as on a normal modules page load. The search matches module names and descriptions. The enter key is also bound to the search, makes it even faster.

Oh, and it degrades perfectly, the search button is totally usable without Javascript.

Just try it out.

The patch looks bigger than it is, as it moves a big of code around.

The first patch attached requires both #396466: Support custom success callbacks in ahah.js and #323112: Vertical Tabs, for easier testing or functionality review use vt_modules_search_frh_combined.patch one which includes both depending patches.

AttachmentSizeStatusTest resultOperations
vt_modules_search_frh.patch9.43 KBIdleFailed: 10490 passes, 0 fails, 1 exceptionView details | Re-test
vt_modules_search_frh_combined.patch31.79 KBIdleFailed: 10490 passes, 0 fails, 14 exceptionsView details | Re-test

#1

Frando - March 9, 2009 - 20:34

screenshots

edit: in the patch I changed some strings after I made the screenshots. The vertical tab is actually called "Search results" in the patch, and the search fieldset at the top is called "Search modules".

AttachmentSizeStatusTest resultOperations
modulesearch1.png131.8 KBIgnoredNoneNone
modulesearch2.png115.2 KBIgnoredNoneNone

#2

Frando - March 9, 2009 - 20:50

It has been noted in #drupal-usability that it would be great to better visually integrate the search field into the table. I will try to work on that tomorrow.

#3

System Message - March 9, 2009 - 21:10
Status:needs review» needs work

The last submitted patch failed testing.

#4

Frando - March 10, 2009 - 15:00
Status:needs work» needs review

New patch attached!
Thanks to the improvements in the vertical tabs patch, styling now is much much better in garland. I also added descriptions to the categories, and everything works quite a bit smoother (less flickering) because I improved the Javascript so that upon a new search (hitting enter key or clicking search) no new tab is created, but the existing one is replaced with the new one and the behaviours are copied over. Also improved docs.

The patch still depdends on #396466: Support custom success callbacks in ahah.js and #323112: Vertical Tabs, and the combined patch includes both other patches and goes directly against HEAD.

AttachmentSizeStatusTest resultOperations
vt_modules_search_frh.patch11.7 KBIdleFailed: 10551 passes, 0 fails, 1 exceptionView details | Re-test
vt_modules_search_frh_combined.patch44.36 KBIdleFailed: Failed to apply patch.View details | Re-test

#5

Frando - March 10, 2009 - 15:01

screenshots

AttachmentSizeStatusTest resultOperations
modulesearch3.png137.92 KBIgnoredNoneNone
modulesearch4.png125.23 KBIgnoredNoneNone
modulesearch5.png113.07 KBIgnoredNoneNone

#6

System Message - March 18, 2009 - 01:50
Status:needs review» needs work

The last submitted patch failed testing.

#7

moshe weitzman - April 13, 2009 - 02:07

Oh my - lets *please* refresh this patch and push it in.

#8

rickvug - April 13, 2009 - 07:21
Issue tags:+User interface

Some initial feedback based on screenshots:

Search is excellent and badly needed. All power users I know use their browser's find-on-page functionality.

I'm torn about using Vertical Tabs here. The positives are the added information ("28 modules, 9 enabled") and the reduced scroll length of the page. The downsides are that you can no longer scroll through all modules at once and there is less width for the descriptions, especially when enabled. For an example, see the enabled "Database logging" in http://drupal.org/files/issues/modulesearch4.png.

IMO, the tabs worked very well on node add page because it compressed and hid a number of options that can often be skipped. The spacing also worked because there was little within each fieldset. This use case is different and perhaps a little less clear. I'm not for or against the change at this time. However, I would caution that we need to set guidelines for when to use Vertical Tabs so there is consistency throughout core.

#9

catch - April 13, 2009 - 11:32

Just a quick note that CTRL-F on the modules page as it is currently is completely useless - if you have modules with dependencies, you might have to scroll through 20 results (if searching for 'views' or 'i18n' for example) before you get to the module you actually want to enable or disable. So massive +1 for the search - hoping we can skip dependencies with it and maybe include system names for modules as well - but haven't tested this so it might already be in there.

Is there a reason that search and vertical tabs have to be in the same issue?

#10

moshe weitzman - April 13, 2009 - 12:13

search and vertical tabs are in the same issue because they probably touch the same code and then we would have dependant patches which are really hard to maintain.

#11

greenSkin - April 14, 2009 - 22:33

I'm definitely interested in a way to find specific modules in the modules list put into core. For those of you who don't know, Module Filter does this sort of thing for Drupal 6. Module Filter adds a textfield to the module list form that when typed into simply hides modules that don't contain the inputed string in the module's name, and when a fieldset has no visible modules listed then the fieldset is hidden. The module also provides vertical tabs, via a setting, with the first tab simply being a list of all modules in alphabetical order. With the tabs option and without, the modules are only hidden and not removed so any changes that are made are held when submitted.

I was looking to start migrating the module to Drupal 7 but found discussions of vertical tabs in 7 core and the possibility of searching the list of modules so I have held off and will help out if needed in getting something like Module Filter into core.

#12

Frando - April 22, 2009 - 11:39
Status:needs work» needs review

So here is a reroll that is now based on vertical-tabs.js as it is in core now.
This actually made the patch get quite a bit smaller.

Screenshots remain the same as the last ones posted, functionality as well.

The patch still depends on #396466: Support custom success callbacks in ahah.js, which got much simpler now thanks to a good suggestions by quicksketch.

So for testing this, apply this patch and then the one attached to this post.

AttachmentSizeStatusTest resultOperations
vt_modules_search_frh.patch11.97 KBIdleFailed: Failed to apply patch.View details | Re-test

#13

kkaefer - April 22, 2009 - 18:48

I'm a bit concerned about the overall page width when we add vertical tabs. Maybe we should instead create horizontal tabs (the API is already there) or reduce the width of the tabs on this page.

#14

Bevan - April 22, 2009 - 20:09

I don't think this patch makes the modules page any easier to use. It needs to be made simpler; (Read: remove shit from the UI), This patch only adds stuff to the UI.

I would suggest that this UI needs some more thought, research, design and prototyping. Perhaps just the search filter without out the tabs? What if it had live, as-you-type-it results? Does it search the module description too? Or just the module name? There are many other ways to present the modules page UI, and clearly collapsible fieldsets is not a very good one, but I'm not sure this is much of an improvement.

#15

Bevan - April 22, 2009 - 20:19
Issue tags:+vertical tabs

tagging

#16

Bojhan - April 24, 2009 - 16:22
Status:needs review» needs work

I need to review this later, however I am on the same page as Bevan. Mostly due to it not really changing the table, but soley the grouping. While the table is broken, even more then the grouping.

Marking it needs work, for this weekends sprint.

#17

chx - June 2, 2009 - 03:50

#18

ica - June 18, 2009 - 01:34
Category:bug report» feature request
Status:needs work» active

while this improvement in the works for the modules management would you consider 'client-side dependency checking' feature
-currently provided by a contrib http://drupal.org/project/qamodules

plus

a selector > turn off all contrib. modules feature (when the 'core -required-' modules tab on)
-especially needed for core before updates and during a maintenance work etc.
-currently provided by a contrib http://drupal.org/project/contrib_toggle

that would give yet additional ux improvement in the core without the need for contrib modules that provide those small but useful functions for modules management

#19

chx - June 18, 2009 - 06:17

I think the incremental filter is a good idea here but the vertical tabs are not really. Let's do that later. And while it'd be better if we would be able to do a lot better page for now we do not have a better idea than the filter.

#20

mcrittenden - August 24, 2009 - 14:36
Status:active» needs work

+1 for incremental filter. Would be great to get a patch going without the vertical tabs before code freeze, unless there's already one lurking in another issue that I'm unaware of.

#21

yoroy - August 24, 2009 - 16:11

http://drupal.org/node/538904 has more general modules page discussion and outlines goals we want to achieve when redesigning it.

#22

Bojhan - September 28, 2009 - 20:36
Title:searchable modules page with vertical tabs!» Searchable modules page
Priority:normal» critical
Assigned to:Frando» Anonymous

Changing the scope of this issue, to a search able module page. This seems like functionality that is required, when you have a lot of modules installed and if you wish to find your module (since in browser search doesn't work due to dependencies)

I'd like to refer to #229193: Incremental filter for permissions page , where a similar issue was trying to be solved. Lets make this a somewhat generic pattern so it can be scaled to other places.

#23

kkaefer - September 29, 2009 - 19:38
Status:needs work» needs review

This is the initial version of InstaSearch.

There are three types of elements:

  • Containers: Each container is a region in which you can search for items. Containers have the class instasearch-container.
  • Items: An item is a DOM element that should be displayed or hidden depending on what the user typed into the filter textfield. Each element with the class instasearch-item becomes an item.
  • Ignores: If an item contains certain elements that should be ignored when searching (e.g. the “More Help” links in the modules listing), it should have the class instasearch-ignore.

Doesn’t tackle the zebra striping problem.

AttachmentSizeStatusTest resultOperations
64e21cc4.patch4.31 KBIdlePassed: 13696 passes, 0 fails, 0 exceptionsView details | Re-test

#24

kkaefer - September 29, 2009 - 19:41

The search field should probably be formatted in a more visually appealing way.

#25

Rob Loach - September 29, 2009 - 22:13

Awesome patches in the Drupal 7 issue queue!

#26

sun - September 29, 2009 - 22:46

We don't abbreviate CSS class names, so please rename "instasearch" to "instant-search". Otherwise, this looks quite promising.

I'm a little bit worried about the co-ordination of UX issues, since this is mainly targeting the modules page, but the modules page is about to be revamped.

#27

yoroy - September 29, 2009 - 23:26

sun: having a filter like this is part of that revamp

#28

kkaefer - September 29, 2009 - 23:33

sun: the script is not specific to the modules page but could be applied to any page. It uses class names (as outlined above) to do filtering.

When we have tabledrag, why can't we have instasearch?

#29

mcrittenden - September 30, 2009 - 12:28

I'm not sure if this warrants its own CSS file for just one rule, unless you're going to need to add a good bit more to it. Otherwise, seems like system.css would be better suited.

#30

Dries - September 30, 2009 - 12:36

Given that this is a new feature, I'd prefer to put this on hold until some more "Slush exceptions" made it in. We only have 2 weeks left, so let's make sure to focus.

#31

chx - October 2, 2009 - 06:03

This is UX which should be fine even past slush.

#32

mattyoung - October 2, 2009 - 06:11

.

#33

Bojhan - October 3, 2009 - 00:31

Either way, I just tested it - it seems to work oke - however we could probably do with a better empty message. I am assuring the coordination of issues, is done well. This issue can be taken in separation from the other, it shouldn't influence its design.

#34

SeanBannister - October 5, 2009 - 11:08

sub

#35

kkaefer - October 11, 2009 - 13:48

Still doesn't detect pastes correctly.

AttachmentSizeStatusTest resultOperations
7d894ab1.patch6.14 KBIdlePassed on all environments.View details | Re-test

#36

skilip - October 11, 2009 - 16:07

#37

System Message - October 13, 2009 - 14:13
Status:needs review» needs work

The last submitted patch failed testing.

#38

ksenzee - October 13, 2009 - 14:53
Status:needs work» needs review

HEAD was broken. Resetting status.

#39

skilip - October 13, 2009 - 18:25

How about this patch? It's been discussed here: #598738: Modules page: add Search box for filtering by module name. It adds a tablefilter behavior to the Drupal behaviors object and attaches the behavior to the module table. Don't forget to put tablefilter.js into the /misc directory.

AttachmentSizeStatusTest resultOperations
tablefilter.js_.txt1018 bytesIgnoredNoneNone
tablefilter-598738-1.patch1.31 KBIdleFailed: 13820 passes, 0 fails, 3 exceptionsView details | Re-test

#40

System Message - October 13, 2009 - 18:52
Status:needs review» needs work

The last submitted patch failed testing.

#41

eigentor - October 14, 2009 - 00:07

#23 works pretty much the same as skilips patch, you enter some letters, and it searches in both title and description (I guess in any text in the table), and filters down the table accordingly as you type.

Still a label for the search field and the nice inline text inside the input that disappears as you start to type (as here http://www.web-source.net/javascript_disappearing_form_text.htm) would be better. So best combine the features of both patches ...

@kkaefer: could you please reroll the patch against the latest dev? There are heavy offsets meanwhile... Still I was able to apply the main part.

Also there is a css property in the reset part of seven that sais "border:none" for inputs that makes the search input field strangely invisible.

Would be great to get one of those in...

If it is rerolled, it would get an rtbc from me.

@skilip: you can add a new file in the way konstantin did in the first lines of his patch:
--- /dev/null
+++ misc/instasearch.css
by first removing it somehow with the /dev/null.
Not sure if only git can do that kind of patching... my cygwin with an -up flag could not.

So no need for manual adding of files and you get more reviews...

#42

eigentor - November 2, 2009 - 14:16
Issue tags:+D7UX

added d7ux tag

#43

Scott Reynolds - November 5, 2009 - 17:18

@skilip: you can add a new file in the way konstantin did in the first lines of his patch:
--- /dev/null
+++ misc/instasearch.css
by first removing it somehow with the /dev/null.
Not sure if only git can do that kind of patching... my cygwin with an -up flag could not.

diff -upN or cvs diff -upN. But read up on adding new files here http://drupal.org/patch/create and this: http://wimleers.com/blog/cvs-diff-new-files-fakeadd

#44

Bojhan - November 18, 2009 - 17:05
Status:needs work» needs review

Can anyone still work on this?

#45

eigentor - November 19, 2009 - 14:36

@Bojhan we just gotta get someone to reroll one of the two patches.

#46

eigentor - November 21, 2009 - 04:00

Rerolled Konstantins Patch.

It appears to work fine, also when you paste somthing into the search box.

AttachmentSizeStatusTest resultOperations
searchable.patch5.85 KBIdlePassed on all environments.View details | Re-test

#47

Dries - November 21, 2009 - 08:55

Why not use your browser's search feature?

#48

skilip - November 21, 2009 - 09:04

@Dries: CTRL + F is just a workaround for a usability problem of the module's page.

#49

eigentor - November 21, 2009 - 11:45

@Dries Me or you or any geeky person can do that. But not less tekky ones. Actually even I have spent quite some time searching instad of using Ctrl + F.
Plus: this even works when you collapse the package groups on modules page with Admin Menu. It does not open the fieldsets, but it shows only those fieldsets that contain search results.

#50

yched - November 21, 2009 - 13:56

Additionally, CTRL-F forces you to tab through false positives that appear "somewhere" in the page - notably hidden in admin_menu's menu tree.

#51

eigentor - November 21, 2009 - 17:00

yes, the filtering down is nice and clean - leaves only few results on the page.

#52

heather - November 21, 2009 - 19:37

This is a very lovable patch.

I would certainly like this. I use find in page and this would be a big improvement. I would be annoyed however if it was all hidden in vertical tabs.

The patch is very good.

I recorded myself using it for the first time.

http://screencast.com/t/Zjk1NjdiYzA Watch me struggle! fun!

At 1'43" I discover that the choices don't reset to default 'full' view when you clear the text field. This seems like it should. Otherwise subsequent searches can give empty results when there is something there.

At 2'50" - 3'24" I discover it searches the modules, but not the collapsed container titles. Like, what if I am searching for CCK, not Content. There may be a grouping of modules I want to go to like 'Other'... Does that matter?

#53

eigentor - November 21, 2009 - 20:35

I can confirm the filter does not read Fieldset labels, but only inside the tables. So, e.g. filtering for "core" gives an empty result.

The resetting (and thus viewing all fieldsets when emptying the box) works fine from me, if I delete the letters one by one.
But If I highlight all text in the box and then delete it, there is no reset. Only a page reload resets the page then.

#54

heather - November 21, 2009 - 20:26

Eigentor called me on something. I put in the .js from an earlier patch... because... well i get confused sometimes. I thought it should be in there.

So: just to prove the problem... I made yet another video, this time shorter, just as amusing.

http://screencast.com/t/MTk1NjQ4OTEt

It seems when you search for items in the core listing, then delete, the choices don't reset.

#55

dereine - November 21, 2009 - 20:59

I could reproduce this too. You have to reset by selecting the field and remove the content together.
I fixed this by removing every instasearch-has-no-content class, if no value is in the box.

Yes i also don't like the name. Suggestion: instasearch -> instant-search

AttachmentSizeStatusTest resultOperations
searchable.patch5.63 KBIdlePassed on all environments.View details | Re-test

#56

heather - November 21, 2009 - 21:11

@dereine #55 works! that error is gone.

looks great.

i'd RTBC this but looks like you want to rename the class.

i wish you could also search titles of collapsed sections, but i understand it's just module names.

#57

eigentor - November 21, 2009 - 21:19

#55 appears to fix the problem with the incorrect reset when one highlights and then deletes the content of the search field.

Filtering by Fieldset name: This may introduce more confusion than it helps: e.g. you look for the "pathauto" module, but instead you get the entire fieldset "Pathauto" that may contain many modules. So you are not really narrowing down to what you were searching for, you get the entire fieldset. Especially bad this might be with searching for "Core" or "Übercart", for this search would be very fuzzy...

#58

sun - November 21, 2009 - 21:28
Status:needs review» needs work

+++ misc/instasearch.js
@@ -0,0 +1,116 @@
+Drupal.instasearch = function (container) {

This still needs to be renamed. We do not abbreviate names in Drupal.

Additionally, even when removing the abbreviation, the name provides absolutely no clue about what this is for.

It seems like this is less about searching, but about filtering, filtering DOM elements, to be more concrete.

+++ misc/instasearch.js
@@ -0,0 +1,116 @@
+  var filter = function () {

At least this function should be publicly accessible (and replacable). Changing the entire object/method structure of this thingy wouldn't hurt either though.

+++ modules/system/system.admin.inc
@@ -791,6 +792,24 @@ function system_modules($form, $form_state = array()) {
+  $form['#attributes']['class'] = 'instasearch-container';

What if I want more than one filter on my page?

This needs to be an ID and the JS should be passed JS settings to invoke the filtering for a certain ID.

+++ modules/system/system.admin.inc
@@ -791,6 +792,24 @@ function system_modules($form, $form_state = array()) {
+  $form['#attached_js']['misc/instasearch.js'] = array();

Obsolete.

I'm on crack. Are you, too?

#59

dereine - November 21, 2009 - 21:30
Status:needs work» needs review

Update:
- Rename instasearch to instant-search and instant_search
- Removed + $form['#attached_js']['misc/instasearch.js'] = array(); Because this could cause double calls to drupal_add_js
I'm not sure about the last

AttachmentSizeStatusTest resultOperations
searchable.patch5.63 KBIdlePassed on all environments.View details | Re-test

#60

dereine - November 21, 2009 - 21:33
Status:needs review» needs work

Reset status.

#61

eigentor - November 21, 2009 - 21:55

There was another approach in #39, which had a much shorter patch. Maybe you could give it a review, too.

I did not reroll this one because it did not render the search box in a nice way.

#62

kkaefer - November 22, 2009 - 10:09

"instaSearch" was supposed to be a proper name, like "Drupal". Not an abbreviation. Anyway, we also don't use underscores in JavaScript function names but camelCase. Thanks for helping land this patch!

#63

mcrittenden - November 22, 2009 - 14:53

@dereine, did you attach the right patch in #59? Looks like the changes you mentioned weren't actually changed.

#64

kkaefer - November 22, 2009 - 15:09

Updated to resolve patch error

AttachmentSizeStatusTest resultOperations
instasearch.patch5.73 KBIdleUnable to apply patch instasearch.patchView details | Re-test

#65

dereine - November 22, 2009 - 15:43

kkaefer: you missed to add --no-prefix to git diff

#66

skilip - November 22, 2009 - 21:05

Sorry for jumping in lately, that's my thing... Just haven't got the time (which is going to change soon luckily).

Couldn't we think of this more like a table filter behavior? The input filter field would be attached to a table (in this case the modules table) by just adding a class 'tablefilter' to the table. Imagine having this filter option on the permission page!!! It's just a few steps away!

The patch I placed @#39 provides most of that functionality.

#67

kkaefer - November 22, 2009 - 22:27

#68

eigentor - November 23, 2009 - 03:54
Status:needs work» needs review

#69

System Message - November 23, 2009 - 04:11
Status:needs review» needs work

The last submitted patch failed testing.

#70

skilip - November 23, 2009 - 06:25

@kkaefer: about the permission page patch: that's awesome! About the patch here: I would really prefer having the input textfield being placed by JavaScript instead of by FAPI. Since there's no use for degradability, the input field can be omitted when js is turned off.

#71

eigentor - November 23, 2009 - 12:16

skilip: Well if so, it has to be done better than in the patch of #39. I tried that out, and the input field got rendered in the middle of nowhere... (strange positioning inbetween some other div elements).

#72

eigentor - November 24, 2009 - 22:14
Status:needs work» needs review

Updated kkaefers patch and removed some errors with a/ and b/ folders in Git that broke it.

@dereine: is there anything apart from the naming (instasearch or instant-search...) keeping this from being ready?

@Sun: you had quite some concerns. Apart from the naming - maybe you could reroll it and integrate it?

I wonder if this needs a lot of polish, since I guess we will not reuse it a lot, apart from some other tables in Drupal?

AttachmentSizeStatusTest resultOperations
instasearch-new.patch5.99 KBIdlePassed on all environments.View details | Re-test

#73

greenSkin - November 25, 2009 - 04:23

Could name it elementFilter.

#74

catch - November 25, 2009 - 04:39

Just to reiterate yoroy's point about CTRL-F not working.

On the modules page, something like 'token' can appear anything up to 20-30 times because we show module dependencies with 'requires' and 'required by'. Same for i18n (which has dependencies in both directions), this makes CTRL-F completely useless for finding anything on the page. In some cases I've resorted to remembering fragments of text in the module description then using those - more recently, while I'll often still browse the the modules page out of force of habit, even when I'm there, it's almost always quick to alt-TAB to terminal than use drush than to use CTRL-F.

#75

greenSkin - November 25, 2009 - 05:13

@catch Check out Module Filter for a Drupal 6 solution for finding modules fast. It is clearly not as neat and tidy as the work being done here, but it does meet a general need in Drupal 6 for now.

Will this functionality be available on the permissions page? The same functionality could be useful on the admin blocks page as well.

#76

skilip - November 25, 2009 - 08:56

Hopefully this one passes testing. The patch merges both kkaefer's patch and mine. I removed indexing the data, since my browses crashed during the indexing process. I really think 'tablefilter' is a better name than 'instasearch', since the filtering only applies to tables. Let me know if I forgot something or left out any indispensable functionality of kkaefer's patch.

AttachmentSizeStatusTest resultOperations
tablefilter-396478-2.patch8.69 KBIdleFailed on MySQL 5.0 ISAM, with: 15,290 pass(es), 0 fail(s), and 2 exception(es).View details | Re-test

#77

System Message - November 25, 2009 - 09:31
Status:needs review» needs work

The last submitted patch failed testing.

#78

skilip - November 25, 2009 - 11:15
Status:needs work» needs review

Rerolled, hopefully fixing last test failures.

AttachmentSizeStatusTest resultOperations
tablefilter-396478-3.patch8.72 KBIdleFailed on MySQL 5.0 ISAM, with: 15,298 pass(es), 0 fail(s), and 1 exception(es).View details | Re-test

#79

System Message - November 25, 2009 - 11:31
Status:needs review» needs work

The last submitted patch failed testing.

#80

skilip - November 25, 2009 - 12:08
Status:needs work» needs review

Bummer!!

AttachmentSizeStatusTest resultOperations
tablefilter-396478-4.patch8.72 KBIdlePassed on all environments.View details | Re-test

#81

mcrittenden - November 25, 2009 - 13:35

Will this functionality be available on the permissions page?

Good point. While this patch here doesn't necessarily need to make itself available on the permissions page as well, it does need to implement incremental filters in a way that can be easily used elsewhere, or else we'll risk a repeat of the Dashboard patch (except with incremental filter instead of drag and drop).

#82

kkaefer - November 25, 2009 - 15:17

#83

skilip - November 25, 2009 - 15:37

@mcrittenden: the filter can be applied to all tables, or groupings of tables.

#84

mcrittenden - November 25, 2009 - 15:45

the filter can be applied to all tables, or groupings of tables.

Nice!

#85

eigentor - November 26, 2009 - 03:10

Can just review the function: works just as well as Konstantins patch.

would like a Review from the cody persons.

Sun? dereine?

#86

stella - November 26, 2009 - 22:07

This new functionality is great - major improvement!

Just a couple of things that weren't that clear to me:

+++ misc/instasearch.js 24 Nov 2009 22:06:28 -0000
@@ -0,0 +1,116 @@
+Drupal.instasearch = function (container) {

what's "instasearch"? "instant search"? I thought we never abbreviated variable names.

+++ misc/instasearch.js 24 Nov 2009 22:06:28 -0000
@@ -0,0 +1,116 @@
+        if (elem.childNodes[i].nodeType != 8)
+          ret += elem.childNodes[i].nodeType != 1 ?
+            elem.childNodes[i].nodeValue :

Not entirely sure what nodeType is and what the significance of nodeType = 8 is. Maybe a comment should be added here.

I'm on crack. Are you, too?

#87

skilip - November 26, 2009 - 22:17

@stella: which patch did you review?

#88

stella - November 26, 2009 - 23:49

Crap, yeah, I reviewed the patch from #72. This one makes waaay more sense :) Couldn't really find anything wrong with it - just minor typos and grammar errors in the comments.

+++ misc/tablefilter.js 25 Nov 2009 08:45:32 -0000
@@ -0,0 +1,180 @@
+  // Create a reference and define it's variables.

just a grammar thing, here and elsewhere, it should be "its" rather than "it's"

+++ misc/tablefilter.js 25 Nov 2009 08:45:32 -0000
@@ -0,0 +1,180 @@
+   * FIlteres all affected table rows for the given string.

Just a typo - should be "Filters"

+++ misc/tablefilter.js 25 Nov 2009 08:45:32 -0000
@@ -0,0 +1,180 @@

There's trailing spaces on some lines.

+++ misc/tablefilter.js 25 Nov 2009 08:45:32 -0000
@@ -0,0 +1,180 @@
+      // Create a unique idetifier for the new tablefilter instance.

typo

+++ misc/tablefilter.js 25 Nov 2009 08:45:32 -0000
@@ -0,0 +1,180 @@
+      window.table_filter_index = (window.table_filter_index == undefined ?  0 : window.table_filter_index + 1);

Should only use one space between ? and 0.

+++ misc/tablefilter.js 25 Nov 2009 08:45:32 -0000
@@ -0,0 +1,180 @@
+      // Specify which element is the container of the table(s) on which to applie the behavior.

typo "applie"

This review is powered by Dreditor.

#89

yoroy - November 26, 2009 - 23:59
Status:needs review» needs work

thank you stella. Needs work for last touchups then.

#90

skilip - November 27, 2009 - 08:19
Status:needs work» needs review

@stella: Thanks for reviewing!

AttachmentSizeStatusTest resultOperations
tablefilter-396478-5.patch8.72 KBIdlePassed on all environments.View details | Re-test

#91

System Message - November 27, 2009 - 08:31
Status:needs review» needs work

The last submitted patch failed testing.

#92

skilip - November 27, 2009 - 14:22

Can anyone explain to me why this patch failed on 'ForumTestCase'?

#93

catch - November 27, 2009 - 14:25
Status:needs work» needs review

HEAD is broken.

#94

System Message - November 27, 2009 - 15:50

yched requested that failed test be re-tested.

#95

Bojhan - November 27, 2009 - 17:28
Status:needs review» reviewed & tested by the community

I am going to be bold and mark this RTBC, it seems stella given it a review - kkaefer proofed this code was applicable to the permission page filter and dereine chimed in. Skilip finished the work, so this seems good to go.

#96

kkaefer - November 27, 2009 - 17:51
Status:reviewed & tested by the community» needs work
  • container[0].tagName.toLowerCase() == 'form'

    Please use something like container.is('form') instead of relying on the DOM.
  • We should use a JavaScript theme function for that button instead of creating it programatically.
  • ...attachEventListeners = function() {

    Do we really need a separate function for two lines of code that is only called in one location?
  • Why is the patch now restricted to filtering tables only? The previous version didn’t have that restriction and could for example be used for lists as well.
  • Why did you remove the index? Did you conduct performance tests without the index? The previous version probably works a lot faster with many elements.
  • Since the text field is programatically generated, it’s harder to impossible to customize the test for various locations.
  • Drupal.tablefilters[settings.id] =  new Drupal.tableFilter(container, settings);

    Drupal.tablefilters[settings.id].init();

    Why do we have to call init separately instead of calling it in the constructor?
  • Is there a reason why we don’t use prototype but extend the object with this.ref?
  • There’s zebraing code in tabledrag.js already (Drupal.tableDrag.prototype.restripeTable). We should refactor that code into a more generic function and reuse it instead of duplicating it.

#97

sun - November 27, 2009 - 17:58
Status:needs work» needs review

+++ includes/theme.inc 25 Nov 2009 08:45:32 -0000
@@ -1659,6 +1659,11 @@ function theme_table($variables) {
+  // Attach tablefilter behavior, if required.
+  if (isset($attributes['class']) && in_array('tablefilter', $attributes['class'])) {
+    drupal_add_js('misc/tablefilter.js');
+  }
+++ modules/system/system.admin.inc 25 Nov 2009 08:45:33 -0000
@@ -791,7 +792,15 @@ function system_modules($form, $form_sta
+  $form['#attached'] = array(
+    'js' => array(
+      array(
+        'data' => array('tablefilter' => array('system-modules' => array('label' => t('Filter modules'), 'description' => t('Enter the name of a module to filter the list.')))),
+        'type' => 'setting'
+      ),
+    ),
+  );

uh oh. We want to introduce a drupal_add_tablefilter() function instead, which takes a named array of settings:

$form['#attached']['drupal_add_tablefilter'][] = array(
  'label' => t('Filter modules),
  'description' => t('...'),
);

and adds the required JavaScript along with the JS settings.

This function should optionally support a (forced) 'id', but by default, it should take over the #id from the element it is attached to.

+++ misc/tablefilter.js 25 Nov 2009 08:45:32 -0000
@@ -0,0 +1,180 @@
+  // Create a reference and define its variables.

This can be removed.

+++ misc/tablefilter.js 25 Nov 2009 08:45:32 -0000
@@ -0,0 +1,180 @@
+  var ref = this;

This should be

var self = this;

+++ misc/tablefilter.js 25 Nov 2009 08:45:32 -0000
@@ -0,0 +1,180 @@
+  ref.textfield;

Weird. What's the purpose of this?

+++ misc/tablefilter.js 25 Nov 2009 08:45:32 -0000
@@ -0,0 +1,180 @@
+  ref.init = function() {

(and elsewhere) Missing space after "function".

+++ misc/tablefilter.js 25 Nov 2009 08:45:32 -0000
@@ -0,0 +1,180 @@
+    if (ref.textfield[0]) {

What's that condition?

+++ misc/tablefilter.js 25 Nov 2009 08:45:32 -0000
@@ -0,0 +1,180 @@
+   * Filteres all affected table rows for the given string.
+   * All table row containing the string will stay visible, while other rows are hidden.

Typo in "Filteres" and missing blank line after summary. Description is not wrapping at 80 chars.

+++ misc/tablefilter.js 25 Nov 2009 08:45:32 -0000
@@ -0,0 +1,180 @@
+    // Walk through each tbody inside the container element.
+    container.find('tbody').each(function() {

Not sure why we need to limit this to tables, but we can investigate in a follow-up.

I'm on crack. Are you, too?

#98

sun - November 27, 2009 - 18:10

Additionally....

Did anyone consider http://rikrikrik.com/jquery/quicksearch ?

Compared to the code here, that looks quite advanced + awesome.

#99

kkaefer - November 27, 2009 - 18:24

Not sure about quicksearch. IMO, the code doesn't look "advanced" and has some weird constructs in them. E.g., it relies heavily on the element structure. It also doesn't seem to allow for filtering lists (or anything except for tables).

#100

skilip - November 30, 2009 - 10:24

Ok, rerolled the patch including sun's and kkaefer's suggestions. Thanks btw!

@kkaefer: Using an generic 'tableRestripe' function would be awesome, but is out of the scope of this patch. I removed the index while my browser completely hangs during the indexing process (Safari Snow Leopard Macbook Pro).

@sun: I'm not sure how to apply a drupal_add_tablefilter function. Could you help me out?

The patch currently is only restricted to tables while I don't see the need (ATM) for building extra functionality which is probably not used in core. Maybe we can write another patch when the need for filtering other DOM elements occurs.

AttachmentSizeStatusTest resultOperations
tablefilter-396478-6.patch6.27 KBIdlePassed on all environments.View details | Re-test

#101

sun - November 30, 2009 - 12:18
Status:needs review» needs work

Patch contains the JS only.

#102

eigentor - November 30, 2009 - 12:36
Status:needs work» needs review

Er - I think I remember you speaking about adding the input just by javascript.
As the patch does not change system.admin.inc nor any css file, I guess it is up to that.
Still - I don't see any input field on my Modules page.

As for people opposing to add the input per JS - In this case this probably makes sense because the filter won't work anyway if there is no Javascript.

#103

skilip - November 30, 2009 - 12:45

Sorry :-[

AttachmentSizeStatusTest resultOperations
tablefilter-396478-7.patch9.44 KBIdlePassed on all environments.View details | Re-test

#104

skilip - November 30, 2009 - 12:47

I've tested this behavior on the permission page with 500+ table rows. It's a bit slower but fast enough on my browser. Anyone willing to test it on a Windows machine with IE?

#105

eigentor - November 30, 2009 - 13:56
Status:needs review» reviewed & tested by the community

While still being unable to judge the patch from a coder's perspective, it works as well as the others. So to speed this a bit up, I'll set it RTBC.

Only one day to go...

#106

eigentor - December 3, 2009 - 15:14

hm this has been sitting in RTBC for quite a while... Will it make it in?

#107

yoroy - December 4, 2009 - 11:10

Patience my dear! Core committers have a snapshot of what was RTBC on 1 december, they will get to it eventually.

#108

eigentor - December 4, 2009 - 11:18

yoroy ah :)
I thought of something like that.
Hehe Zielfoto

#109

mrfelton - December 13, 2009 - 15:50

1 problem with this as far as I can see... Type the text 'help' 'permissions' or 'configure' in the filter box and it filters based on those terms in the Operations column. Is that intended behaviour? Seems a little odd to me. Shouldn't it be more selective about what is searched - as in use only the Name and Description columns... though it may be handy to search by version too.

#110

eigentor - December 14, 2009 - 11:06

mrfelton well this is not nice, but I think not too bad.
If we want to make it selective, it would have to adress every table exactly, which opposes to the plan of making this a general UI element.

Though in followups this could be adressed. First we got to convince Dries this is a good concept at all. Short video for showing this is in the making ;)

#111

mrfelton - December 14, 2009 - 12:07

@eigentor: I'm 100% sure this is a good feature! Just needs a little tuning in my eyes.

#112

eigentor - December 16, 2009 - 19:52
Status:reviewed & tested by the community» needs review

Updated the patch to keep up with head

AttachmentSizeStatusTest resultOperations
tablefilter-update.patch9.39 KBIdlePassed on all environments.View details | Re-test

#113

Bojhan - December 16, 2009 - 21:02
Status:needs review» reviewed & tested by the community

Works

#114

eigentor - December 17, 2009 - 21:21

As the question to solve is wheter Ctrl+F4 isn't enough for searching, up to the great
Filterbox vs Ctrl+F4 shootout http://vimeo.com/groups/drupalux/videos/8241438

Still the strongest reason for the filter box is not in the video: A not-so-geeky person doesn't even know there is a command like Ctrl+F4, and if they know it, they won't use it that fluently.

#115

chx - December 21, 2009 - 15:10

If you think this is unnecessary try to find views which half of the world depends on...

#116

System Message - January 2, 2010 - 19:50
Status:reviewed & tested by the community» needs review

Re-test of tablefilter-update.patch from comment #112 was requested by webchick.

#117

Bojhan - January 2, 2010 - 22:42
Status:needs review» reviewed & tested by the community

Still green

#118

aspilicious - January 2, 2010 - 22:44

My first patch applied succesfully i can confirm this is working great. Love this thing.

 
 

Drupal is a registered trademark of Dries Buytaert.