Add debug view panel

This commit is contained in:
Daniel Compton 2018-02-11 22:01:05 +13:00
parent 8b6874b4f8
commit 307979b4a7
2 changed files with 17 additions and 4 deletions

View File

@ -136,7 +136,8 @@
:children [(tab-button :event "Event")
(tab-button :app-db "app-db")
(tab-button :subs "Subs")
;(tab-button :views "Views")
(when (:debug? opts)
(tab-button :views "Views"))
(tab-button :traces "Trace")
(tab-button :timing "Timing")
(when (:debug? opts)
@ -149,7 +150,7 @@
[rc/v-box
:size "auto"
:style {:margin-left common/gs-19s
:overflow-y (if (contains? #{:timing :debug :event :subs} @selected-tab)
:overflow-y (if (contains? #{:timing :debug :event :subs :views} @selected-tab)
"auto" "initial")
;:overflow "auto" ;; TODO: Might have to put this back or add scrolling within the panels
}

View File

@ -1,3 +1,15 @@
(ns day8.re-frame.trace.view.views)
(ns day8.re-frame.trace.view.views
(:require [mranderson047.re-frame.v0v10v2.re-frame.core :as rf]
[day8.re-frame.trace.metamorphic :as metam]
[day8.re-frame.trace.utils.re-com :as rc]))
(defn render [])
(defn render
[]
[:div
(for [x @(rf/subscribe [:traces/current-event-traces])
:when (and (some #(or (= "rx88" %)
(= "rx193" %))
(get-in x [:tags :input-signals]))
#_ (metam/render? x))]
^{:key (:id x)}
[:pre {:style {:display "block" :border "1px solid black"}} (prn-str (metam/summarise-event x))])])