Geopard icon indicating copy to clipboard operation
Geopard copied to clipboard

New bookmark backend + UI

Open tfuxu opened this issue 1 year ago • 14 comments

This PR will contain an dedicated window for bookmarks management, Add Bookmark popover and redesigned bookmarks structure based on TOML file format.

Things to do:

  • [ ] Create dedicated bookmarks window:
    • [x] Create initial, proof-of-concept UI file and Rust code
    • [ ] Add edit bookmark functionality
    • [ ] Implement basic list management (edit, select, delete)
    • [x] Integrate logic with new bookmark format
  • [ ] Add New Tab view
  • [x] Implement new bookmark format similar to Geopard's configuration
  • [ ] Create Add Bookmark popover
Bookmarks Window New Tab View
Screenshot from 2024-02-22 00-46-17 Screenshot from 2024-02-22 00-42-30

tfuxu avatar Feb 10 '24 20:02 tfuxu

I appreciate it. Though I wouldn't save the bookmarks to a toml file. I'd keep a .gemini format. Bookmarks are a list of links anyways and Gemini can fully describe that.

ranfdev avatar Feb 10 '24 20:02 ranfdev

I see, but I wanted to switch to TOML to allow users to set custom descriptions and tags for better organizing. A bookmark structure similar to the config one is much more flexible and will easily allow more features to be added in the future, such as custom icons (when icons will eventually be supported).

Also, I will write migration code for users upgrading from older bookmarks format, so no manual migration will be needed.

tfuxu avatar Feb 10 '24 21:02 tfuxu

If there's an automatic migration, I approve

ranfdev avatar Feb 11 '24 08:02 ranfdev

@ranfdev This is the current draft structure for bookmarks file:

[bookmark.1]
title = "TestSite0"
description = "Test Site no. 0"
url = "gemini://example.com"

[bookmark.2]
title = "TestSite1"
url = "gemini://example.com"

[bookmark.3]
title = "TestSite2"
description = "Test Site no. 2"
url = "gemini://example.com"

[bookmark.5]
title = "TestSite4"
description = "Test Site no. 4"
url = "gemini://example.com"

Looks good? or would you like something changed?

tfuxu avatar Feb 19 '24 23:02 tfuxu

What's the advantage of using the syntax [bookmark.$i] instead of [[bookmarks]] (array of tables, https://toml.io/en/v1.0.0#array-of-tables)?

ranfdev avatar Feb 19 '24 23:02 ranfdev

I think having an ID for a bookmark will make it easier to retrieve a particular bookmark struct in BookmarksWindow's item search and sorting.

tfuxu avatar Feb 20 '24 11:02 tfuxu

I think the [[bookmarks]] syntax makes it easier to edit the file by hand, because the user doesn't have to manually track which id is already used. But in 99.99% of cases the user won't edit the file manually, so feel free to decide what's more practical.

ranfdev avatar Feb 21 '24 16:02 ranfdev

I'll see. If I could make edit functionality to work reliably with vector indexes, then for simplicity (and for those who like fiddling with bookmark files), I will switch to [[bookmarks]] syntax.

tfuxu avatar Feb 21 '24 23:02 tfuxu

Here's current new tab design: Screenshot from 2024-02-22 00-42-30

tfuxu avatar Feb 21 '24 23:02 tfuxu

I have mixed feelings about it. The design doesn't feel quite in line with the rest of the GNOME apps. Compared to an Adw.StatusPage, I can see the following differences:

  • spacing between title and logo
  • border radius of the search bar vs border radius of the adwaita boxed list
  • list row items usually don't have an icon at the start. And the internal left margin is different image

Also, this feels like a slight loss of functionality. Before, the user could see his bookmarks as soon as possible. Now he gets a new tab page with duplicate functionality, because the search bar already exists (and is focused by default).

The new tab page is seen a lot, so I do care a lot about it.

ranfdev avatar Feb 22 '24 09:02 ranfdev

The border radius and margin are different, because this is just a SearchEntry with set height request. About spacing between logo and title, here's an updated design using StatusPage: Screenshot from 2024-02-22 23-58-36

Also, this feels like a slight loss of functionality. Before, the user could see his bookmarks as soon as possible. Now he gets a new tab page with duplicate functionality, because the search bar already exists (and is focused by default).

How about adding something similar to what Firefox has with "Shortcuts"? It could show 5 newest bookmarks, or like in Chrome and Opera, it could show sites that user frequently visits (but this would need to be set manually by user, as we don't have persistent history).

Reference images:

Firefox: Screenshot from 2024-03-02 17-51-52 Opera: image Chrome: image

tfuxu avatar Mar 02 '24 17:03 tfuxu

Also, here's the design for bookmark popover: Screenshot from 2024-03-02 16-47-24

tfuxu avatar Mar 02 '24 17:03 tfuxu

Imagine if bookmarks had tags. At that point the new tab page could show bookmarks tagged with "new_tab", below the search bar similar to what Firefox is doing.

Then you could add some default bookmarks with that tag, so that new users have an initial list of websites to discover the Gemini space

ranfdev avatar Mar 02 '24 22:03 ranfdev

@ranfdev I'll be splitting this PR into several smaller ones, as it will be easier for me to develop those changes one at the time (and for you to review them afterwards).

tfuxu avatar Apr 12 '24 16:04 tfuxu