   (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 prog-event [world label prog-frame-fn]
+  (let [prog-next (swap! prog-curr prog-frame-fn)
+        ts (count @prog-history)]
+    (swap! prog-history #(conj % [ts label prog-next]))
+    (swap! prog-ss #(assoc % ts (ago-snapshot ((:get-agw (first world))))))))
 
 ; -------------------------------------------------------------------
 

            [cbfg.world.lane]
            [cbfg.world.base :refer [world-cmd-loop]]))

(def prog-base    (atom {}))  ; Stable parts of prog.
(def prog-curr    (atom {}))  ; The current prog-frame.
(def prog-hover   (atom nil)) ; A past prog-frame while hovering over prog-history.
(def prog-history (atom []))  ; Each event is [ts label prog-frame agw-snapshot].

(defn prog-init [world]
  (reset! prog-base {:world world


(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)))
