Skip to content
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

Autocompletion in the 'search by tag' field? #49

Closed
nodiscc opened this issue Nov 8, 2014 · 18 comments
Closed

Autocompletion in the 'search by tag' field? #49

nodiscc opened this issue Nov 8, 2014 · 18 comments
Labels
easy good place to start contributing enhancement
Milestone

Comments

@nodiscc
Copy link
Member

nodiscc commented Nov 8, 2014

Reported at sebsauvage#104. The 'search by tag' field has no autocompletion feature (the 'tags' field in the "Edit link" dialog still has it)

The proposed fix doesn't merge anymore (it relies on an old Shaarli version that still had jQuery on the main page). We may not want to re-add jQuery so another solution would be welcome.

Is this really wanted, or should we mark this as wontfix?

@ArthurHoaro
Copy link
Member

In my opinion, the 'search by tag' field is useless, and not worth readding jQuery + jQueryUI on every pages :

  • Tag filtering is done by clicking on a tag from the link list or the tag cloud.
  • The search field can also be used if poeple are looking for something ; it searches through tags.

I believe in earlier versions you couldn't search tags through the regular search field, and that's why it exists. Anyway, it's a wontfix for me.

@nodiscc
Copy link
Member Author

nodiscc commented Feb 23, 2015

I for one often use the "search by tag" field because:

  • I have a lot of tags
  • Sometimes i know exactly what tag I'm looking for and
    • The tag is not directly available on the link list page I'm on.
    • I can't be bothered to open the tag cloud, search for the tag, click on it.

So while it's not high priority, I see 4 possible solutions

  • wontfix
  • Add a live filtering field to the tag cloud page
  • reintroduce jQuery on linklist pages (it's cached most of the time anyway) and re-add autocompletion, possibly optional
  • Best solution IMHO: use another lightweight autocompletion lib and get rid of jQuery where it's still used (changetag, picwall, editlink)

@ArthurHoaro
Copy link
Member

Do we just use jQuery for autocompletion? If so, your solution is probably the best thing to do, yes.

@nodiscc
Copy link
Member Author

nodiscc commented Feb 23, 2015

@ArthurHoaro It's also used for lazy loading in the picwall. But again, specialized libs exist for that. Eg blazy which is used by MinigalNano by @sebsauvage

@nodiscc
Copy link
Member Author

nodiscc commented Mar 2, 2015

https://github.com/aehlke/tag-it is another autocompletino lib (but still relies on Jquery UI)

@nodiscc nodiscc removed the easy good place to start contributing label Mar 2, 2015
@ArthurHoaro
Copy link
Member

I took a look at it yesterday, and I didn't find a single proper lib which doesn't rely on jQuery (or angular and cie) and supports multiple tags. :(

@Marsup
Copy link

Marsup commented Mar 2, 2015

What about http://leaverou.github.io/awesomplete/ ?

@nodiscc
Copy link
Member Author

nodiscc commented Mar 2, 2015

@Marsup this is the lib I suggested initially but it appears that it doesn't support autocompletion on multiple words which is something we need.

Edit: there might be progress on this, as per the issue comments ;)

@Marsup
Copy link

Marsup commented Mar 2, 2015

Sorry, didn't notice, it worked on the demo at least :)

@ArthurHoaro
Copy link
Member

That's really interesting! However, the way this lib works, it means we need to write every tags in the HTML page. I don't think it's a big issue, but it might be important to notice.

@nodiscc
Copy link
Member Author

nodiscc commented Mar 2, 2015

Autocompletion for multiple words is now working at https://leaverou.github.io/awesomplete/#advanced-examples (scroll to "Multiple values"). As I said we still need to find a way to

  1. Use space as the separating character
  2. Use tab as a way to autocomplete the current word with it's suggested completion, while keeping the focus on the tag input field.

Edit: this is on a good way so I suggest closing Pull Request #118 if @ArthurHoaro or someone else is able to put up something that uses this lib. Sorry for @s1dh but (see discussion at #92 (comment)) I believe the behavior he requests is a nasty edge case, it can be worked around with CTRL+C/CTRL+V, and it may still be implemented later using awesomplete. Having a cleaner, jQuery-less autocomplete is more important in my eyes.

@ArthurHoaro
Copy link
Member

You're right. I closed my PR. The tag order code can be changed later if it's necessary anyway.

Use tab as a way to autocomplete the current word with it's suggested completion, while keeping the focus on the tag input field.

In the example provided, you can use your arrow keys and press Enter. I'd say it's good enough.

Also, the autocomplete algorithm is not exactly the same since it also searches inside words (not only starting with). It's even better IMHO. And finally the HTML storage, as I said in my previous comment, which shouldn't be an issue.

So, 👍 for awesomplete for me.

@nodiscc
Copy link
Member Author

nodiscc commented Mar 3, 2015

Agreed with everything you said.

@nodiscc
Copy link
Member Author

nodiscc commented Mar 6, 2015

We should keep in mind:

Tag suggestions should be case-insenstive to help with #146 (comment)

@nodiscc
Copy link
Member Author

nodiscc commented Mar 18, 2015

Should be easy to fix since the new autocompletion library is now live.

@nodiscc nodiscc added the easy good place to start contributing label Mar 18, 2015
@nodiscc
Copy link
Member Author

nodiscc commented May 1, 2015

@ArthurHoaro do you want to take a look at this? Since you are familiar with awesomplete..

ArthurHoaro added a commit to ArthurHoaro/Shaarli that referenced this issue Jun 9, 2015
@ArthurHoaro
Copy link
Member

It's done. :)

@nodiscc
Copy link
Member Author

nodiscc commented Jun 23, 2015

Fixed in 65d6251, thanks.

@nodiscc nodiscc closed this as completed Jun 23, 2015
alexisju added a commit to alexisju/albinomouse-template that referenced this issue Jul 7, 2015
@virtualtam virtualtam modified the milestones: 0.9.0, 0.5.0 Jul 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy good place to start contributing enhancement
Projects
None yet
Development

No branches or pull requests

4 participants