-
Notifications
You must be signed in to change notification settings - Fork 109
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
Allow easily clearing search box #1026
Allow easily clearing search box #1026
Conversation
CLA is signed, not sure why it's still showing as not signed. |
CLA shows as not signed because my e-mail address is not linked to my commit (now it is, but I cannot modify existing commits). |
You can easily fix this:
|
- Clear search bar with ESC or X (only Chrome) - Hide search bar when conversation or contact is clicked
Very cool, did solve it, thanks! |
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.
Thanks! Some notes below.
Noted for future commits. Co-authored-by: Danilo Bargen <[email protected]>
Thanks, didn't check that. Co-authored-by: Danilo Bargen <[email protected]>
Requested changes are done, anything else needed from my side? Sorry that I ask, my very first pull request... |
Thanks for applying the fixes!
No, you did everything right. We're currently juggling with different tasks and priorities (especially now that a lot new users joined), so it may take a few days until we can review a submission! I tested your changes, they seem to work nicely in Chromium! I like that the search box disappears when clicking on a conversation, that makes sense. However, in Firefox the ESC key does not seem to trigger the keyUp event 🤔 Maybe you can test as well? It's possible that Firefox does not consider all key types for the keyUp event. I also had another thought: Right now ESC clears the input field if it contains a search. Maybe it could also hide the search box if it's already empty? This way, a search could be aborted by pressing ESC twice. |
Sure - no hurry!
With which Firefox version are you testing currently? That ESC event works fine me with, it clears the search field in Chrome and Firefox 84.0.2 (64-Bit).
This one is nice, and not much of work. Will do it and push it again. |
Hm, that's strange, I'm also on 84.0.2 and for me the KeyUp listener is never even called. I'll wait for your update, and will then test again to find out what the reason is. |
If searchText is filled and ESC gets pressed --> Empty SearchBar If searchText is empty and ESC gets pressed --> Toggle SearchBar off
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.
One last change request, then this is ready to merge.
Chrome: Avoiding emptying and closing search bar at the same time
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.
Thanks @samuelT2!
Deployed to https://web-beta.threema.ch/, testing welcome. If no major bugs in that release are discovered in the next 2-3 days, a public release will be made. |
Unfortunately even small features can have undesired side effects... It seems that when searching through a lot of conversations (I have over 230 conversations), after clicking on a conversation, the search clears almost instantly, but it sometimes takes multiple seconds until the conversation has opened. This has a lot to do with the inefficient architecture of AngularJS, where every UI update can trigger a lot of processing code, which in turn may cause yet another UI update. For now, we might need to disable the clearing/hiding of the search when clicking on a search result. (Note: Clearing with ESC or by clicking on the X mark would remain.) |
Ouch, well - didn't test it with 230+ conversations :). Shall I revert that change or will you do it? |
See #1042 |
Fix related to "add X to clear search bar", issue #92