mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
🐛 Fix focus mode across page and file navigation (#7695)
This commit is contained in:
@@ -75,6 +75,7 @@
|
||||
- Fix paste without selection sends the new element in the back [Taiga #12382](https://tree.taiga.io/project/penpot/issue/12382)
|
||||
- Fix options button does not work for comments created in the lower part of the screen [Taiga #12422](https://tree.taiga.io/project/penpot/issue/12422)
|
||||
- Fix problem when checking usage with removed teams [Taiga #12442](https://tree.taiga.io/project/penpot/issue/12442)
|
||||
- Fix focus mode persisting across page/file navigation [Taiga #12469](https://tree.taiga.io/project/penpot/issue/12469)
|
||||
|
||||
## 2.10.1
|
||||
|
||||
|
||||
@@ -1278,7 +1278,7 @@
|
||||
(watch [_ _ stream]
|
||||
(let [stopper-s
|
||||
(->> stream
|
||||
(rx/filter #(or (= ::dw/finalize-page (ptk/type %))
|
||||
(rx/filter #(or (= ::dwpg/finalize-page (ptk/type %))
|
||||
(= ::watch-component-changes (ptk/type %)))))
|
||||
|
||||
workspace-data-s
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
[app.main.data.helpers :as dsh]
|
||||
[app.main.data.workspace.drawing.common :as dwdc]
|
||||
[app.main.data.workspace.edition :as dwe]
|
||||
[app.main.data.workspace.pages :as-alias dwpg]
|
||||
[app.main.data.workspace.path.changes :as changes]
|
||||
[app.main.data.workspace.path.common :as common]
|
||||
[app.main.data.workspace.path.helpers :as helpers]
|
||||
@@ -43,7 +44,7 @@
|
||||
(= type :app.main.data.workspace.path.shortcuts/esc-pressed)
|
||||
(= type :app.main.data.workspace.common/clear-edition-mode)
|
||||
(= type :app.main.data.workspace.edition/clear-edition-mode)
|
||||
(= type :app.main.data.workspace/finalize-page)
|
||||
(= type ::dwpg/finalize-page)
|
||||
(= event :interrupt) ;; ESC
|
||||
(and ^boolean (mse/mouse-event? event)
|
||||
^boolean (mse/mouse-double-click-event? event)))))
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
[app.common.data.undo-stack :as u]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.main.data.workspace.common :as dwc]
|
||||
[app.main.data.workspace.edition :as-alias dwe]
|
||||
[app.main.data.workspace.pages :as-alias dwpg]
|
||||
[app.main.data.workspace.path.changes :as changes]
|
||||
[app.main.data.workspace.path.common :as common]
|
||||
[app.main.data.workspace.path.state :as st]
|
||||
@@ -133,8 +135,8 @@
|
||||
|
||||
(defn- stop-undo? [event]
|
||||
(let [type (ptk/type event)]
|
||||
(or (= :app.main.data.workspace.edition/clear-edition-mode type)
|
||||
(= :app.main.data.workspace/finalize-page type))))
|
||||
(or (= ::dwe/clear-edition-mode type)
|
||||
(= ::dwpg/finalize-page type))))
|
||||
|
||||
(def path-content-ref
|
||||
(letfn [(selector [state]
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
[app.main.data.modal :as md]
|
||||
[app.main.data.workspace.collapse :as dwc]
|
||||
[app.main.data.workspace.edition :as dwe]
|
||||
[app.main.data.workspace.pages :as-alias dwpg]
|
||||
[app.main.data.workspace.specialized-panel :as-alias dwsp]
|
||||
[app.main.data.workspace.undo :as dwu]
|
||||
[app.main.data.workspace.zoom :as dwz]
|
||||
@@ -596,13 +597,12 @@
|
||||
ptk/WatchEvent
|
||||
(watch [_ state stream]
|
||||
(let [stopper (rx/filter #(or (= ::toggle-focus-mode (ptk/type %))
|
||||
(= :app.main.data.workspace/finalize-page (ptk/type %))) stream)]
|
||||
(= ::dwpg/finalize-page (ptk/type %))) stream)]
|
||||
(when (d/not-empty? (:workspace-focus-selected state))
|
||||
(rx/merge
|
||||
(->> (rx/merge
|
||||
(rx/of dwz/zoom-to-selected-shape
|
||||
(deselect-all))
|
||||
(->> (rx/from-atom refs/workspace-page-objects {:emit-current-value? true})
|
||||
(rx/take-until stopper)
|
||||
(rx/map (comp set keys))
|
||||
(rx/buffer 2 1)
|
||||
(rx/merge-map
|
||||
@@ -613,4 +613,5 @@
|
||||
|
||||
(if (or (d/not-empty? added) (d/not-empty? removed))
|
||||
(rx/of (update-focus-shapes added removed))
|
||||
(rx/empty))))))))))))
|
||||
(rx/empty)))))))
|
||||
(rx/take-until stopper)))))))
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
[app.main.data.helpers :as dsh]
|
||||
[app.main.data.persistence :as-alias dps]
|
||||
[app.main.data.workspace.notifications :as-alias wnt]
|
||||
[app.main.data.workspace.pages :as-alias dwpg]
|
||||
[app.main.rasterizer :as thr]
|
||||
[app.main.refs :as refs]
|
||||
[app.main.render :as render]
|
||||
@@ -254,7 +255,7 @@
|
||||
(let [stopper-s (rx/filter
|
||||
(fn [event]
|
||||
(as-> (ptk/type event) type
|
||||
(or (= :app.main.data.workspace/finalize-page type)
|
||||
(or (= ::dwpg/finalize-page type)
|
||||
(= ::watch-state-changes type))))
|
||||
stream)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user