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

Emoji Favicons for bookmarks #90

Merged
merged 4 commits into from Sep 18, 2020
Merged

Emoji Favicons for bookmarks #90

merged 4 commits into from Sep 18, 2020

Conversation

alexwennerberg
Copy link
Contributor

Hi! I decided I want to help contribute to this project when I have time, and I thought this would be a good issue to get started with -- #69

This isn't a perfect solution -- it just pulls from the cache right now if it's there. I can think of three solutions to this problem:

  1. Persist the cache somehow on close / startup
  2. Make gemini requests to grab favicons when opening bookmarks page, or on startup (seems slow, esp with many bookmarks)
  3. Load icon only if it is already saved in the cache (my solution)

My solution is partway towards a solution based on 1. which seems to me like the best approach. What do you think?

Thanks for making this tool!

@makew0rld
Copy link
Owner

Hello, thanks for contributing!

I didn't say this in the issue, I should have, but my preferred way of doing this is to actually write the favicon to the bookmarks file. Like when you press Ctrl-D to create a bookmark for the first time, the default text starts with the favicon for the page if it exists, and a space. And if the favicon for the page changes, you can delete the bookmark and make a new one, or change it yourself. This seems like a simpler solution that allows the user to control what the bookmarks look like too. This is basically your solution 1, "persist the cache".

Load icon only if it is already saved in the cache

The main problem with this that I see is that since the cache is new on startup, usually most of the bookmarks won't have favicons at all. You'd have to visit all your bookmarked sites and never close Amfora for them to display the way you'd expect.

What do you think of my solution? Could you change your PR to implement it? Let me know.

@alexwennerberg
Copy link
Contributor Author

alexwennerberg commented Sep 16, 2020 via email

@makew0rld
Copy link
Owner

Ok, glad you agree! Thanks.

@alexwennerberg
Copy link
Contributor Author

OK, I think I have a change does what you're looking for -- let me know what you think!

@makew0rld
Copy link
Owner

Thanks for adding this! Looks mostly good, but one bug I noticed was that the favicon gets added twice if I try to change the bookmark. For example, if you visit a site with a favicon, and then create a bookmark, the default bookmark text is <favicon> . I can add a bookmark, like <favicon> My Fav Capsule, but if I go back to that site and try to change the bookmark (with Ctrl-D) again, the default text that comes up is not the actual bookmark text, but <favicon> <favicon> My Fav Capsule.

Maybe you could add code that checks if the bookmark already starts with the current site's favicon, and only prepend the favicon if it doesn't?

@alexwennerberg
Copy link
Contributor Author

Should be fixed now! However, I realized there seems to be a bug with updating bookmarks -- created a separate issue here: #92

@makew0rld makew0rld marked this pull request as ready for review September 18, 2020 21:43
@makew0rld
Copy link
Owner

Looks like the original issue I had was fixed. Thanks for this PR!

@makew0rld makew0rld merged commit cceedfa into makew0rld:master Sep 18, 2020
makew0rld added a commit that referenced this pull request Sep 18, 2020
@alexwennerberg
Copy link
Contributor Author

alexwennerberg commented Sep 19, 2020 via email

@makew0rld makew0rld changed the title Emoji Favicons Emoji Favicons for bookmarks Oct 29, 2020
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.

None yet

2 participants