previewjs icon indicating copy to clipboard operation
previewjs copied to clipboard

Preserve undo history after clearing properties tab

Open valtism opened this issue 3 years ago • 5 comments

Describe the bug

Hello again 👋🏻 (can you tell I'm finally using the extension properly? 😂 It's super great btw).

If you clear the Properties input using the refresh icon, you cannot get back what you have with cmd + z. It would be great to preserve history to undo a clear done by mistake.

[aside] I have hit this a few times now accidentally thinking it would refresh the page. I would consider changing the icon to something like a 🚫 or a 🗑

Reproduction

  1. Open the Properties pane in text mode
  2. Type some properties in
  3. Clear with clear button
  4. Try to undo with cmd + z

Preview.js version

v1.11.0

Framework

React 17

System Info

MacOS 12.5
VS Code 1.70.1

Used Package Manager

yarn

Extension logs (useful for crashes)

No response

Preview logs (useful for rendering errors)

No response

Repo link (if available)

No response

Anything else?

No response

valtism avatar Aug 12 '22 12:08 valtism

Good idea! Would you imagine Cmd+Z working with the structured props editor too?

fwouts avatar Aug 12 '22 13:08 fwouts

Yes, that would be ideal!

valtism avatar Aug 12 '22 14:08 valtism

Also, is it a known bug that functions don't really work in the GUI props editor? I can't really do much with them there and have to use the code view to input them. I can open a new issue if not

valtism avatar Aug 12 '22 14:08 valtism

At the moment function props can only return a value, they can't have a body. Probably worth opening another issue for this explaining your use case for it!

fwouts avatar Aug 12 '22 14:08 fwouts

Will do, thanks!

valtism avatar Aug 12 '22 14:08 valtism