Skip to content

Simple search functionality #28

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

Merged
merged 4 commits into from
Dec 11, 2016
Merged

Simple search functionality #28

merged 4 commits into from
Dec 11, 2016

Conversation

Henni
Copy link
Member

@Henni Henni commented Dec 10, 2016

fixes #25

looking forward to your reviews
@affanse @korelstar @PhSc @putt1ck @ThomasDaheim @jancborchardt

@Henni Henni added the enhancement New feature or request label Dec 10, 2016
Copy link
Member

@korelstar korelstar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice 🎉. Seems to be functional. However, in Firefox, the icon in the search field is displayed in the center (see screenshot) and the text is not selectable per click (however, pressing CTRL+A in the field works). This should be fixed.

search

A good enhancement would be if search queries with more than one word are split into its parts. I.e.: a search for "wordA wordB" currently finds only notes where wordB comes directly after wordA (with exactly one space in between). It would be better if this search finds all notes containing wordA and wordB at any position.

And one last question: why do you use an in-app search field and not the search from Nextcloud?

@Henni
Copy link
Member Author

Henni commented Dec 10, 2016

@korelstar Am I right when I guess that you are using a Firefox version <= 48? That would explain the problem with the icon positioning (http://caniuse.com/#feat=background-position-x-y). If this is the case, I believe I know how to fix this.
I'm not sure why the text isn't selectable but I'll experiment and try to figure it out.

enhancement: noted - could be fixed in a separate PR, but shouldn't be a huge deal (has been done before http://stackoverflow.com/a/23506051)

I have created an in-app search, because I have heard a rumor that @jancborchardt is unhappy with the global search 😉

@korelstar
Copy link
Member

korelstar commented Dec 10, 2016

Yes, I'm using the latest ESR version of Firefox and that's 45.5.1.

I've found out, why the text isn't selectable: because the <input> is inside of an <a> tag. Could you remove the <a> tag and use another method to show the search icon?

@Henni
Copy link
Member Author

Henni commented Dec 10, 2016

@korelstar possible but requires duplicating some styles from core. But you are right, that is probably better than wrong markup.

@korelstar
Copy link
Member

korelstar commented Dec 10, 2016

Maybe you can use a <div> or <span> instead of the <a>. That seems to work (without duplicating the styles).

Edit: okay, there are still some other issues then.

@phsc84
Copy link

phsc84 commented Dec 10, 2016

Thank you for this feature! Works great on Chrome 54.
Regarding the multi word search, I agree with @korelstar. It would be a very nice enhancement, if the search would find all notes containing wordA and wordB at any position.

@Henni
Copy link
Member Author

Henni commented Dec 11, 2016

@korelstar @PhSc I implemented the changes to the search functionality you requested.

@korelstar
Copy link
Member

👍 Great work!

@phsc84
Copy link

phsc84 commented Dec 11, 2016

Wonderful! Just tested it on Chrome 54 and Nextcloud 10.0.1. Works like a charm.

  • No problem with german umlauts.
  • No problem with Markdown formatting codes between two words.

Ready to be merged, from my point of view. 👍

@Henni Henni merged commit 6aa596e into master Dec 11, 2016
@Henni Henni deleted the search branch December 11, 2016 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to search notes
3 participants