Introduce a new customisable score property, allowing any number of user-named algorithms. #1162
Replies: 6 comments 5 replies
-
@claremacrae Letting the user define and name any number of custom "score" or "rank" functions that can be used to filter and sort tasks according to that score is a great idea! This would make the tool immediately much more customizable and flexible. The syntax for filters could then look like this:
And for sorting:
For example, Users could then also create score functions not only for urgency or importance, but for instance to check if a task or its heading contains certain keywords. Then these scores could be used in various views for filtering and sorting, but the check for the properties would stay centrally at one place in the score function, and you would only need to adapt the score function if keywords are added. Btw, it should be also possible to use these score functions in other score functions. So users can create simple score functions as building blocks for more complicated ones (like a combined urgency + importance score). |
Beta Was this translation helpful? Give feedback.
-
Thanks for the comments. Just for the record, I am by default strongly against designing features to make parts of the instruction optional. Either a word provides value or it doesn't. User-focussed reasonsReasons include: It makes things more complicated to explain in the docs, can open up ambiguity in future features, and adds a forever-overhead to all possible re-implementations of the parsing code. Making something that used to be mandatory optional, after realising it wasn't necessary, is a different thing, if it solves a real usability problem that has been observed after real-world usage. But designing in optional bits from the outset: I would strongly prefer not to do so. Maintainer-focussed reasonsAlso, in a commercial body of code, I would say that user experience trumps complexity of implementation. But in a volunteer project, PRs have a real cost:
Especially adding complexity to regex-based implementations is very expensive on my time as the maintainer - and all query-parsing is currently regex based, so extra flexibility in instructions has a significant overhead on my time, making less time available to implement other requested features. |
Beta Was this translation helpful? Give feedback.
-
A request which would be enabled by this feature: |
Beta Was this translation helpful? Give feedback.
-
"Optional" could mean: The option is there in the dialogue but will not show up in the rendered list if not used. This way, both completely valid points of @claremacrae and @Cito could easily be reconciled. |
Beta Was this translation helpful? Give feedback.
-
See also #2014. |
Beta Was this translation helpful? Give feedback.
-
I'm now experimentally working on #1479 - custom sorting. There are other requests about making it more convenient to re-use custom filters, custom grouping - and soon custom sorting, across searches. I feel that those facilities would be a more general thing than this request, which predated task expressions. So I'm marking this one as 'not planned'. This doesn't mean 'won't fix' - it means not likely to be done in the foreseeable future. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
This builds on ideas from #1157, which proposes breaking urgency down in to urgency, importance and some other name for combining the two.
This would obviously satisfy those who think in terms of the Eisenhower method, mentioned in that idea.
However, it's limited by the number of named values that we chose to provide, and we would need a UI to allow users to customise each one.
Suggestion
What if we implemented a new property called, for example,
score
, for which users could supply any number of named scoring functions.Rough sketch of possible features
Thinking aloud...
Defining the score functions
.js
file in that folder.my_score.js
would define a function that takes info about a Task and returns its scoreUsing the score functions in tasks blocks
Perhaps:
Or maybe we refer to it as
score:my_score
or something similar.Display
The score name can be included in the CSS class, so that users can style their different score values differently.
Differences from current custom urgency proposal
If we have a fixed number of urgency-type scores, then each time the user wants to switch to a different scorer, they have to do something in their settings, and then restart obsidian.
If instead we allow them an unlimited number of named functions, they can simply modify their queries - or add new ones - to use different values.
Also, this has the advantage that we don't have to decide on fixed names for scores, as is discussed in #1157.
Another benefit is that we can leave the current
urgency
score unchanged, and just document that a new, more flexible alternative exists. This nicely avoids a breaking change, and all the discussion, docs and user-support load that would be then required.Beta Was this translation helpful? Give feedback.
All reactions