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

Completions not sorted after filtering #3156

Closed
rcorre opened this issue Oct 18, 2017 · 6 comments
Closed

Completions not sorted after filtering #3156

rcorre opened this issue Oct 18, 2017 · 6 comments
Labels
bug: behavior Something doesn't work as intended, but doesn't crash. component: completion Issues related to the commandline completion or history. priority: 1 - middle Issues which should be done at some point, but aren't that important.

Comments

@rcorre
Copy link
Contributor

rcorre commented Oct 18, 2017

From the mailing list:

Completion is sometimes sorted differently. For example, when I wanted to
clear downloads, I used to write ":clear" and hit tab, the two results were
download-clear
history-clear
and they were alphabetically sorted. Now, the completions for that are
search
history-clear
download-clear
config-clear
and I cannot see what the pattern is, but it's not alphabetically in command
or command description, for sure. Why is this now happening?

Looks like we lose sorting after filtering. I thought just inserting items in order would be fine, but looks like I need to bring back the SortFilter's sort implementation. A bit embarrased I didn't test this 😟

@The-Compiler The-Compiler added bug: behavior Something doesn't work as intended, but doesn't crash. component: completion Issues related to the commandline completion or history. priority: 1 - middle Issues which should be done at some point, but aren't that important. labels Oct 18, 2017
rcorre added a commit to rcorre/qutebrowser that referenced this issue Nov 1, 2017
I previously removed the sorting logic from SortFilter thinking it was
unnecessary if we construct the model with a sorted list. However, this
only worked when no pattern was set, and the items are misordered as
soon as a pattern is input.

This patch reintroduces alpha-sorting, which can be disabled by passing
sort=False to the ListCategory constructor. The session completion test
had to be tweaked as it simulated the incorrect assumption that the
session list is not alpha-ordered; sessions come out of the
session-manager pre-sorted so we may as well use alpha-sorting in the
session completion model.

Resolves qutebrowser#3156.
The-Compiler pushed a commit that referenced this issue Nov 4, 2017
I previously removed the sorting logic from SortFilter thinking it was
unnecessary if we construct the model with a sorted list. However, this
only worked when no pattern was set, and the items are misordered as
soon as a pattern is input.

This patch reintroduces alpha-sorting, which can be disabled by passing
sort=False to the ListCategory constructor. The session completion test
had to be tweaked as it simulated the incorrect assumption that the
session list is not alpha-ordered; sessions come out of the
session-manager pre-sorted so we may as well use alpha-sorting in the
session completion model.

Resolves #3156.

(cherry picked from commit 47447c0)
@Hi-Angel
Copy link
Contributor

Hi-Angel commented Nov 5, 2017

Would it be possible to sort specifically by latest used? E.g. when I'm typing stuff to open I expect the link-completions I visit most often to be on the top. FTR it worked in a similar way in Pentadactyl, was really comfortable, and I often noticing I do miss this, so you could say it's tested.

@rcorre
Copy link
Contributor Author

rcorre commented Nov 5, 2017

@Hi-Angel that should be exactly how open completion works for history entries right now. If it doesn't, could you please file a separate issue with repro steps?

If you're talking about bookmark/quickmark completion, those are presented in the same order they appear in the user's bookmark/quickmark file, which gives the user control of the order.

@lahwaacz
Copy link
Contributor

lahwaacz commented Nov 5, 2017

@rcorre There is a difference between most-recently and most-often used 😉

@rcorre
Copy link
Contributor Author

rcorre commented Nov 5, 2017

Right, so which do you want? 😉

Would it be possible to sort specifically by latest used?

Latest?

I expect the link-completions I visit most often to be on the top

Or most often?

The former is implemented, the latter is possible but probably a significant amount of work. Or maybe you're looking for frecency?

@The-Compiler
Copy link
Member

Also see #601.

@Hi-Angel
Copy link
Contributor

Hi-Angel commented Nov 5, 2017

Yes, most often visited to the top.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: behavior Something doesn't work as intended, but doesn't crash. component: completion Issues related to the commandline completion or history. priority: 1 - middle Issues which should be done at some point, but aren't that important.
Projects
None yet
Development

No branches or pull requests

4 participants