sendou.ink icon indicating copy to clipboard operation
sendou.ink copied to clipboard

Undoing map bg image set should display previous bg image if any

Open Sendouc opened this issue 3 years ago • 3 comments

Now it just goes blank:

https://user-images.githubusercontent.com/38327916/203585461-af81f98c-29c9-4c89-8b78-464d8e2e7864.mov

Sendouc avatar Nov 23 '22 15:11 Sendouc

This is caused by app.resetDocument() in app\features\map-planner\components\Planner.tsx.

Further investigating would be required to see if this function call is needed & re-evaluate from there. I have a few thoughts though (I haven't read the docs yet):

  1. If the function call is needed, we would have to manually save a snapshot of the canvas history before calling resetDocument()
  2. If the function call is not needed, then we should be able to simply remove it - but it's important to know exactly what this function does & why it was here in the first place

ElementUser avatar Dec 31 '22 00:12 ElementUser

At this time, a good way to do this may be to remove the reset document call on the "Set background" button and implement a separate reset button instead. But the screen is already full of buttons, so UI-wise I don't know if that is desirable.

I do like the "Set background" button's current behaviour of actually clearing out the other stuff on the canvas though - so do we really still consider this a valid bug when it currently flows nicely UX-wise (IMO)?

ElementUser avatar Feb 11 '23 00:02 ElementUser

Yeah I think it's still an issue because when you think what you expect "undo" to do then resetting to previous state is that. + you might accidentally blow away some important progress that currently can't be restored.

Sendouc avatar Feb 11 '23 08:02 Sendouc