fn push_undo_json(undo: &mut Vec<String>, redo: &mut Vec<String>, json: String)
Push an undo snapshot (capped) and clear the redo history.