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

Sort bookmarks in descending order by creation date #3688

Open
cryzed opened this issue Mar 8, 2018 · 6 comments
Open

Sort bookmarks in descending order by creation date #3688

cryzed opened this issue Mar 8, 2018 · 6 comments
Labels
component: urlmarks Issues related to bookmarks/quickmarks priority: 2 - low Issues which are currently not very important.

Comments

@cryzed
Copy link
Contributor

cryzed commented Mar 8, 2018

I think it makes more sense to sort the :bookmark-load list in descending order by its creation date. Currently, when I want to open a bookmark, I enter gb and then first have to scroll down a few hundred entries. More intuitive would be to show the most recent bookmarks at the top instead.

@The-Compiler
Copy link
Member

cc @rcorre - I think it'd be easy to add a reversed() there so entries added last show up first, but that'd probably conflict with the bookmark refactoring you're doing right now.

@The-Compiler The-Compiler added the priority: 2 - low Issues which are currently not very important. label Mar 8, 2018
@jgkamat
Copy link
Member

jgkamat commented Mar 8, 2018

If possible, I'd like the format in the file and the format displayed to be the same if possible. I actually re-order my bookmarks to try to reduce the tabbing I do, and if they're loaded differently from file order, that can get a bit confusing. Maybe we can insert new entries at the top of the file instead? That would leave old bookmarks in the old order though.

@cryzed
Copy link
Contributor Author

cryzed commented Mar 8, 2018

I came up with this. This keeps the order of the bookmarks/quickmarks already saved to disk, reverses the displayed and saved order of marks (of that session) and makes minimal changes to the code.

@rcorre
Copy link
Contributor

rcorre commented Mar 11, 2018

@cryzed looks simple enough to me. I don't mind much whether new marks are added to the front or back, since I usually filter them down to one by typing, but I'd be fine merging that in.

I have a WIP branch for #882 at https://github.com/rcorre/qutebrowser/tree/bookmarks. I could include it in there, or you could make a PR to my branch if you like. Or just merge to the mainline and I'll adapt.

@cryzed
Copy link
Contributor Author

cryzed commented Mar 11, 2018

The easiest thing would be for you to just include it in your branch, thank you! I'm very much looking forward to proper tags by the way, so thanks for that.

rcorre added a commit to rcorre/qutebrowser that referenced this issue Mar 15, 2018
This causes recently added marks to appear first in the completion.
As suggested by @cryzed in qutebrowser#3688.
@The-Compiler The-Compiler added the component: urlmarks Issues related to bookmarks/quickmarks label Mar 19, 2018
rcorre added a commit to rcorre/qutebrowser that referenced this issue Mar 31, 2018
This causes recently added marks to appear first in the completion.
As suggested by @cryzed in qutebrowser#3688.
rcorre added a commit to rcorre/qutebrowser that referenced this issue Apr 2, 2018
This causes recently added marks to appear first in the completion.
As suggested by @cryzed in qutebrowser#3688.
@arza-zara
Copy link
Member

I like to keep the file in the order of addition and only change the display order, so I'm using simple reversed:

diff --git qutebrowser/completion/models/urlmodel.py qutebrowser/completion/models/urlmodel.py
index ef1326b57..c722c0e63 100644
--- qutebrowser/completion/models/urlmodel.py
+++ qutebrowser/completion/models/urlmodel.py
@@ -67,7 +67,7 @@ def url(*, info):
 
     quickmarks = [(url, name) for (name, url)
                   in objreg.get('quickmark-manager').marks.items()]
-    bookmarks = objreg.get('bookmark-manager').marks.items()
+    bookmarks = reversed(objreg.get('bookmark-manager').marks.items())
     searchengines = [(k, v) for k, v
                      in sorted(config.val.url.searchengines.items())
                      if k != 'DEFAULT']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: urlmarks Issues related to bookmarks/quickmarks priority: 2 - low Issues which are currently not very important.
Projects
None yet
Development

No branches or pull requests

5 participants