Inwerpsel / use-theme-editor

A React theme editor
GNU General Public License v3.0
4 stars 0 forks source link

Improve handling of previous inspected elements in history #26

Closed Inwerpsel closed 8 months ago

Inwerpsel commented 1 year ago

If you inspect multiple elements, application history also allows you to go back to the previous elements and restores the right inspection contents for them.

While the end result is the correct behavior, the way it's done now introduces a pretty significant inefficiency that can be avoided. It depends on a delayed update of the index of the last inspected element. The delay is not noticeable, as it happens before rendering. Still it causes quite a lot of duplicate work.

It's also not the most logical flow.

Additionally, when this was made I didn't take into account the fact that you can also inspect outside the frame. So when you now do this it gets quite broken.

This predates some of the additions to state management, so those might actually find a use case in the app now.

Inwerpsel commented 1 year ago

Additionally, when this was made I didn't take into account the fact that you can also inspect outside the frame. So when you now do this it gets quite broken.

Since you can now only inspect inside the frame, this bug doesn't occur anymore.