                             (.stopPropagation e))}
       [:p {:className "desc"} "Add a " [:span {:className "value"} name]
        (when-let [rep (get-in @aurora-state [:cache :representations name])]
-         (rep value))]
+         (rep value (assoc (last path) :sub-path [:data])))]
 
       ])))
 

             "number" (fn [x path]
                        (dom
                         (if (input? path)
                           [:input {:type "text" :defaultValue (:desc notebook)
                                    :onKeyPress (fn [e]
                                                  (when (= 13 (.-charCode e))
                                                    (update-index! (:step-var path) [] assoc (:sub-path path) (.-target.value e))
                                                    ))}]
                           [:span {:className "value"
                                   :onClick (fn []

  (swap! aurora-state update-in [:cache :inputs] dissoc id))

(defn update-index! [thing path & args]
  (if-not thing
    (throw (js/Error. "Trying to update index with nil"))
    (apply swap! aurora-state update-in
           (concat [:index (if (map? thing)
                             (:id thing)
                             thing)]
                   path)
           args)))

(defn add-index! [thing]
  (swap! aurora-state assoc-in [:index (:id thing)] thing))

(defn assoc-index-key! [thing path old-key neue-key]
  (let [final-path (concat [:index (->id thing)] path)
        cur (get-in @aurora-state (concat [:index (->id thing)] path))
        cur-value (get cur old-key)]
    (swap! aurora-state assoc-in final-path (-> cur
                                                (dissoc old-key)
                                                (assoc neue-key cur-value)))))

(defn assoc-index! [thing path v]
  (let [rev-path (reverse path)]
    (if (= ::key (second rev-path))
      (assoc-index-key! thing
                        (->> rev-path
                             (drop 2)
                             (reverse))
                        (first rev-path)
                        v)
      (swap! aurora-state assoc-in (concat [:index (->id thing)] path) v))))

(defn remove-index! [thing]
  (swap! aurora-state update-in [:index] dissoc (:id thing)))
