Keyword search history#6414
Conversation
c6df924 to
d04c760
Compare
…put with matching query
d04c760 to
acc5723
Compare
There was a problem hiding this comment.
Manually removing all the characters does result in seeing the Recent Searches but using the Clear button doesnt.
VirtualBoxVM_Hh0rVfxTWh.mp4
Pure visually but it looks kind of weird that the search bar removes the Clear button for a sec causing the elements to move but makes the Clear button reappear after 1ms. Maybe it should behave more like 2nd video.
VirtualBoxVM_fiEaDHXf0w.mp4
VirtualBoxVM_UoPZAHcYaz.mp4
pressing spacebar throws errors
VirtualBoxVM_FmaVLiQHAv.mp4
Like seen in the vids above Linus Tech Tips was in the recent searches but sometimes i doesnt appear and i dont know why that happens.
EDIT: It wont show the search history after clicking on the search history
VirtualBoxVM_H70MVwsHCF.mp4
|
@efb4f5ff-1298-471a-8973-3d47447115dc Thank you for your speedy and attentive testing! Fixed above issues now - the not showing of the current history entry when you're on that same page is actually intentional, but I can change that if it's confusing from a user perspective. |
Fix focus being lost for a second during searching of search history entry causing clear text button to phase away for a moment. Fix clear text button event not being noticed by the logic in top-nav. Fix spacebar error issue by adding check in updateVisibleDataList function.
1a06600 to
d6f7542
Compare
|
Pressing spacebar gives me 2 things from my history. I think i expect all of them or none as i didnt actually type something yet. I think showing all would be the better way to go VirtualBoxVM_VbE9wRYI12.mp4Press and Hold moves searchbar. This doesnt happen with search suggestions VirtualBoxVM_mMyBuwjs2v.mp4
This one doesnt seem to be addressed
I think it was quite confusing as i just searched for it |
|
Fixed all of these issues now! Edit: Also refactored to simplify some of the logic and testing criteria. |
Fixes clear text button to appear and stay visible when the dropdown options are visible in an ft-input. Fixes updateVisibleDataList not using trim(), thus incorrectly causing filtering of search history when space bar was used.
b00b3b5 to
dd97039
Compare
… route This is much more efficient for search history particularly. No need for app-specific routes and easier operations & logic due to name being the primary key for search history entries. This still allows for the route to be used as the _id for different kinds of search history (i.e., bookmarks) that could be added in the future.
dd97039 to
a6375c7
Compare
absidue
left a comment
There was a problem hiding this comment.
As the left and right arrow keys are already used for moving left and right in your search query and the enter key is used to trigger a search, it is now really easy to accidentally delete search history entries when using the arrow keys to adjust your search query and enter to search, especially because the highlighting of the remove link is very subtle, so most of the time you don't even realise that it is activated. Which I can say from personal experience as it happened multiple times while I was testing this pull request.
Thanks for the feedback - is this any different from YT's implementation, and/or do you have a suggestion on how to improve this? |
Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
|
I haven't personally experienced YouTube's implementation of it, but here are some suggestions off the top of my head:
|
|
At the moment when you press the right arrow key while a history suggestion is "focused" two things happen at the same time: the cursor in the text field moves one character to the right and the focus changes to the remove button. |
|
For now, let's stick to YT's approach and change it if it users dislike it: Kooha-2025-01-05-15-50-44.webm |
|
Okay wow that is weirdly unexpected that YouTube would have it like that, feels like an oversight on their part to me. |
absidue
left a comment
There was a problem hiding this comment.
Please create a PR to the docs repo to add the new database file to the data location page, after this has been merged.
|
What's changed since last review...
|
| Are you sure you want to clear out your search cache?: Are you sure you want to | ||
| clear out your search cache? | ||
| Search cache has been cleared: Search cache has been cleared | ||
| Clear Search History and Cache: Clear Search History and Cache |
There was a problem hiding this comment.
Did we want to remove the old key for the other locales? Or is the plan to keep it for now so it's easier to update the translation?
There was a problem hiding this comment.
Yes, I was thinking the latter.
There was a problem hiding this comment.
Sounds good, approving now
|
A thought that popped up that i wanted to share: maybe allow importing exporting search history and importing from YT |
* Add search history DB integration * Implement search history display logic and UI * Modify search cache removal setting to remove search history as well * Exclude current search route from history suggestions and populate input with matching query * Modify new labels for clarity * Fix issues detected during review Fix focus being lost for a second during searching of search history entry causing clear text button to phase away for a moment. Fix clear text button event not being noticed by the logic in top-nav. Fix spacebar error issue by adding check in updateVisibleDataList function. * Implement fixes from code review Fixes clear text button to appear and stay visible when the dropdown options are visible in an ft-input. Fixes updateVisibleDataList not using trim(), thus incorrectly causing filtering of search history when space bar was used. * Update logic to allowing storing and searching by name rather than by route This is much more efficient for search history particularly. No need for app-specific routes and easier operations & logic due to name being the primary key for search history entries. This still allows for the route to be used as the _id for different kinds of search history (i.e., bookmarks) that could be added in the future. * Add back clear statement * Fix clear text button not working or appearing as active when arrowing through search history results * Add 'Remove' option * Implement search history entries showing up alongside YT search suggestions as queries are being typed * Improve code commenting * Implement code review changes Fix preventDefault being called for arrow left/right in search input. Revert ellipsis changes for overly long search results. Adjust matching search history logic to be non-heuristic. * Fix text overflow issue with long search history entries * Remove 'name' field and unused DB methods * Implement 'Remember Search History' setting and rename 'Remember History' to 'Remember Watch History' * Apply suggestions from code review Co-authored-by: absidue <48293849+absidue@users.noreply.github.com> * Update to not show search history suggestions if 'Remember Search History' is disabled * Update logic to make 'Enable Search Suggestions' being false still allow showing search history results * Revert hiding old search history entries if rememberSearchHistory is disabled * Fix searchOptions not closing in edge case Bug scenario: 1. click search history entry, 2. click clear text button, 3. see state of searchOptions not being closeable until re-interacting with the input * Update src/renderer/views/Search/Search.js Co-authored-by: absidue <48293849+absidue@users.noreply.github.com> * Add bolding to selected/focused 'Remove' button --------- Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
|
Test that search history suggestions do not appear when This seems not true now (and I remember I tested this before approving I saw this above
But I have |
|
This is all intended behavior When |
|
Well the it's
Fine for me it's just misleading to mention |
* Add search history DB integration * Implement search history display logic and UI * Modify search cache removal setting to remove search history as well * Exclude current search route from history suggestions and populate input with matching query * Modify new labels for clarity * Fix issues detected during review Fix focus being lost for a second during searching of search history entry causing clear text button to phase away for a moment. Fix clear text button event not being noticed by the logic in top-nav. Fix spacebar error issue by adding check in updateVisibleDataList function. * Implement fixes from code review Fixes clear text button to appear and stay visible when the dropdown options are visible in an ft-input. Fixes updateVisibleDataList not using trim(), thus incorrectly causing filtering of search history when space bar was used. * Update logic to allowing storing and searching by name rather than by route This is much more efficient for search history particularly. No need for app-specific routes and easier operations & logic due to name being the primary key for search history entries. This still allows for the route to be used as the _id for different kinds of search history (i.e., bookmarks) that could be added in the future. * Add back clear statement * Fix clear text button not working or appearing as active when arrowing through search history results * Add 'Remove' option * Implement search history entries showing up alongside YT search suggestions as queries are being typed * Improve code commenting * Implement code review changes Fix preventDefault being called for arrow left/right in search input. Revert ellipsis changes for overly long search results. Adjust matching search history logic to be non-heuristic. * Fix text overflow issue with long search history entries * Remove 'name' field and unused DB methods * Implement 'Remember Search History' setting and rename 'Remember History' to 'Remember Watch History' * Apply suggestions from code review Co-authored-by: absidue <48293849+absidue@users.noreply.github.com> * Update to not show search history suggestions if 'Remember Search History' is disabled * Update logic to make 'Enable Search Suggestions' being false still allow showing search history results * Revert hiding old search history entries if rememberSearchHistory is disabled * Fix searchOptions not closing in edge case Bug scenario: 1. click search history entry, 2. click clear text button, 3. see state of searchOptions not being closeable until re-interacting with the input * Update src/renderer/views/Search/Search.js Co-authored-by: absidue <48293849+absidue@users.noreply.github.com> * Add bolding to selected/focused 'Remove' button --------- Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>



Keyword search history
Pull Request Type
Related issue
closes #1492
Description
Adopting some pieces from #5003, this PR implements search history with behavior very similar to that of YT.
Enable Search Suggestionsis enabled and the search bar is focused with no non-whitespace text entered, up to 14 of the most recent searches will display. When a query is entered, up to 4 of the most recent matching searches can display.Removebutton by search history entries. TheRemovebutton will remove the search history entry and cache entry.Remember Historysetting toRemember Watch Historyand addedRemember Search Historysetting as per suggestions in the Matrix chat.See Testing section for more specifics on the intended behaviors.
Screenshots
Testing
Enable Search Suggestionsis disabledRemember Search Historyis disabled andEnable Search Suggestionsis enabledDesktop
Additional context
The
src/renderer/modules/search-history.jsimplementation is made in a certain way to accommodate possibilities of features like #5003 while still giving space for further optimization if other routes are taken. That's why we allow keeping >14 search history entries at a time even if the older entries are not currently accessible through the UI yet, to name an example.I would also contend that separating search history by profile is too arguable and out of scope to include in this PR.