           [:span.link-3d3ad [:i.fa.fa-plus] "Add project"]
           [:span.link-3d3ad [:i.fa.fa-gear] "Settings"]]
         [:div.clr-737fa]]
-      (map Project (:projects app-state))]))
+      (map Project (get-ordered-projects (:projects app-state)))]))
 
 ;;------------------------------------------------------------------------------
 ;; State Change and Rendering

;; App State
;;------------------------------------------------------------------------------

(def state (atom {
  :projects {
    "/home/oakmac/t3tr0s/project.clj" {
    ;;"C:\\t3tr0s\\project.clj" {
      :compile-menu-showing? false
      :auto-compile? true
      :name "t3tr0s"

    ;; TODO: we may not even use this
    (reset! events-added? true)))

(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 init-projs!
  [projects]
  (js/console.log (pr-str projects))
  (let [projects2 (map attach-state-to-proj projects)
        filenames (mapv :filename projects2)
        project-map (assoc (zipmap filenames projects2)
                           :order filenames)]
    (swap! state assoc :projects project-map)))

(defn init! [projs]
  (init-projs! projs)
  (js/console.log (pr-str @state))
  (add-events!))
