TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
8.02k stars 1.19k forks source link

Search results in a tab of the Sidebar #1066

Closed gernert closed 8 years ago

gernert commented 9 years ago

From the discussion started at 'Provisionally extend search results to list title matches separately ' [1]:

The fact that search results obscure the tabs below it in the Sidebar brought me to make a 'Search' tab which contains the 'Advanced search' directly. For me the Advanced search is very handy; for newbies the Standard search with '…' is better?

For an example see [2]

pmario commented:

I think, the search should never remove the tabs below. It should switch to a "search" tab, so it is possible to switch between the tabs. ... I really don't like the need to remove the search results, just to get the tabs back. Opening the advanced search tiddler imo is a hack.

[1] https://github.com/Jermolene/TiddlyWiki5/commit/4d061d0fee959fdc5ab470dc8f8379bedfa946d9#commitcomment-8477557

[2] http://tw5custom.tiddlyspot.com/

felixhayashi commented 9 years ago

E.g. just drag and drop "$:/plugins/danielo515/ContextPlugin" from my site to your wiki.

Also, could you please add

.tc-search-results {
   padding-top: 0;
}

to the css of your wiki

felixhayashi commented 9 years ago

Felix, all done!

Really, great! I am curious what @Jermolene thinks of our masterpiece :)

You seem to understand what this is talking about ? Do you think it can be useful here ?

Hehe, yes, I mean, this was originally my idea :) as mentioned in the post above (https://github.com/Jermolene/TiddlyWiki5/issues/1066#issuecomment-87329292). What it does is, it shows different search visualizers in different tabs (like you now have it at your demo site). Users can also define what visualizer should be used as default. So it is all good as it is now at your demo site.

-felix

felixhayashi commented 9 years ago

I cross posted our results at the google group to make this available for a broader discussion

https://groups.google.com/forum/#!topic/tiddlywiki/bTiOu_migHs

twMat commented 9 years ago

Guys - really exciting! @Spangenhelm's latest, via the help of you others, is very much what I was hoping for - excellent! But/and the added Context search is a superb addition!

@Spangenhelm, please note regarding:

@twMat did not provided a link to his demo but it looked promising !

My mockups are almost exclusively mere illustrated images. It's my only chance to show what I mean as I can't code.

felixhayashi commented 9 years ago

I was wondering if you would not mind keeping a copy of the demo on your site? because i leave monday for three weeks so it won't be easy to adapt the demo if no one has access to it.

yes sure.

Do you know what i mean ?

Actually I am not really familiar with tiddlyspot.com. But don't worry, I don't think anyone can improve the demo since it is perfect ;)

But/and the added Context search is a superb addition!

Yes, the context search is great.

It's my only chance to show what I mean as I can't code.

Yes, sadly, especially because you have much creative power!

-Felix

Offtopic: By the way, Mat I just released a new (unstable) version of TiddlyMap which also displays links, I figured you would like that (see http://bit.ly/tiddlymap). Some (older) screenshots (https://github.com/felixhayashi/TW5-TiddlyMap/issues/58#issuecomment-78397190).

felixhayashi commented 9 years ago

@Spangenhelm

I have updated my previous comment, please think about changing the link to the demo in googlegroup. Thanks

Yes, I did it. But really be careful with that. Not everybody has signed Tiddlywiki's Contributers agreement and there is the danger that we cannot trace who added the code. So I actually would not recommend to let anybody contribute. Sounds harsh, I know, but it is for our own's code and tw's safety.

-Felix

Good night

felixhayashi commented 9 years ago

i will remove the link from my previous comments and some comments not really useful (this one included to try to keep this thread a little "clean" and easy to browse)

Hi @Spangenhelm, haha please, we still need one link for demo purposes :D Just tell me which one you like and I'll add that on ggroups.

I'll really go to sleep now, good night. ;)

danielo515 commented 9 years ago

@felixhayashi , @Spangenhelm ,guys seems you have been working hard tonight !! I would love to see what you got finally . I really loved Felix's idea of different search visualizers, I loved when I first saw it and I love it now that it is included in this search tab thing. For me is what makes sense. Thank you very much

Spangenhelm commented 9 years ago

Hi @danielo515 thank you and congratulations -> Your context plugin is so good that Felix suggested to add it too! Yes have spend times on it but not enough apparently because i have just found a little issue..

Sorry @felixhayashi but when trying to open the $:/core/ui/SideBarLists tiddler it display a javascript error :-( i'm afraid that it is coming from your code as it did the same on your demo...

We are not done yet danielo but it will be ready soon, for now you can check it on my space

danielo515 commented 9 years ago

Hello @Spangenhelm,

Thank you for your kind words. Regarding your current demo it works perfectly for me,no error.

felixhayashi commented 9 years ago

Hi @Spangenhelm

Sorry @felixhayashi but when trying to open the $:/core/ui/SideBarLists tiddler it display a javascript error :-( i'm afraid that it is coming from your code as it did the same on your demo...

Yes, I am sorry for that. I am almost sure you are talking about the error @pmario described here: https://groups.google.com/d/msg/tiddlywiki/bTiOu_migHs/Crjg2HTgx-sJ

Please see my answer and would be nice if you update your demo: https://groups.google.com/d/msg/tiddlywiki/bTiOu_migHs/RtvwqZLbn8MJ

-Felix

Spangenhelm commented 9 years ago

Hi @felixhayashi all done ! Works like a charm now ! I have also added some informations on the homepage. As i don't have/want/need a google account i usually don't think of handchecking the news in the groups so sorry for the double post, @pmario has been faster !

felixhayashi commented 9 years ago

Nice!

I have also added some informations on the homepage.

Great summary & professional overview!

felixhayashi commented 9 years ago

dito :ok_hand:

Jermolene commented 9 years ago

Hi @felixhayashi @Spangenhelm

I just looked at http://spangenhelm.tiddlyspot.com - is that the latest and greatest version of the demo?

Well done, I think it's a faithful implementation of what @twMat first articulated here:

https://github.com/Jermolene/TiddlyWiki5/issues/1066#issuecomment-65936620

It's great to be able to play with a live demo, and I appreciate the work you've put into it. The little touches like remembering the previously selected tab are neat.

Playing with it confirms my concerns:

I prefer the suggestion above (https://github.com/Jermolene/TiddlyWiki5/issues/1066#issuecomment-68637278) of using a dropdown to show the search results. Click for click, I think they are equivalent, but the dropdown avoids changing the normal behaviour of the tab control, and keeps the related UI elements together so that they are visually related.

pmario commented 9 years ago

As I wrote elsewhere, I think the TW core should provide the basic functionalities and plugins should be used to extend the behaviour. So users can decide, what is convenient and / or confusing for them.

I personally like the automatic appearance of the search tab but I wouldn't want to have the context search.

So let's create plugins, and let the users decide.

twMat commented 9 years ago

@pmario

I think the TW core should provide the basic [...]

The tricky bit is defining what is "basic". Is the current behaviour, replacing the sidebar tabs, basic just because it happened to be there first?

While I agree plugins is a good general way to go, it should ideally be coupled with some way to measure what the preferred solution really is. How will we otherwise know?

felixhayashi commented 9 years ago

Hi @Jermolene

I just looked at http://spangenhelm.tiddlyspot.com - is that the latest and greatest version of the demo?

yap

Well done

Thanks :)

I have to say, I disagree with both your concerns:

The sudden appearance of the "Search Results" tab when one types into the search box is jarring and confusing

I find it even more confusing that all sidebar tabs disappear in an instance until I clear the search.

Also imagine the new "focus of search at start" and a user accidentally typed a character without being aware of it and then wondering "where is the sidebar navigation?".

Once the search results tab has appeared, there's no visual relationship between the search text box and the search results tab. It's not clear that one is controlling the other

First, this argument can also be used against you. Many people do not look at the screen when typing and will not even realize that typing resulted in hiding the side navigation. It is better then to add a search tab and focus it than hiding everything.

I prefer the suggestion above (#1066 (comment)) of using a dropdown to show the search results.

I disagree on this one too. What happens when I want to select and copy a search result in a dropdown - it closes. What if I want to keep the list of search results open even if I clicked a term - it also closes.

To me, the solution displayed at the demo http://spangenhelm.tiddlyspot.com/ site feels far more natural (tiddlywikish sort to say). So far, the resonances have been highly positive.

@pmario

I personally like the automatic appearance of the search tab but I wouldn't want to have the context search.

As much as I like the context plugin, I agree with you here. Making the context plugin an official plugin is the best solution here. I only suggested in the beginning to add the context plugin to demonstrate its usefulness but please do not regard it as part of this change request.

@twMat

While I agree plugins is a good general way to go, it should ideally be coupled with some way to measure what the preferred solution really is. How will we otherwise know?

Good point. But I think basic means "most simple" and not most efficient or effective. Everything that only acts as enhancement should live as a "plugin" first and then make it into the core, hoever, the core should stay minimalistic unless there is a very good reason for adding a feature. On the contrary, the change request we are discussing here is clearly not just an enhancement but a fix for a suboptimal (imo confusing) search implementation.

-Felix

twMat commented 9 years ago

@Jermolene

Not sure it'll make a difference on any decision, but here are some takes at the flaws you point out:

  • The sudden appearance of the "Search Results" tab when one types into the search box is jarring and confusing (perhaps particularly as it appears at the left, shifting the other tabs from their previous positions)

Considering how the actual tab stating "Search" is merely an umbrella for the two subtabs, I think we could actually place it as a vertical tab on the left of the sidebar, thus letting the other tabs remain visible and in place, no jarr. Think of it like their IRL equivalent - all tabs don't necessarily have to point upwards. It would really be more of a "sign" than a tab, and it doesn't literally have to read "Search", it could be the magnifying glass icon or some such. (Illustrations needed?)

In a way it makes sense to have a deviating tab for Search since it is serving a deviating function compared to the other tab-lists there.

  • Once the search results tab has appeared, there's no visual relationship between the search text box and the search results tab. It's not clear that one is controlling the other

One could argue that the current solution (i.e the actual one, in empty or tw.com) suffers from the same problem.

But IMO @Spangenhelm's (et.al)'s design is a bit like those doors without a handle. Sure, one can stand there wondering but eventually you'll just push the door and realize that is what you were supposed to do, and then you realize that it was actually the best design possible. I mean... you can't(?) fail in using it: All other tabs are still accessible and typing a new search term, just like you did the first time, will refresh the search results, so... ?

pmario commented 9 years ago

@twMat

The tricky bit is defining what is "basic". Is the current behaviour, replacing the sidebar tabs, basic just because it happened to be there first?

There's no need to convince me, that the search results shouldn't remove the tabs. I'm with you here, since the search was implemented.

pmario commented 9 years ago

@twMat

Considering how the actual tab stating "Search" is merely an umbrella for the two subtabs, I think we could actually place it as a vertical tab on the left of the sidebar, thus letting the other tabs remain visible and in place, no jarr. Think of it like their IRL equivalent - all tabs don't necessarily have to point upwards. It would really be more of a "sign" than a tab, and it doesn't literally have to read "Search", it could be the magnifying glass icon or some such.

And there I have a completely different need. ... vertical tabs need too much space. What I want here is, that I can pin search results. ... So If I pin one search tab, the next search should open a new tab. and so on. ..

But this is clearly plugin territory.

twMat commented 9 years ago

And there I have a completely different need. ... vertical tabs need too much space. What I want here is, that I can pin search results. ... So If I pin one search tab, the next search should open a new tab. and so on. ..

Interesting! Maybe those pins could be the actual icon on the side that I was referring to. I.e multiple such searches lines up pins vertically to the left of the tabs, but also in themselves working as tabs.

But this is clearly plugin territory.

Definitely.

danielo515 commented 9 years ago

I don't have much to add to this conversation despite my own user experience.

I have to subscribe everything that @felixhayashi wrote and I totally disagree with @Jermolene . This last thing is not usual but could happend. For me the current behavior is the worst possible. Determining what is natural or not for "everyone" is something that only Apple inc can do. For me a new tab appearing is natural and could not confuse anyone. In the other hand obscuring all the tabs by just a search can create many confusion and problems as @felixhayashi have pointed very well. The only thing you can say against the purposed implementation is that it COULD not be intuitive, and that's all. But the current implementation have a lot of drawbacks, the main one is totally opposed to tiddlywiki's nature: search and navigate your own information the way your brain requests it. My brain does not work well having to clear the search results just to see what is currently opened.

Regards.

Spangenhelm commented 9 years ago

Hi everyone, since @Jermolene thinks that the drop down may be a good idea then i d like to see it live and see...

felixhayashi commented 9 years ago

Hi @Spangenhelm, while a demo would be nice for the dropdown idea, I think our solution already has enough pro-arguments to replace the current implementation. I am not sure (for the reasons stated already in a porst above) if a dropdown is a better solution or if it is as easy to implement as our proposal.

Spangenhelm commented 9 years ago

Hi @felixhayashi you know that i totally agree more with you but i just wanted to give a chance to @Jermolene's idea since after seeing our demo he still thinks that his idea might be bettter..

Spangenhelm commented 9 years ago

Hi everyone i can't believe the 5.1.8 is out and nothing has moved on about this... :disappointed:

felixhayashi commented 9 years ago

Hi @Spangenhelm

Hi everyone i can't believe the 5.1.8 is out and nothing has moved on about this...

I think its because Jeremy has many building sites to work on. But I also hope he picks it up soon.

-Felix

danielo515 commented 9 years ago

Would you consider to move your customization into a plugin for early adopters like me?

felixhayashi commented 9 years ago

Hi Danielo,

I would have done that already the problem here is that we needed to insert a code-line into $:/core/ui/SideBarLists which means that creating a plugin will override the sidebarlist which is not a good thing to do for a plugin :(

-Felix

danielo515 commented 9 years ago

Hello @felixhayashi ,

Thank you for the clarification. Indeed that is not a good idea for a plugin, but it is better than manually editing that tiddler.

Regards

Spangenhelm commented 9 years ago

Hi @danielo515

Indeed that is not a good idea for a plugin, but it is better than manually editing that tiddler.

:+1:, so although @felixhayashi is right i will try to publish the plugin today.

Spangenhelm commented 9 years ago

Hi @danielo515 the plugin is ready on my homepage !

I have tried unsuccessfully to incorporate your context plugin directly in it but i guess that storing plugins in plugins does not work, in a way it is good as it let people decide rather they want it or not and may facilitate future updates.

Also i have just realised that the stylesheet for overrididing the padding in the results tab does not work, it is not taken in account even though it is correct (i don't know if and how we can fix this, a little help @felixhayashi ?? ;-)

Thanks for your support !

felixhayashi commented 9 years ago

Hi @Spangenhelm !

thanks creating the plugin :) I'll have a busy day but I'll look at it later. I recommend not to create the plugin with danielo's context search plugin included so people have the freedom to decide (Danielo knows I like his plugin very much but I think it is better to keep things separated). Please make sure you mention on your site that the plugin is only for demo purposes because our goal is to really get this into the core somehow (hope Jeremy can be convinced somehow) :)

-Felix

danielo515 commented 9 years ago

Hello @Spangenhelm ,

Thank you for the plugin. I have installed it on my two wikis I use the most, so expect some feedback.

I have to agree with @felixhayashi that it's better to keep my plugin separated. At the end, it is a plugin itself, not an isolated customization and it is designed to be an isolated package. I think this is the point about plugins

Spangenhelm commented 9 years ago

Hi @felixhayashi thank you

I recommend not to create the plugin[..] so people have the freedom to decide.

Can't agree more on this! In fact i was more questioning the feasability to do it or not. (do you know if it is? if yes then i'd like to know how, if not then i'll propose a pull-request to update the docs on it)

hope Jeremy can be convinced somehow...

...or that he will introduce his own demo soon ;-)

On your advice i have updated the demo with a warning! Cheers -S

Spangenhelm commented 9 years ago

@danielo515

expect some feedback

Please do :-)

On the plugins i agree but i am looking for a way to bundle them together while still installing them separatly (for updates, uninstallation or just disabling) for an easier use. Imagine when you want to install a plugin that depends on other plugins but really hard to find because of lack of informations or you need an older version etc.. If they are bundled then it's easy, if not then...have fun ! +

felixhayashi commented 9 years ago

Hi @Spangenhelm

Imagine when you want to install a plugin that depends on other plugins

Completely agree! Please see https://github.com/Jermolene/TiddlyWiki5/issues/1345

Also i have just realised that the stylesheet for overrididing the padding in the results tab does not work, it is not taken in account even though it is correct (i don't know if and how we can fix this, a little help @felixhayashi ?? ;-)

Hehe. Well for stuff like this use e.g. firebug and inspect the element. You'll see that tiddlywiki comes with its own value for .tc-search-results and overrides yours. You'll need to increase the rule importance. simply do:

div.tc-search-results {
   padding-top: 0;
}

-Felix

Spangenhelm commented 9 years ago

Hi @felixhayashi spot on! Demo updated ✓ Thanks

felixhayashi commented 9 years ago

:+1:

Spangenhelm commented 9 years ago

Hi @danielo515 i have just found out that your context plugin does not seem to show the results with the same priority as the regular search, could you take a look on my demo's page ?

Thank you

danielo515 commented 9 years ago

I did not check it out, but probably it's because the default search prioritizes the Tiddlers that has the searched string in it's title.

Spangenhelm commented 9 years ago

Hi @danielo515, Yes, and that would make sense but it appear to do the search in an alphabetical order ( a tiddler that starts with "a" in the title will appear before another named "z" for example) instead of the best match first. No big deal but surprising..

felixhayashi commented 9 years ago

Hi @Spangenhelm

I think there is a way of making the tabs switch in our plugin without needing to override "$:/core/ui/SideBarLists". I'll send you the code (or point to a download source) when I am done. Then this plugin can be used without drawbacks ;)

-Felix

sukima commented 9 years ago

@felixhayashi this is how I handled programmatically setting the SideBar tab:

  var sideBarStateTiddler =
    $tw.wiki.filterTiddlers('[prefix[$:/state/tab/sidebar]]')[0];
  if (sideBarStateTiddler) {
    $tw.wiki.setTextReference(sideBarStateTiddler, searchTiddlerTitle);
  }

Reference: my mocha spec runner plugin for TW5

felixhayashi commented 9 years ago

Hi @sukima

exactly! this was the solution I thought of ;)

@Spangenhelm

It would be awesome if you managed to put the plugin code on GitHub (i.e. a repo called TW5-EnhancedSearchResults) so I can change the code there and make pull requests. It is much easier to collaborate like this.

Once you have the repo created on GitHub just create a first issue and include me with @felixhayashi in the issue post so I can help you with the setup.

After we got rid of the sidebar issue, we can fully promote the plugin (even though I still wish this would be a core thingy!) and gain more attraction.

-Felix

sukima commented 9 years ago

If it is on github you can potentially get a flood of help. I know I would help if it was on github. Even if the git repo was available then at least emailing patches would work. But without an accessible VCS contributing to a project is more trouble then it's worth.

Spangenhelm commented 9 years ago

Hi @felixhayashi the repo has been created but i don't know how to create the needed files: do i need to use git on my system (linux) of can i create them online ?

Thanks

sukima commented 9 years ago

@Spangenhelm

tobibeer commented 9 years ago

back from the un-dead: I very much enjoy the progress on this :D