 (defonce app-state 
   (atom {:ready? false
          :deployments {}
-         :deployment {:jobs []
+         :deployment {:tracking-id nil
+                      :jobs []
                       :selected-job nil
-                      :entries []}}))
+                      :message-id-max nil
+                      :entries {}}}))
 
 (let [{:keys [chsk ch-recv send-fn state]}
       (sente/make-channel-socket! "/chsk" {:type :auto})]

                     (dom/th "ID")
                     (dom/th "Time")))
                 (dom/tbody
                   (for [job (reverse (time (sort-by :created-at (vals jobs))))] 
                     (let [job-id (:id job)] 
                       (dom/tr {; make this a class
                                :style {:background-color (if (= job-id selected-job)

  (def chsk-send! send-fn)
  (def chsk-state state))

; (defn stop-tracking! [deployment-id]
;   (chsk-send! [:deployment/track-cancel deployment-id]))

(defn start-tracking! [deployment-id]
  (let [tracking-id (uuid/make-random)] 
    (swap! app-state assoc :deployment {:tracking-id tracking-id
                                        :id deployment-id
                                        :entries {}})
    (chsk-send! [:deployment/track {:deployment-id deployment-id
                                    :tracking-id tracking-id}])
    false))

(defcomponent select-deployment [{:keys [deployments deployment]} owner]
  (render [_] 
