-
-
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
Remove duplicated suggestions in awesome bar #1064
Conversation
We now only remove duplicated suggestions based on url, maybe later we can decide to remove those entries that only differ in 'http'/'https', or end with '/' or not Signed-off-by: Songlin Jiang <[email protected]>
5929cde
to
b13efad
Compare
app/src/common/shared/com/igalia/wolvic/search/suggestions/SuggestionsProvider.java
Outdated
Show resolved
Hide resolved
28678d3
to
391cdf2
Compare
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.
I understand the rationale of the change but I am not sure it can be successfully resolved by filtering. For example imagine that you have a bookmark with a trailing slash and also a history entry without the slash. Then the history entry will be shown, but not the bookmark. That for me is a mistake because bookmarks must be always shown IMO.
The other comment I have is that comparing strings is normally slow, so I'd use a hash of the URL to be inserted in the Map instead of the full URL.
Last but not least, I don't think we can freely assume that we can remove insecure schemes (like http). For example I have some personal services at home that can be accessed either by http or https as I don't really care too much since they are internal services. I'd presume that is the same in corporate environments.
Okay, anyway we can revert back to 5929cde to make it less aggressive, and modify that so bookmarks must be always shown. |
391cdf2
to
5929cde
Compare
Reverted. We use hashSet so it's fast to check if a URL already exists. Also we sort before we remove duplication so that only those duplicated results that appear at the bottom of the list will get removed |
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.
This more conservative version looks more appealing to me. Thanks!
We now only remove duplicated suggestions based on URL, maybe later we can decide to remove those entries that only differ in 'http'/'https', or end with '/' or not
Before:
After: