Skip to content

Commit

Permalink
::back-count. clojure-spec cleanup complete.
Browse files Browse the repository at this point in the history
  • Loading branch information
unclebob committed Jun 24, 2023
1 parent c9cf43a commit d1d24f8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/more_speech/mem.clj
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
(s/def ::frame #(instance? JFrame %)) ;The main frame
(s/def ::selected-event ::id) ;The id of the currently selected event
(s/def ::selected-tab ::tab-index) ;index of the selected tab within :tabs-list
(s/def ::back-count int?)
(s/def ::send-chan #(= clojure.core.async.impl.channels.ManyToManyChannel (type %)))

;map, by id, of all displayed nodes in the tabs.
Expand All @@ -49,9 +48,6 @@
;map, by id -- so far unseen -- holding a collection of all known events that reference that id -- i.e. the orphans.
(s/def ::orphaned-replies (s/map-of ::id (s/coll-of ::id)))

;list, in order, of the last selected events. Holds the tab index and the id
(s/def ::event-history (s/coll-of (s/tuple ::tab-index ::id) :kind vector?))

(s/def ::article-window-event-id ::id) ;id of article in the article window.
(s/def ::refresh-main-window boolean?) ;when true, main window refreshes once.
(s/def ::relay-manager-frame #(instance? JFrame %)) ;the frame if the relay manager is up.
Expand All @@ -63,6 +59,15 @@

(s/def ::article-panel (s/keys :req-un [::event-type/event]))

;list, in order, of the last selected events. Holds the tab index and the id
(s/def ::event-history (s/coll-of (s/tuple ::tab-index ::id) :kind vector?))

;used for managing the back and forward buttons.
;back-count is the number of steps backwards we are in the event-history.
;backing-up is true if the last event selection was because of going back or forward.
(s/def ::back-count int?)
(s/def ::backing-up boolean?)

(s/def ::mem (s/keys :req-un [::relay-type/relays
::pubkey
::keys]
Expand All @@ -79,7 +84,6 @@
::event-history
::event-counter-type/event-counter
::user-configuration-type/user-configuration
::back-count
::send-chan
::article-window-event-id
::refresh-main-window
Expand All @@ -88,7 +92,7 @@
::article-panel
::tabs-window-type/tabs-window
::user-window-type/user-window

::back-count
::backing-up]))

(def memory (atom nil))
Expand Down

0 comments on commit d1d24f8

Please sign in to comment.