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

instant bookmarks #2176

Merged
merged 1 commit into from Nov 8, 2023
Merged

instant bookmarks #2176

merged 1 commit into from Nov 8, 2023

Conversation

ds300
Copy link
Collaborator

@ds300 ds300 commented Nov 8, 2023

this PR does a couple of things when creating bookmarks

  • any time a url was pasted it was previously calling fetch on the url to check whether the url is an image that we have cors access to. In that case we can paste the image itself rather than a bookmark. But that's gonna be a relatively rare use case, and the check itself seemed to cost anywhere from 200ms to +1s which is certainly not worth it when the fallback behaviour (create a regular bookmark) is fine. So i moved that check behind a url pathname extension check. i.e. if the url pathname ends with .gif, .jpg, .jpeg, .svg, or .png, then it will check whether we can paste the image directly, otherwise it will always do a regular bookmark.
  • we create an asset-less bookmark shape on the canvas while we wait for the asset to load if it is not already available. This means the user gets immediate feedback that their paste succeeded, but they won't see the actual bookmark details for a little bit.

It looks like this

Kapture 2023-11-08 at 10 34 35

Change Type

  • minor — New feature

Release Notes

  • Improves ux around pasting bookmarks

@huppy-bot huppy-bot bot added the minor Increment the minor version when merged label Nov 8, 2023
Copy link

vercel bot commented Nov 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
examples ✅ Ready (Inspect) Visit Preview Nov 8, 2023 10:48am

@ds300 ds300 added this pull request to the merge queue Nov 8, 2023
Merged via the queue into main with commit 133b8fb Nov 8, 2023
6 checks passed
@ds300 ds300 deleted the david/instant-bookmarks branch November 8, 2023 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Increment the minor version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant