         [:table.tbl-bdf39
           (bld-tbl-hdr)
           (map-indexed
-            #(BuildRow (assoc %2 :idx %1 :prj-key prj-key))
-            (:builds prj))]])))
+            (fn [idx bld-id]
+              (let [bld (get-in prj [:builds bld-id])]
+                (BuildRow (assoc bld :idx idx
+                                     :prj-key prj-key))))
+            (:builds-order prj))]])))
 
 (quiescent/defcomponent AppRoot [app-state]
   (sablono/html


   ;; from project.clj, but with extra tool state
   ;; (see initial-project-build-state)
   :builds []})

(defn attach-state-to-build
  "Attach state to project-build map, and prune out unused keys"
  [build]
  (let [keep-keys [:id
                   :source-paths
                   :compiler]]
    (-> initial-project-build-state
        (merge (select-keys build keep-keys)))))

(defn attach-state-to-proj
  "Attach state to project map, and prune out unused keys"
  [project]
  (let [keep-keys [:filename
                   :name
                   :version
                   :license
                   :dependencies
                   :plugins]
        builds (->> project :cljsbuild :builds (mapv attach-state-to-build))]
    (-> initial-project-state
        (merge (select-keys project keep-keys))
        (assoc :builds builds))))

(defn add-project!
  [project]

  ;; stop the process
  (exec/stop-auto prj-key))

(defn- click-compile-options [js-evt prj-key]
  (.stopPropagation js-evt)
  (swap! state update-in [:projects prj-key :compile-menu-showing?] not))
