                         :row-partial p/tag-search-row
                         :caption (format "Total: %s" (count (map :url things)))))))
 
-(defn render-tags-results [_ [_ _ _ new-value] _]
-  (dom/insert-after!
-    (dom/by-id "url_search_text")
-    (p/generate-datalist new-value)))
-
-(defn url-search [{:keys [transform messages]}]
-  (let [search-map {:query (.-value (dom/by-id "url_search_text"))
-                    :search-type (dom/value (css/sel "input[name=search_type]:checked"))}
-        search-id (route/create-screen-id :search search-map)]
-    ;; needed for history navigation
-    (swap! route/dynamic-screens assoc search-id search-map)
-    (msg/fill transform messages (assoc search-map
-                                        :name search-id
-                                        :paths [[:app-model :search-form] [:app-model :search search-id] [:app-model :navbar]]))))
-
-(defn create-url [{:keys [transform messages]}]
-  (msg/fill transform messages {:value (dom/value (dom/by-id "add_url_text"))}))
+;; we'd like to destroy/hide these but that requires changing render-search-results
+(defn clear-search [_ _ _]
+  (dom/set-html! (dom/by-id "table_stats") "")
+  (dom/set-html! (dom/by-id "search_table") ""))
 
 ;;; Other pages
 ;;;


     ;; search page
     [:node-create [:app-model :search :*] navigate-search]
    ;; TODO - still need to clear up more of table
     [:node-destroy [:app-model :search :*] (clear-id "table_stats")]
     [:value [:app-model :search :* :search-title] set-search-title]
     [:value [:app-model :search :* :search-results] render-search-results]


    ;; didn't use get-parent-id cause it doesn't work for new multi-level paths
    (dom/set-html! (dom/by-id "content") (html {}))))

(defn render-tags-results [_ [_ _ _ new-value] _]
  (dom/insert-after!
    (dom/by-id "url_search_text")
    (p/generate-datalist new-value)))

(defn url-search [{:keys [transform messages]}]
  (let [search-map {:query (.-value (dom/by-id "url_search_text"))
                    :search-type (dom/value (css/sel "input[name=search_type]:checked"))}
        search-id (route/create-screen-id :search search-map)]
    ;; needed for history navigation
    (swap! route/dynamic-screens assoc search-id search-map)
    (msg/fill transform messages (assoc search-map
                                        :name search-id
                                        :paths [[:app-model :search-form] [:app-model :search search-id] [:app-model :navbar]]))))

(defn create-url [{:keys [transform messages]}]
  (msg/fill transform messages {:value (dom/value (dom/by-id "add_url_text"))}))

;; Search page
(defn set-search-title [renderer [_ path _ new-value] _]
  (dom/set-html! (dom/by-id "search_title") new-value))

