Fix bug that prevented tab names from showing up in the tabs window. (dumb!)

This commit is contained in:
Robert C. Martin 2023-08-09 12:24:37 -05:00
parent 4bda61802e
commit 44ae7451c2
4 changed files with 16 additions and 6 deletions

View File

@ -166,9 +166,15 @@
(context "tab names"
(it "gets list of changeable tab names"
(set-mem :tabs-list [{:name "all" :selected [1] :blocked [2]}
{:name "tab" :selected [3] :blocked 4}
{:name "trusted" :selected [:trusted] :blocked []}])
(should= ["tab"] (get-changeable-tab-names))))
(set-mem :tabs-list [{:name "all" :selected [1] :blocked [2]}
{:name "tab" :selected [3] :blocked [4]}
{:name "trusted" :selected [:trusted] :blocked []}])
(should= ["tab"] (get-changeable-tab-names)))
(it "gets list of changeable tab descriptors"
(set-mem :tabs-list [{:name "all" :selected [1] :blocked [2]}
{:name "tab" :selected [3] :blocked [4]}
{:name "trusted" :selected [:trusted] :blocked []}])
(should= [{:name "tab" :selected [3] :blocked [4]}] (get-changeable-tab-descriptors))))
)

View File

@ -292,7 +292,7 @@
(defn article-click [tab-index e]
(if-not (.isPopupTrigger e)
(node-selected tab-index e)
(future (node-selected tab-index e))
(let [tree (.getComponent e)
path (.getPathForLocation tree (.getX e) (.getY e))
node (.getLastPathComponent path)

View File

@ -55,5 +55,9 @@
(vec (remove is-unchangeable-tab-name
(map :name (get-mem :tabs-list)))))
(defn get-changeable-tab-descriptors []
(vec (remove #(is-unchangeable-tab-name (:name %))
(get-mem :tabs-list))))

View File

@ -120,7 +120,7 @@
:content tab-window}))
(defn make-tabs []
(loop [tabs-list (tabs-util/get-changeable-tab-names)
(loop [tabs-list (tabs-util/get-changeable-tab-descriptors)
header-tree-tabs []]
(if (empty? tabs-list)
(let [all-ids (get-mem [:tabs-window :all-ids])]