Skip to content
This repository has been archived by the owner on Jul 23, 2019. It is now read-only.

Tree history #29

Closed
passcod opened this issue Mar 7, 2018 · 2 comments
Closed

Tree history #29

passcod opened this issue Mar 7, 2018 · 2 comments

Comments

@passcod
Copy link

passcod commented Mar 7, 2018

I'm not sure whether this is a "can be addressed later" issue or a "should be considered in early designs" issue, hence this.

One of the distinctive features of advanced editors e.g. vim is the history tree, that is, recognising that undo/edit history is sometimes not linear and handling that natively. Atom doesn't do that, but perhaps XRay could? It can still be presented as linear by default.

This might also be a consideration with a multi-player editor, i.e. should each user have their own history, the global history, or some mixture of the two?

Anyway, is this something you've thought about or will be?

@as-cii
Copy link
Contributor

as-cii commented Mar 9, 2018

Hello @passcod and thanks for the feedback!

The core data structure powering xray is a CRDT where every fragment in the tree represents an insertion that some local or remote user has made in the past. By its very nature, this data structure allows to undo and redo the effect of any insertion, independently of when such insertion was made (i.e., the history can be non-linear). As a result, we can support a non-linear history in the local scenario as well as a per-user (or global, or a mix of both) history in the multi-user scenario.

So, to answer your question, I think architecturally this leaves the door open to support all kinds of cool history navigation. We haven't really sketched out what a coherent user experience for non-linear navigation would look like, but it's definitely something that we have thought about doing in the past. Considering that the data structure already supports such use cases by design, I wouldn't exclude that a more advanced non-linear history UX could also be provided by an extension as opposed to offering it by default in core.

Hope this helps!

@as-cii as-cii closed this as completed Mar 9, 2018
@passcod
Copy link
Author

passcod commented Mar 9, 2018

Awesome, thanks for the explanation!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants