 (defcomponent master-field-picker [selections owner]
   (render-state [_ _]
     (html
-      [:ul.available
-       (for [{:keys [name id] :as ticket-field} dummy-ticket-fields]
-         (let [is-selected (= ticket-field (:master-field selections))]
-           [:li {:class (if is-selected
-                          "active")}
-            [:a.field
-             {:value    id
-              :on-click (fn [e]
-                          (let [{:keys [pick-channel]} (om/get-shared owner)]
-                            (put! pick-channel
-                                  {:selection-to-update :master-field
-                                   :new-value           ticket-field})))}
-             name]]))])))
+
+      (let [fields-in-conditions (->> @app-state :conditions (map :master-field) set)
+            fields-not-in-conditions (difference (set dummy-ticket-fields)
+                                                 fields-in-conditions)]
+        [:td.fields
+         [:div.separator (str "Available (" (count fields-not-in-conditions) ")")]
+         [:ul.available
+          (for [{:keys [name id] :as ticket-field} fields-not-in-conditions]
+
+            [:li
+             [:a.field
+              {:value    id
+               :on-click (fn [e]
+                           (let [{:keys [pick-channel]} (om/get-shared owner)]
+                             (put! pick-channel
+                                   {:selection-to-update :master-field
+                                    :new-value           ticket-field})))}
+              name]])]
+
+         [:div.separator (str "Existing conditions (" (count fields-in-conditions) ")")]
+         [:ul.available
+          (for [{:keys [name id] :as ticket-field} fields-in-conditions]
+            [:li {:class "active"}
+             [:a.field
+              {:value    id
+               :on-click (fn [e]
+                           (let [{:keys [pick-channel]} (om/get-shared owner)]
+                             (put! pick-channel
+                                   {:selection-to-update :master-field
+                                    :new-value           ticket-field})))}
+              name]])]]))))
 
 
 






(defn main []
  (om/root
    app

           [:table.table
            [:tbody
             [:tr
              (om/build master-field-picker
                        (:selections app-state))

              [:td.key
               [:div.values
