Some progress on getting the notebook to remember ...
# devlog-together
t
Some progress on getting the notebook to remember changes locally. https://tomlarkworthy.github.io/lopecode/notebooks/@tomlarkworthy_local-change-history.html#view=R100(S80(@tomlarkwort[…]rkworthy/module-selection)) Internally cell changes are stored in git hosted in IndexDB, and replayed on startup. I learnt a ton about working with git statelessly. Because lopecode can fork itself into new tabs, you have multiple histories (branches) but on a shared filesystem (indexdb is per origin, and the tabs are considered same origin). So the whole worktree part of git would clash, so each tab pulls and pushes into a branch based on URL (different tabs have different blob URLs) but they are all part of the same git repository, and they work without worktrees (e.g. no git checkout). Quite complicated and I am sure I will be picking out bugs for a while but I think it helps unblock using Lopecode in practice, as there is less fear that you will lose your changes. To get this working variables are now assigned a "persistent id" that survives serialization. Cool thing now is that I can correlate variable changes across tabs, so we have a true tree shaped history implemented local-first. I put some effort in trying to describe the algorithms in prose so the module is understandable. I have integrated it with the Lopecode Tour now so that now will remember user changes across page reloads