Saving and playback of coding sessions

Hi all,

In my projects, many times I have to go back to working on a feature that has not been active for a long time. It usually takes me a considerable amount of time to remember what was what, what I was trying to accomplish, and generally to get into flow working productively on the code.

There is a way to make the transition faster and easier. If I am able to “record” my coding session as I work and save it somewhere and also be able to “playback” a saved session. Then, whenever I want to resume work on a feature, I can watch myself opening files and adding/editing/deleting code and remember exactly what I was doing and where should I resume and what to do.

I suspect the building blocks of such feature already exist in the Teletype package. When someone opens a Teletype portal and a colleague joins the session, the actions of each party are serialized and sent to other peers and once received are de-serialized and re-animated. So in the Teletype package there exists a way to serialize keystrokes, cursor jumps, highlights, opening files, etc. Instead of sending that data over the wire it can be added to a buffer and saved. The re-animation part is also what we need for the playback. We should of course remove the inactive times and speed up the animation so that watching the playback would take much shorter than the actual coding session.

I am new to Atom and have only briefly glanced at the source of Teletype. From what I have seen, the code is not very accessible to someone with below average JS proficiency as myself. So, I thought I would share this idea with the community hoping someone more skilled might be interested in it. I might also try to understand the relevant parts of the code from Teletype source and attempt writing a package if no one expresses interest in working on such feature. In that case I’d appreciate any and all guidance you guys could offer.

local-history is one package to explore.
Snapshots are placed in ~/.atom/local-history/
You can build on this. You might need to link these to extra notes to jog your memory.

Thank you for the suggestion, but I really do not want to compromise on this and settle for session snapshots and notes. I have very high hopes that the ability to see the code being written would make resuming work so much easier and would be a huge productivity boost.

Macros then, like Sublime Text 3 ???
If you plan to replay and sync flow of typing (including corrections) like a video player that surely will be tricky, but possible. Certainly I have looked at better ways of giving tutorials than YouTube screenshots and one way is to record the key sequences and replay on a live session. For example there is a virtual desktop instance of Atom I have experimented with, and automation scripts can “drive” such a remote session.

I have had this request parked.

On further thought I conclude that to replay workflows I need more than just simply replaying code in the editor (teleprinter style).

For example, looking at a Jupyter notebook file I tested yesterday I want to replay the terminal commands.

conda activate Python-38
voila helloworld.ipynb

Or some Atom commands.

I might wish to go back further in time to explore what commands led me to that point.

I view $ history and I see all the commands I ran.

I run $ history | grep conda

and I see all conda commands which I can trim by date to be only related to the date of the file I am replaying.

In other words to replay a coding session I need answers to following:

What is creation date of archived file?
What is change date of file?
What archived terminal history that day?
What conda packages installed to that day?
What archived conda environment that day?
What support notes apply?

In my Linux Ubuntu 20.04 desktop there is an application Back in Time where I can include and exclude resources. I imagine that some app like this can be configured to take snapshots of files and associated data such as environment, to be replayed at a later date. Replaying a file character by character or line by line in the editor is the least of the challenges. However, I do see a solution for one-to-one (solo) or one-to-many (team work) by using messaging protocol (RabbitMQ).

I will in time create an automation script which follows the above for my own workflows. I have already tested RabbitMQ in a localhost round robin test (one-to-one).