   ; - But you can create the card at the top
   ; - And then you can assemble them (group-by or filter)
   (let [filter (r/cursor app-state [:filter])
-        card-ids (filter-by-title @filter (:cards @app-state))
-        card-cursors (map #(r/cursor app-state [:cards %1]) card-ids)]
+        cards (reaction (filter-by-title @filter (:cards @app-state)))
+        card-ids (reaction (map first @cards))
+        card-cursors (map #(r/cursor app-state [:cards %]) @card-ids)]
     [:div
      ; TODO - Try to add a button to show details to all tickets
      (render-filter filter)

  [status cards]
  (filter #(= status (-> % deref :status)) cards))

(defn filter-by-title
  "Return the id of the cards that contains the searched string inside their title"
  [filter cards]
  (->>
    (if (empty? filter) cards
     (filter #(utils/str-contains (-> % second :title) filter) cards))
    (map first)
  ))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(defn render-card
  ; TODO - Try to avoid the update-card! use and use messages / cursors
  ; * Fix the filter on top of the board to provide cursors down?
  [card-ref]
  (let [show-details (::show-details @card-ref)
        toggle-details #(swap! card-ref update-in [::show-details] not)
        title-style (if show-details :div.card__title--is-open :div.card__title)
        details-style (when-not show-details {:style {:display "none"}})]
    [:div.card
     [:div {:style (card-side-color @card-ref)}]
     [title-style {:on-click toggle-details} (:title @card-ref)]
     [:div.card__details details-style
      (:description @card-ref)
      [render-tasks card-ref]
      [render-add-task card-ref]
    ]]
  ))

