Would love to hide the filter box by default

Hey, the filter box at the top of most of the pages in FarmOS are very large and not used most of the time, at least for our cases.

I think @paul121 made it so it was accordian’ed down by default at one point (so there’s a down arrow, you can click on to maximize it to it’s current size as desired), but I wanted to suggest maybe doing that all the time by default. I’m sure others use it, but it is really confusing for new people because they think it is the data (they don’t realize it’s a filter).

By minimizing them they are still there, but they just don’t take up as much space.

Thoughts on this? I know there’s some general UI changes desired so one could argue we should wait for that stuff / discussion, but It’s a lot of bang for the buck for us and maybe easy so maybe worth it.

2 Likes

We had made that same decision in v1 (for the same reasons) - but haven’t had a chance to replicate it in v2 yet with the new Gin theme. +1 from me!

Yep, I implemented this for the View of LOOC-C estimates provided in the farm_loocc module. I tried to implement it in a way that should work more generally and think it should work well, but must admit I haven’t fully tested this!

For farmOS core one great addition would be a feature to “remember” if the filters are open/closed for a give view, similar to how we “remember” if the toolbar was open or closed. We may also need a hook or another method to let custom views “opt in” to a collapsed filter as well.

Overall my approach was pretty simple changes:

Collapsed:

Expanded:

1 Like

If there is a good solution that’s able to pushed to core (perhaps yours Paul) that just needs some work (a few hours) to get in, I think we could add it to an existing project (CFT or COMET) in terms of hours. It’s one of those things that affects general usability and therefore is kind of a UX precursor to those things anyway.

1 Like

For farmOS core one great addition would be a feature to “remember” if the filters are open/closed for a give view

Agreed. And IIRC in v1 we also had some logic to expand it if a filter was actively being applied (so it wouldn’t be closed after you clicked “Apply” and the page refreshed). That would be nice too.

The right place for this logic would be in the farm_ui_theme module IMO.

1 Like

Just created an issue and opened a MR for this. I learned about views display extenders in the process, a really cool tool… see the videos in my comment: Allow views exposed filters to be collapsed [#3306344] | Drupal.org

1 Like

Agreed. And IIRC in v1 we also had some logic to expand it if a filter was actively being applied (so it wouldn’t be closed after you clicked “Apply” and the page refreshed). That would be nice too.

I implemented this! (open if the filter is being applied) But actually didn’t implement what I mentioned to “remember” if the filters are open/closed. I’m not sure if that would be helpful or actually just cause more confusion… but I think it could be easy to add in a follow up feature request. I think it may be nice to add another feature to “always open” the filters on some pages, but still allow them to be collapsible.

However right now it is possible to override the config on a per-view/page level to remove this behavior in case someone did not want the filters to be collapsible.

1 Like

Awesome @paul121!! I’ll take a look at your merge request - I’m eager to have this too!