The editor

Saving and autosave

What the browser keeps, what the account keeps, and when each of them writes.

Signed out

Everything you do is written to this browser as you work. The live document is saved a quarter of a second after you stop editing, so closing the tab loses nothing and reopening it puts you back where you were.

Pressing Save keeps the document as a project in this browser. Nothing leaves the machine, and the button's tooltip says Saved in this browser only.

This is real, but it is one browser. Clearing site data, a private window, or simply using a different laptop means a different shelf. Save to my account in the Save menu is the one press that moves it into a free account.

Signed in

Two things happen instead of one. The browser copy keeps being written exactly as above, and the project is also saved to your account about a second and a half after you stop typing.

A starter, a lesson or a gallery circuit you only opened is not an account project yet. The first real change to its circuit, code or title creates the project on your account, and every edit after that autosaves to it. The URL becomes /p/<id> so the link is stable. Pressing Save on a circuit you have not changed says Make a change, or press Save as new.

One exception: if your account has no projects yet, pressing Run or Save on the first starter keeps it as your first project, so you have one even if you only ran the example.

The Save button

It is a split button. The wide half saves. The chevron opens the rest:

  • Save a copy, which forks the open document into a second project.
  • Save to my account when you are signed out.
  • Submit to my class, when a class set this work: it saves and hands it in.
  • History, to inspect and restore earlier account saves.
  • Back to my last project, when opening a template or an example put your own work aside in this browser.
  • Download JSON, the complete Mokxi project file (.mokxi.json).
  • Download SPICE, an ngspice .cir deck for the analog part of the circuit.
  • Open JSON or SPICE…, which opens a Mokxi project or imports a SPICE netlist as parts and wires.
  • Import a project…, for Wokwi, Fritzing, Tinkercad and the other tools in importing a project.
  • Run a SPICE deck…, which runs a netlist on its own and plots the result. SPICE netlists covers this and the two above.
  • New, an empty project.
  • Built-in projects, the circuits that ship with Mokxi.

Ctrl/Cmd+S does what the wide half does, from anywhere in the editor, including the code editor.

The save state

The Save button's own word says where things stand: Save while there are changes not saved yet, Saving… while a write is in flight, and Saved when it is done. Saving stays up for a moment even when the write takes no time at all, so a save that worked is still something you saw.

Signed in, Saved means your account has it. A circuit you have not changed yet reads Save, because it is not on your account.

When a save does not go through

It does not lose work.

The connection dropped. An autosave that gets no answer, or meets a passing server error, is sent again quietly, up to three times over about a minute. The button keeps saying Save meanwhile. Only if all of those fail does the editor say Not saved: we could not reach Mokxi. Your work is still here, with Try again. It says so once, not after every keystroke.

The project changed elsewhere. If another tab or another computer saved this project since you opened it, autosave stops and the editor asks: Keep mine saves this version over it (the other stays in History), and Open the other opens that one and keeps this version in this browser.

Your session expired. The account refused the write, so the document goes to this browser instead and the editor says so. Sign in again and press Save.

Your plan is full. Free saves 10 projects; Pro and up have no limit, and the projects lessons make never count. At the limit a new project or a copy is kept in this browser, and a card offers Pro, a 7-day trial of it, or Free up room. Every project you already have keeps saving, however many there are.

More on what to do in a project did not save.

Public on Free

On Free, every new project is public: it is in the gallery and on your profile. Before your first one goes out, the editor says so once: Projects on Free are public. Anyone can find them. Upgrade to keep projects private. It is a note, not a gate. The save goes through as public whatever you press.

  • Keep it public closes the note for good.
  • Keep it private opens Pro's checkout. Come back on Pro and the project is made private by itself. If the new plan takes a moment to show, the editor waits up to about half a minute; past that the project stays as it is and Save is one press away. Leave checkout without paying and nothing changes.
  • While the 7-day Pro trial is still yours, the note also offers it, and starting it makes the project private.

Later, choosing Private or Link on Free in the share sheet opens a card for Pro instead, with Keep it public (free) as the free way on. Students in a class and children under 13 never see the note: their projects are always private. Free, Pro, Student and Classroom has the details.

Version history

Every project on your account keeps its last two hundred saves, on every plan. A save is kept each time you press Save (or Ctrl/Cmd+S) and each time you restore one. Autosaves fold into one save while you keep editing: a pause of more than a minute, or ten minutes of steady work, starts the next one. So the list is your afternoon rather than your last few keystrokes. Past two hundred, the oldest drop off.

The free plan opens and restores the newest five, enough to undo the last few changes. The older ones are still there, grayed with a padlock and Restore with Pro, under a short note saying so; Pro, Student and Classroom open all of them, and so does being a student in a class your teacher pays for. Moving from a paid plan back to Free deletes nothing: the older saves lock, and upgrading again opens them.

Open the list from History in the Save menu, or with Ctrl/Cmd+Shift+H. It opens down the right of the editor, newest save at the top, each line saying how long ago it was and what that save changed: "+2 parts", "Code changed", or the name it was given.

Click a line and that save is drawn on the canvas. You are looking at it, not editing it: the canvas is read-only while it is up, nothing is written to your account, and the work you had open is waiting behind it.

  • Back to now puts your work back exactly as it was. Closing the sheet does the same thing.

  • Restore this version makes the save on screen the project again. It is an ordinary save, so what it replaced stays in the history, so a restore you did not mean is undone by restoring the save above it.

  • Open as a copy makes the save on screen a new project of its own, and the editor carries on in it. The project it came from is not touched. Every plan has it; a copy is a new project, so the plan's project count applies.

Naming, starring and comparing (Pro)

On Pro, Student and Classroom, a save on screen also has:

  • Name this save: type a few words ("Motor working", "Before the rewire") and press Save name or Enter. The name heads that line in the list.
  • Star: marks a save to find again. A named or starred save is kept for good, past the two hundred, up to twenty of them per project; unstar one or clear its name to make room.
  • Compare with now (or Compare): what changed between this save and your work, or between any two saves. The counts come first (parts added, removed and moved, wires changed), then Parts and wiring listed before and after, then the code line by line. Side by side puts the old line on the left and the new one on the right; One column puts them back in one list with + and - signs.

On Free those three are replaced by a short note saying they come with Pro, and Restore and Open as a copy work as before.

History needs a project saved to an account. Signed out, or on a document you have never saved, the sheet says so in one line: there is nothing kept to list. Someone else's project has a history too, and it is theirs, not yours. Fork it and your own history starts from the fork.

Watching, not editing

Opening someone else's project, or joining a live room with a watch link, puts the editor in a read-only state. Pressing Save there forks the project into one of your own rather than refusing. See sharing a project.