-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Filter story river: filtering the Story River by the search input field #8675
Conversation
Confirmed: BurningTreeC has already signed the Contributor License Agreement (see contributing.md) |
core/wiki/functions/search.tid
Outdated
title: $:/core/wiki/functions/search | ||
tags: $:/tags/Global | ||
|
||
\function tf.story-river.filter() [[list]addsuffix[<tv-story-list>]addsuffix[$(searchSuffix)$]substitute[]addsuffix[ ]addsuffix[:filter]addsuffix[$(searchPrefix)$]substitute[]addsuffix[{$:/state/story-river/filter}match]addsuffix[$(searchPrefix)$]substitute[]addsuffix[yes]addsuffix[$(searchSuffix)$]substitute[]addsuffix[then<currentTiddler>]addsuffix[search:]addsuffix{$:/config/StoryFilter/fields}addsuffix[:]addsuffix{$:/config/StoryFilter/flags}addsuffix[{$:/temp/search/input}]addsuffix[else{$:/state/story-river/filter}!match]addsuffix[$(searchPrefix)$]substitute[]addsuffix[yes]addsuffix[$(searchSuffix)$]substitute[]addsuffix[then<currentTiddler>]] +[addprefix[$(searchPrefix)$]substitute[]addsuffix[$(searchSuffix)$]substitute[]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filters can also have several lines. In between filter runs you can add new-lines, which would probably make that filter a bit more readable.
I think it also uses some variables, that are defined somewhere else. IMO every "helper" definitions the filter needs should be defined with that filter.
I also think it needs to be written in a way that actually is understandable. As it is at the moment it is a complete mess.
May be new-lines will help already. With some brief testing I did not really figure out, how that filter works.
I did test it and did hit ALT-F several times, without having a search term or any tiddlers in the story river. -- Nothing happened. While analysing 3rd party code I do copy paste system tiddler titles into the search field. -- hit enter -- to open those tiddlers. The problem now was, that there is no visual indicator, that the "story filter" is active. So opening the system-tiddler with the title in the search field, did close all open tiddlers, except the system tiddler. -- But I needed them. So I thought the "zoomin" story-view is active. -- But it wasn't. .... What I want to say is. There needs to be a clear visual indicator, that the story-filter is active. It is extremely frustrating if you are unable to open any new tiddlers once a search term is active. From my point of view, this type of functionality is plugin territory. |
Now there's a clear visual indicator that the story view is filtered @pmario |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do like the new visuals -- I think outline: 2px should be enough
@pmario - do we have a filter icon? |
Not yet. |
I think this should be an alternative layout plugin. I'm creating one https://github.com/tiddly-gittly/combine-rhythms (not finished yet so not opensourced) that uses https://tw-cpl.netlify.app/#Plugin_202303134647766 to filter a story river that only contains title, and a vscode style single tiddler editor on the side. |
What do you all think about this? Should we make something out of it that's core-compatible or a core plugin or should I close the PR? |
Thank you @BurningTreeC it has been useful to try out this PR. It's an interesting idea but I think the implementation ends up being overly complex and is rather inscrutable in use. The way that the search box is overloaded to both filter and search at the same time is a case in point. So I think the best way to take this forward is as a plugin. I wonder whether things might be simpler if the text box for filtering was entirely separate, but I do see that this kind of overloading can be useful for power users. |
This is totally possible, I've refactor this from command palette plugin to be auto-complete-box plugin, it switch to filter mod when first char is And code in this PR might be a much smaller wikitext version of it, based on what you said. |
Ok, this PR was a nice experiment |
Hi @BurningTreeC in the absence of Vercel previews, it would be great if you could upload a build to Tiddlyhost and link to it from the description of this PR |
I thin a plugin would be a good idea. -- At first it seemed a bit strange, but with the clear visual indication now, I think it is very usable. |
I've added a Tiddlyhost link to the description |
This PR is just for discussion and demonstration purposes.
It filters the Story River by a configurable
search:*:words
filter.Is such a feature ok for the core?
This works by entering something in the search input field and either clicking the placeholder github button or hitting alt-F
I think the filter should be modified so that draft tiddlers never get filtered out but I don't know yet - anyway, that'd be doable
Here's a Tiddlyhost link: https://filter-story-river.tiddlyhost.com/