       (update-index! notebook [:pages] conj (:id page))
       page)))
 
-(defn add-step! [notebook-id page-id info])
+(defn add-step! [page info]
+  (let [step (merge {:id (compiler/new-id)} info)]
+    (when (ast/step! (:index @aurora-state) step)
+      (add-index! step)
+      (update-index! page [:steps] conj (:id step))
+      step)))
 
 ;;*********************************************************
 ;; Aurora state (storage!)

   (or (true? x) (false? x)) "boolean"
   (number? x) "number"
   (string? x) "string"
   (map? x) "list"
   (vector? x) "table"
   :else (str (type x))))

(defn item-ui [x]
  (if (= (:type x) :ref)
    (ref->name x)
    (let [value (or (:value x) (-> x :node :value) x)
          name (datatype-name value)]
      (if-let [rep (get-in @aurora-state [:representation-cache name])]
        (rep value)
        (pr-str x)))))

(defmethod step-list-item :data [step path]
  (let [value (-> step :node :value)
        name (datatype-name value)]
    (dom
     [:li {:className (step-class path)
           :onClick (step-click path)}
      [:p {:className "desc"} "Add a " [:span {:className "value"} name]
       (when-let [rep (get-in @aurora-state [:representation-cache name])]
        (rep value))]

      ])))

(defmethod step-description :data [step path]
  (let [value (-> step :node :value)
        name (datatype-name value)]
    (dom
      [:p {:className "desc"} "Add a " [:span {:className "value"} name]])))


(defdom editing-view []
  [:div
   (steps-list (current :page))
   (step-canvas (current :step) (:step @aurora-state))])

(defdom new-step-helper []
