Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.