     (assoc :new-item-text "")))
 
 (defmethod step :pop [state _]
-  (update state :stack pop))
+  (-> state
+   (update :completed conj (peek (:stack state)))
+   (update :stack pop)))
 
 (defmethod step :toggle-snoop [state _]
   (update state :snooping? not))
 
 (defmethod step :filter [state {:keys [text]}]
   (assoc state :filter-text text))
+
+(defmethod step :toggle-history [state _]
+  (update state :showing-history? not))
 
 
 ;; VIEW HELPERS

      (into [:ol]
       (->> stack
            (filter #(string/includes? % filter-text))
            (map #(vec [:li %]))))])]))

(defn push-pop-view [{:keys [stack filter-text] :as state}]
  [:div


;; VIEW

(defn peek-view [{:keys [stack completed filter-text snooping? showing-history?]}]
 (when (not-empty stack)
  [:div.peek-container
   [:h3
    {:on-click (on-click :toggle-snoop)}
    (if snooping? "Peeking..." "Peek...")]
   (when snooping?
     [:div
      [:input
