microsoft / vscode-notebook-renderers

MIT License
115 stars 36 forks source link

Add clipboard support for image/webp #188

Open BlackHC opened 11 months ago

BlackHC commented 11 months ago

This requires using a canvas object to render the webp to png as image/webp is not supported (by Chromium at the very least).

Manually tested in Chrome 119.0.6045.199 (Official Build) (arm64).

BlackHC commented 11 months ago

Thank you so much for the approval.

  1. For the two failing checks - is there any information on why they failed? I don't have access to the Azure logs.

  2. I've been using this quite heavily, and there is a quirk I have found: when you click on copy, it takes a short amount of time to convert the webp to png for the clipboard blob. If the user clicks on the copy button and then immediately switches to a different window, the clipboard operation can fail with DOMException: Document is not focused. I don't think there is an easy fix.

I don't have the Javascript/VSCode knowledge to add a spinner or similar to the code, which might be a UX fix.

DonJayamanne commented 8 months ago

Apologies for never getting back on this, will get this sorted out this week.