WIP Undo Support

Currently you can only undo removing a card. Here’s the full list of undo operations I’m looking to support so that you can feel more secure/safe when making big changes or trying stuff out

Planned Undo Support

Is there anything I’m missing here?

Card(s)

  • move card
  • rename card
  • remove card
  • update card metadata (eg frames, color)
  • split cards

Connection(s)

  • create connection
  • remove connection
  • change connection type
  • toggle label visible

Connection Type

  • rename connection type
  • change connection type color

Additional considerations

plz let me know if these would cause issues for your workflow

  • Possibly, for performance reasons, I’ll cap the undo stack at 30-50 actions, but I’m not sure if that’ll be needed yet.
  • When you switch spaces, the undo stack will be cleared
  • When collaborating with others you can only undo your actions (this is consistent with how gdocs etc works too I think)

other requests for undo:

5 Likes

I know this is a huge undertaking, but I think it’s worth it. It will make Kinopio feel even more effortless and nimble. It will free users to experiment, explore, and expand their thinking.

btw, Steve Ruiz of tldraw is doing some amazing work. Maybe you can find some tips or inspiration: https://twitter.com/steveruizok/status/1487052071685734410

–ben

3 Likes
  • expand/collapse comment card
  • moving cards to another space
  • copying cards to another space
2 Likes

What if users opens a new space in a new tab / window ?

2 Likes

The stack lives in memeory so a new window/tab = an independent undo stack

2 Likes

Wohooooooooo

3 Likes

the beta of undo/redo is now testable in https://deploy-preview-234--kinopio-client.netlify.app. Please let me know if you find any bugs/issues! Hopefully it’ll be ready for a Monday release.

similar to the above, here’s a list of supported actions that can be undo-ed

Card(s)

x move/drag card
x move/drag card multiple
x rename card
x rename card multiple
x check off card
x check off multiple
x remove card from carddetails btn
x remove card from empty card
x remove selected cards w delete key
x remove selected cards from multiactions button
x update card metadata (eg frames, color)
x update card metadata from multiactions
x split cards
x expand/collapse comment card
x moving cards to another space (undo remove card from current space)
x ctrl-x to cut cards
x drag img card to resize
x doubleclick to reset resize
x remove pasted cards (cardCreated)
x restore cut cards (cardRemoved)
x lock card

Connection(s)

x create connection
x change connection type
x toggle label visiblecreate/disconnect
x remove connection
x connect from multiactions
x remove connection from multiactions

Connection Type

x rename connection type
x change connection type color

3 Likes

Awesome to see redo work too! (⌘-Shift-Z).

Will there be a way to undo on touch/mobile?

1 Like

I tried moving cards to another space. Two observations:

  1. I selected two connected cards. I moved them to another space. When I undo’d, they came back piecemeal. In other words, I got card 1, then the connection, then card 2, even though I moved them as a selected group. That seems weird, especially when you can end up in this state:

image

  1. Undoing the move did not remove them from the space I originally moved them to. That seems like a bug too.

:slight_smile:

2 Likes

i’m not sure if updating cards in other spaces should be part of the undo system. I get the expectation, but manipulating other spaces opens up a lot of complexity here. I’ll have a think on it…

2 Likes

just released a fix for this

1 Like

right now the history length is unlimited (it’s reset when you change spaces though). I’m wondering whether there’s an irl performance penalty when you have a huge list of undo history (eg after working in a space for a long time) or whether I need to explicitly cap the history length

1 Like

added mobile support:

  • double tap with two fingers to undo
  • double tap with three fingers to redo

(based on procreate)

1 Like

hmm… for mobile, should I show a little notification when you undo/redo? It doesn’t feel necessary when you use keyboard shortcuts but I wondering if it’s useful for accidental triggering cases with touch?

1 Like

A notification might help too because with the much smaller viewport, you might not even see what was undone.

1 Like

added notifications for undo/redo when using touch

Screen Shot 2022-02-24 at 5.49.12 PM

2 Likes

aside:

:record_button: in the logs you can see the ‘patches’ (aka changes/events) that are being added to the history stack.

:rewind: :fast_forward: on undo or redo, the logs describe the patch that’s being undone/redone

this might be helpful if errors prop up in the future , but hopefully it’ll only need to be used for your own edification

1 Like

I think there’s a bug in this preview — it doesn’t reproduce every time but it’s pretty common.

Step 1: Create a card, type something, press Enter
Step 2: Select the card by dragging on the background
Step 3: Try to move the card

This results in it staying put and not moving :confused:

Other than that the undo-redo functionality is awesome!!

2 Likes

Thanks for the catch, will look into it!

2 Likes

I found a bug in this preview: I have a locked card. If I start a connection from another card onto the lock icon of the locked card and release my mouse, it unlocks the card.

This doesn’t happen in prod.

1 Like