# Local undo action

**URL:** https://discuss.prosemirror.net/t/local-undo-action/8223
**Category:** Uncategorized
**Created:** [February 19, 2025, 4:10pm UTC](https://discuss.prosemirror.net/t/local-undo-action/8223 "2025-02-19T16:10:16Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Okar](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/okar/32/678_2.png) [@Okar](https://discuss.prosemirror.net/u/Okar)
#### Post date: [February 19, 2025, 4:10pm UTC](https://discuss.prosemirror.net/t/local-undo-action/8223/1 "2025-02-19T16:10:16Z")

</div>

I have actions available to the user that only modify some local application state, no document changes, but I would like these to be undoable via the same history plugin undo flow as normal edits since that is how they appear to the user.

My idea was to create a new Step thinking I could get the collab plugin to ignore them (ie no `version` increment or sendable steps, keeping them totally local) but it does not seem possible.

Do I need to find another way?

---

<div class="post-metadata">

### Author: ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)
#### Post date: [February 19, 2025, 4:29pm UTC](https://discuss.prosemirror.net/t/local-undo-action/8223/2 "2025-02-19T16:29:54Z")

</div>

Indeed, all steps are picked up by the collab extension, and since the undo history only stores steps, this may be hard to work around.

---

<div class="post-metadata">

### Author: ![ViktorVaczi](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/viktorvaczi/32/1919_2.png) [@ViktorVaczi](https://discuss.prosemirror.net/u/ViktorVaczi)
#### Post date: [February 20, 2025, 1:03am UTC](https://discuss.prosemirror.net/t/local-undo-action/8223/3 "2025-02-20T01:03:02Z")

</div>

What is it that you’re trying to achieve? If it’s local application state then why do you store that information in the ProseMirror document?

---

<div class="post-metadata">

### Author: ![Okar](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/okar/32/678_2.png) [@Okar](https://discuss.prosemirror.net/u/Okar)
#### Post date: [February 20, 2025, 7:38am UTC](https://discuss.prosemirror.net/t/local-undo-action/8223/4 "2025-02-20T07:38:42Z")

</div>

Per-user visualization settings, I’m not storing it in the document, I simply want to use a single undo flow.

---

<div class="post-metadata">

### Author: ![ViktorVaczi](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/viktorvaczi/32/1919_2.png) [@ViktorVaczi](https://discuss.prosemirror.net/u/ViktorVaczi)
#### Post date: [February 20, 2025, 12:23pm UTC](https://discuss.prosemirror.net/t/local-undo-action/8223/5 "2025-02-20T12:23:44Z")

</div>

A hacky idea: you _could_ store an invisible `Mark` on the root node for each user I think ( although it won’t work with YJS unless you patch `y-prosemirror` ). Or you could create an external history that tracks both editor and visualisation change events, and passes the undo/redo command to the ProseMirror history if that’s on top.
