Is there a reason collapsible fieldsets is used *only* on the main settings page? What about the users setting page? That is really long and would benefit. And the uploads setting page, as you add more roles, that page can get really long too.

I think we should add this feature to all standard Drupal settings pages that are long like the settings page... it really helps and would make things look more consistent, instead of "why the heck is this on one page and not them all?".

Need to get this into the next release as well to be consistent with the approach of this new feature.

Comments

m3avrck’s picture

Status: Active » Needs review
StatusFileSize
new9.17 KB

I've gone through all of the settings pages for the included default Drupal modules and have applied the collapsible form fix. This really does make a *huge* difference... it makes the Settings interface more consistent and greatly improves readability. Let's get this one in! :)

Souvent22’s picture

Installed, and used the patched. Worked great. Much needed. :). +1

chx’s picture

-1 and +1 at the same time. +1 but only after the forms API is in -- it'd be better if we won't break the fastly evolving patch.

m3avrck’s picture

Status: Needs review » Active

Beat me to the post :) I just was reviewing the Forms API patch and realized this one is no longer applicable if that goes through.

chx, can you include the fixes in this patch with the forms api? it just makes a few extra menus 'collapsible' which with the new API, requires even less code change, haha!

m3avrck’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new9.17 KB

Rerolled against HEAD.

Since it seems the FORM api is going to go in *after* the freeze, this should go in now, so before any of the forms are updated to the new API (so this change is accounted for later instead of having to do another patch :))

m3avrck’s picture

Status: Reviewed & tested by the community » Active

Waiting for the Forms API commit now.

m3avrck’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new11.83 KB

Updated patch to work with the new Forms API. With chx's +1 from above I'd say this one is ready :-)

Stefan Nagtegaal’s picture

I *love* this! :-)

chx’s picture

Status: Reviewed & tested by the community » Needs review

drupal.org/patch/review

m3avrck’s picture

i'm confused, what is wrong with the patch? i'll fix it if you can be more specific, i can't fix it i don't know what is wrong.

Crell’s picture

While I agree that nearly all fieldsets should be collapsable, perhaps even by default, I do not agree with making so many of them collapsed by default. Frankly I dislike the admin/settings page right now, on the grounds that it's default appearance is now, um, useless. Sure it's short, but there's *nothing there* that is of any use to me until I start opening sections. I'd much rather have the first few "major" ones open by default and the rest closed.

Similarly, in this patch the upload.module settings page is collapsed by default. There's only a single fieldset on the page, and it has only a single field in it. So why is it collapsed by default, adding another click to my task every time I want to change that *one setting*? There's no improvement there, but a regression.

So -1 from me on this patch, and a request that we not get so carried away with the collapse=true setting. :-) Overusing it is dangerous, and I think we already are.

m3avrck’s picture

StatusFileSize
new12.96 KB

Crell I agree completely. I was trying to be consistent with the current approach.

But the biggest problem with Drupal is it is not consistent with how it implements things so that was the reason for this patch, to at least make it consistent.

However, I do think we need some sort of *rule* for settings, so I propose this:

On settings pages, if there is only one fieldset, it should be set to collapsible but be open by default. If there is more than 1 fieldset, then all fieldsets should be collapsed for maximum readability and scanning (e.g., no scrolling), unless the first fieldset is relatively compact, in which case, it may be open.

My patch updates drupal to such a convention. Let's get talking and then commit this (or similar).

pfaocle’s picture

StatusFileSize
new97.61 KB

+1 for m3avrck's suggested guidlines, and the patch seems to work fine.

There was some strange edits in the above patch, here's a revised one.

pfaocle’s picture

Status: Needs review » Needs work

Argh - ignore that one, problems with line breaks again. Two mins...

pfaocle’s picture

Status: Needs work » Needs review
StatusFileSize
new11.78 KB

That got it.

Crell’s picture

I agree that there needs to be some sort of standard for how to use collapsing fieldsets, but I'm not sure I agree with the one proposed. It's not always easier to scan the fieldsets when they're closed. Fieldset legends are not always the most descriptive :-), and not every page uses fieldsets in the first place.

m3avrck’s picture

StatusFileSize
new64.24 KB

4 months later, here is a newly updated patch and improved rules :-)

  1. All fieldsets should be collapsible. (patch to fix system_elements() so this always happens no need to remember)
  2. All fieldsets should be collapsed unless:
    • There is only one fieldset, in which case it should *not* be collapsed
    • If the first fieldset of many is *not* that long, it should be left open, if it takes up too much screen space it should be collapsed

And here's the patch. Note, in this process I cleaned up the formatting of a majority of the forms code in core. Just formatting, *no* actual changes.

So what's the big deal? Apply this patch. Notice instantly how much more usable most of core is. Why's that? Simple, it adheres to the first rule of usability, be consistent otherwise you confuse your users. Not to mention, beautiful code is easier to tinker with ;-)

m3avrck’s picture

StatusFileSize
new64.26 KB

bad patch, here's one that works.

m3avrck’s picture

StatusFileSize
new59.42 KB

And an even better one that doesn't accidently reencode a few strings, doh utf-8!!! ;-)

m3avrck’s picture

StatusFileSize
new59.46 KB

fixed one more after talking with rkerr.

m3avrck’s picture

StatusFileSize
new59.43 KB

oops wrong one again, doh! i'm too tired, last one for tonight.

rkerr’s picture

Patch applies and works as advertised. I think this is a good addition as it enforces consistency in the display of fieldsets.

+1

The specifics of exactly which fieldsets are collapsed can be discussed further but I think the consistent behaviour is worth having.

m3avrck’s picture

StatusFileSize
new59.89 KB

Updated against HEAD.

m3avrck’s picture

StatusFileSize
new59.46 KB

Updated against HEAD.

m3avrck’s picture

StatusFileSize
new9.91 KB

Ok new rules after talking with Morbus and Steven:

  1. All fieldsets are of type collapsible
  2. Fieldsets should only be collapsed when they *only* offer supplemental changes (e.g., node/1/edit, the main purpose of the form is title and body, all other options are supplemental).
    • If there are too many fieldsets on a page, or too many form elements, the fieldset should be collapsed (e.g., admin/settings, user/1/edit)

This new patch adheres to these changes and fixes formatting for a few forms.

After this, forms docs will be updated, and another patch will go into clean up the formatting of forms, along with removing redundant #collapsible ... make patches in small, editable chunks...

m3avrck’s picture

StatusFileSize
new10.68 KB

Updated patch, was missing 2 fieldsets.

m3avrck’s picture

StatusFileSize
new10.74 KB

Updated against HEAD.

webchick’s picture

I tend to agree with Crell on this, although it sounds like if Steven is in your camp we're outnumbered. ;) But imo, the first fieldset of settings pages should *always* be expanded, regardless if it's long or not, because otherwise pages like admin/settings are completely useless until you start clicking around on things.

As for the functionality of the patch, I tested it on a new HEAD install with all core modules enabled. Looks like the following got missed (there are multiple fieldsets, and all are expanded):

- drupal
- menus
- search
- statistics

But then these settings pages look strange in comparison because they have no fieldsets, collapsible or otherwise:

- aggregator
- blogapi
- content types (though wouldn't really fit)
- posts
- profile (though wouldn't really fit)
- throttle

Honestly not sure what the best policy is here, but things still feel inconsistent.

drumm’s picture

Status: Needs review » Needs work

I'd like to see these guidelines posted in the handbook first and patches posted separately since the design of each form stands on its own.

Code style- there needs to be a comma after every line of each array element, even the last one.

coreb’s picture

Version: x.y.z » 6.x-dev

moving from x.y.z to 6.x-dev version queue

webchick’s picture

Marked http://drupal.org/node/97478 a duplicate of this bug; the patch there might be a better starting point for 6.x; not sure.

Crell’s picture

Is this even still relevant with the refactored admin pages in Drupal 5? I'm inclined to mark won't fix / no longer relevant unless someone tells me not to. :-)

Crell’s picture

Status: Needs work » Closed (won't fix)

It's been a week and no one has told me not to. Feel free to reopen if still relevant.