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

New bookmark backend + UI #92

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft

Conversation

tfuxu
Copy link
Contributor

@tfuxu tfuxu commented Feb 10, 2024

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:
    • Create initial, proof-of-concept UI file and Rust code
    • Add edit bookmark functionality
    • Implement basic list management (edit, select, delete)
    • Integrate logic with new bookmark format
  • Add New Tab view
  • 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

    - add `library-symbolic` to icons
    - modify `open_in_new_tab` to allow automatically switching to opened tab
    - update `open-in-new-tab` signal in signals vector (hypertext.rs)
@ranfdev
Copy link
Owner

ranfdev commented Feb 10, 2024

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.

@tfuxu
Copy link
Contributor Author

tfuxu commented Feb 10, 2024

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.

@ranfdev
Copy link
Owner

ranfdev commented Feb 11, 2024

If there's an automatic migration, I approve

@tfuxu tfuxu changed the title Add dedicated bookmarks window New bookmark backend + UI Feb 11, 2024
@tfuxu
Copy link
Contributor Author

tfuxu commented Feb 19, 2024

@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?

@ranfdev
Copy link
Owner

ranfdev commented Feb 19, 2024

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)?

@tfuxu
Copy link
Contributor Author

tfuxu commented Feb 20, 2024

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.

@ranfdev
Copy link
Owner

ranfdev commented Feb 21, 2024

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.

@tfuxu
Copy link
Contributor Author

tfuxu commented Feb 21, 2024

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
Copy link
Contributor Author

tfuxu commented Feb 21, 2024

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

@ranfdev
Copy link
Owner

ranfdev commented Feb 22, 2024

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.

@tfuxu
Copy link
Contributor Author

tfuxu commented Mar 2, 2024

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
Copy link
Contributor Author

tfuxu commented Mar 2, 2024

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

@ranfdev
Copy link
Owner

ranfdev commented Mar 2, 2024

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

@tfuxu
Copy link
Contributor Author

tfuxu commented Apr 12, 2024

@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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants