-
Notifications
You must be signed in to change notification settings - Fork 334
Feature: filter presets #1994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feature: filter presets #1994
Conversation
b4613d2 to
0409677
Compare
|
Hi, thanks for the PR! I see the ability to toggle filters more quickly as a useful feature but I don't think we should add a new configuration mechanism for this. To enable this via the existing sidebar links configuration (or bookmarks or whatever), I'd instead suggest creating a new URL route similar to jump that applies these filter transformations. Or even better, additionally, to enable (some parts of this feature) without having any specific configuration, how about storing recent filters and adding them to the dropdowns? For the time filter examples in your screenshot I'd expect that to work quite well. |
|
Hi, thanks for the reply!
What you imagine these urls to look like? Do I understand correctly that it would be something that just toggles specific value (e.g. tag) in the filter, if clicked, but via routing?
Do you mean browser's local storage? I've actually considered adding these to the dropdowns initially but:
As for sidebar links as an implementation, one reason I didn't go with this is that I already use those extensively. I have about dozen of presets for various pages, some with default time or advanced filter applied. Having more just makes the list less comprehensible (or asks for an ability to group links in the sidebar, for example). Also these "filter presets" are meant to be applied on top of already chosen path and to be combined together in various configurations. In any case, happy to keep in running in the fork on a side as it works well for me. But was wondering if there's anything code- or idea- wise that would be useful for the mainstream. |
Not frontend route, a flask HTTP endpoint. See the
Yes. It would be one extra click on use but not require any manual configuration (but if you want to have it immediately accessible, you could still add a sidebar link for it) |
|
This would be a useful feature! |
|
@jgauth thanks! if you're interesed in testing and using it, I patch Fava with this change relatively regularly to use in https://github.com/Evernight/lazy-beancount releases. |
Motivation
I really like the filters functionality and use it extensively. However, in most cases you have to type some text in the filter fields and that text is often repeated. There are values that I use more frequently than others (e.g. month-1 or month-11 to month-1 for time, or some specific tag or posting filter for the advanced filter). It would be nice to be able to use them without having to type anything.
Current workarounds
Creating and storing links in a sidebar, bookmarks, dashboards or elsewhere. But it doesn't allow to mix and combine filters together.
Also having to keep complicated Advanced filter strings somewhere in the notes.
Proposed implementation
Define filter presets in Fava config, similar to sidebar links.
If any presets are defined, display them in a strip that extends the header.
There are two types of presets: for time and advanced filters.
Time is pretty self-explanatory.
Advanced filters "toggle" on click so it's possible to combine them together separated by a space for AND logic. Uses simple substring match to avoid exposing lexer from Python (that overcomplicates things).
Actual value of the filter and its label are separate, especially relevant for Advanced filter that may look rather complicated (that's one of the reasons for this feature)
Screenshot
Notes
Currently doesn't include documentation or tests, will add if the feature is generally approved.