         body))
 
 (defn -view
-  [{:keys [visible? toggle-visibility-shortcut persist? initial-model signal-events action-events :highlighted-signal-id]}
+  [{:keys [visible? toggle-visibility-shortcut persist? initial-model signal-events action-events]}
    dispatch]
   [-overlay
    [-resizable-div {:style {:display          (if @visible? "block" "none") ; using CSS instead of React in order to persist resized frame on toggling visibility

     [:hr]
     [-initial-model-view @initial-model]
     [:hr]
     [-signals-view @signal-events @action-events @highlighted-signal-id dispatch]]]])

;;;;;;;;;;;;;;;;;;;;;;;; Middleware
(defn -wrap-load-from-storage

                 (reconcile [::app-action (:id unknown-signal-event) action]))))))

;;;;;;;;;;;;;;;;;;;;;;;; View model
(defn -signal-parent-ids
  "Returns a set containing: id of parent, parent of parent, etc. "
  [signal-events id]
  (let [id->parent-id (atom {})
        result (atom #{})]
    (doseq [{:keys [id parent-id]} signal-events]
      (swap! id->parent-id assoc id parent-id))

    (loop [child-id id]
      (if-let [parent-id (@id->parent-id child-id)]
        (do
          (swap! result conj parent-id)
          (recur parent-id))

        @result))))

(defn -view-model
  [model]
  (let [debugger (reaction (::debugger @model))
        signal-events (reaction (-> @debugger :signal-events))
        highlighted-signal-id (reaction (-> @debugger :highlighted-signal-id))
        highlighted-signal-ids (reaction (into #{@highlighted-signal-id}
                                               (-signal-parent-ids @signal-events @highlighted-signal-id)))]
    (-> (mvsa/track-keys debugger
                         [:initial-model :persist? :visible? :toggle-visibility-shortcut :action-events])
        (assoc :signal-events (reaction
                                ; mapv instead of map is essential, without it referenced reactions will be recalculated several times
                                (mapv #(assoc % :highlighted? (contains? @highlighted-signal-ids (:id %)))
                                      @signal-events))))))

;;;;;;;;;;;;;;;;;;;;;;;; View
(def -menu-button-style {:margin        "5px 3px"
