             [goog.dom :as gdom]
             [om.core :as om :include-macros true]
             [om.dom :as dom :include-macros true]
-            [ago.core :refer [make-ago-world ago-chan ago-timeout ago-snapshot]]
+            [ago.core :refer [make-ago-world ago-chan ago-timeout
+                              ago-snapshot ago-restore]]
             [cbfg.vis :refer [listen-el get-el-value get-el-innerHTML]]
             [cbfg.net :refer [make-net]]
             [cbfg.lane]

  (reset! prog-hover nil)
  (reset! prog-history []))

(defn prog-event [world label fn]
  (let [prog-frame (swap! prog-curr fn)
        ago-ss (ago-snapshot ((:get-agw (first world))))]
    (swap! prog-history #(conj % [(count %) label prog-frame ago-ss]))))

; -------------------------------------------------------------------



(defn render-events [app owner]
  (apply dom/ul nil
         (map (fn [[ts label prog-frame]]
                (dom/li #js {:onClick #(on-prog-frame-restore ts label prog-frame)
                             :onMouseEnter #(on-prog-frame-focus ts label prog-frame)
                             :onMouseLeave #(on-prog-frame-blur)}
                        (str ts (apply str label) prog-frame)))
