On Discord tienson wrote:
Thank you all for the feedback on the query builder, it’s something we’re going to design && implement soon.
So if you have any suggestions on the implementation, please create a post on Logseq Forum to keep it organized
On Discord tienson wrote:
Thank you all for the feedback on the query builder, it’s something we’re going to design && implement soon.
So if you have any suggestions on the implementation, please create a post on Logseq Forum to keep it organized
The macOS finder has a good UX alread, and numerous other apps have copied and adapted it. For instance, see 2Do, Hazel, NameMangler, and HoudahSpot.
I’m thinking about an interface with a drop-down menu where you can select the type of item you want to query, the attribute(s), the operators of your choice and “+” buttons to add more items/attributes. So it would be like
Roam query builder plugin: GitHub - dvargas92495/roamjs-query-builder
To me the ability to display journal date for blocks defined in the journal is essential. It would be great if it could be one of the columns and the table could be easily sorted by it.
Hi all,
this is a mockup inspired by indented lists:
What do you think of this “framework”? Is there any use case that you think is not covered?
Edit: here there are some additional UI niceties:
•
or *
and normally the lines are in a AND
relationOR
from the first dropdown menu could be rendered as a +
sign, like in Boolean AlgebraNOT
selected from first dropdown menu could be rendered as the sign -
(minus)The following is not strictly about the query builder but on making it easy to discover:
<current page>
” could greyed out{{query ...}}
) could be displayed (but greyed out) while using the builder and a “Copy” button could let the user copy in and later paste it elsewhere, eventually re-editing it with query builder or the usual syntaxEdit, here there is a mockup:
I think in the same way there could be many types of filters, like has a tag, has a parent with a tag, links to pages, pages link here, is a ref, on a whiteboard, different types of whiteboard shapes.
The tree structure allows some filters to have more sub filters.
Like this, it seems almost possible to prototype this in normal Logseq with a plugin.
In case we want options on how to display results (list, table etc), sort them and group them, I tried to expand my concept:
The results of the example above would look like this:
I don’t know if it would be part of the builder but I would really appreciate auto-suggestion / auto-completes when trying to build a query. Similar to how you get suggestions when typing a /
or >
, except within the query and with relevance to the things that can be entered in a query.
{{query (|)}}
(Where the cursor is at the |) Would display the things like and
or
property
page-tags
page-property
sort-by
… Etc. I know it’s not an exhaustive list but it would be fantastic if it could do that
I like that your UX mock-up includes sorting options as well. That is important.
I like the concept in general. I specially like that you use the logseq outline functionality to nest things.
A few questions:
Filter by section
Sort by section
Group by section
Interesting topic this … I thank you for your effort to make the nice-looking UX concepts. At the same time I think it is very important to have a good thorough discussion about the UX as the mean complaint currently with Queries is that it is to complex. So ease of use should be top priority. Even meaning that some functions are not included. Use of AND or OR should be logically derrived from the UX. Same as the grouping and sorting.
Looking forward to more discussion …
Hi, thank you for the detailed feedback.
As far as I understand, Logseq has a complex data structure under the hood and Advanced (Datalog) Queries can do all sort of things with that. Instead Simple Queries try to abstract some concept on top of them, for example {{query [[tag]]}}
is more complicated under the hood than it seems.
This Query Builder is supposed to support way more use cases than Simple Queries but without exposing Logseq inner data structure to the user like Advanced Queries. In conclusion I think it could have all sort of abstractions where it makes sense and there is no need to discuss them now and indeed I didn’t cover that aspect at all, I just proposed some ideas on how to input the data. The discussion on which filter to include is another topic compared to my concept. So feel free to discuss it independently from my concept.
I agree that “see below” is not great and I used it just as a placeholder, but “sub-query” is not an improvement to me and it’s technically not correct.
No, it’s supposed to be AND. Between lines there is an AND relation. Instead the OR is added with a special filter in a parent block and has effect on its children. It’s the first thing I wrote in my first post.
The indentation is supposed to let us avoid parentheses.
There are no multiple sorting options and it refers to results. This means that if you want to sort results by something that is linked to them, in my example authors’ birthdays, you need that “see below” filter. Otherwise specifying “Property Birthday” alone without the first line would be “sorting by books birthdays” instead of “sorting books by their authors’ birthdays”.
This may make sense, I placed it there to mirror the structure of the Group by section below.
What I said about sorting applies here too.
Everything else, for example you can decide to group results by author but instead of sorting authors by name you may want to sort them by birthday:
- Bob
- ...
- ...
- Alice
- ...
(suppose Bob comes before Alice when sort by birthday)
Not sure what you mean but I think I covered this use case: a first grouping option could be a list and a second one a table. This way you would get multiple tables in an indented list. About which columns should be displayed in table view, in case we want to specify that in the query builder (now it is specified in the properties of the block where the query is) I think the “table view” option could trigger more UI elements like other filters do and let the user set columns.
Have you seen the last image with Nation Author Book in red/green/yellow? Those are the results (books) and multiple grouping (by nationality first, by author then).
Any update on the progress for this?
As the link that alex has shown, Tienson is working on the builder and the discussion in this thread is considered
This is very exciting. I think it will really unlock the power of Logseq for many more users.