🐛 Fix focus mode across page and file navigation (#7695)

This commit is contained in:
Alejandro Alonso
2025-11-05 12:05:00 +01:00
committed by GitHub
parent 9e7ec594ca
commit a576c0404a
6 changed files with 27 additions and 21 deletions

View File

@@ -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 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 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 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 ## 2.10.1

View File

@@ -1278,7 +1278,7 @@
(watch [_ _ stream] (watch [_ _ stream]
(let [stopper-s (let [stopper-s
(->> stream (->> stream
(rx/filter #(or (= ::dw/finalize-page (ptk/type %)) (rx/filter #(or (= ::dwpg/finalize-page (ptk/type %))
(= ::watch-component-changes (ptk/type %))))) (= ::watch-component-changes (ptk/type %)))))
workspace-data-s workspace-data-s

View File

@@ -20,6 +20,7 @@
[app.main.data.helpers :as dsh] [app.main.data.helpers :as dsh]
[app.main.data.workspace.drawing.common :as dwdc] [app.main.data.workspace.drawing.common :as dwdc]
[app.main.data.workspace.edition :as dwe] [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.changes :as changes]
[app.main.data.workspace.path.common :as common] [app.main.data.workspace.path.common :as common]
[app.main.data.workspace.path.helpers :as helpers] [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.path.shortcuts/esc-pressed)
(= type :app.main.data.workspace.common/clear-edition-mode) (= type :app.main.data.workspace.common/clear-edition-mode)
(= type :app.main.data.workspace.edition/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 (= event :interrupt) ;; ESC
(and ^boolean (mse/mouse-event? event) (and ^boolean (mse/mouse-event? event)
^boolean (mse/mouse-double-click-event? event))))) ^boolean (mse/mouse-double-click-event? event)))))

View File

@@ -10,6 +10,8 @@
[app.common.data.undo-stack :as u] [app.common.data.undo-stack :as u]
[app.common.uuid :as uuid] [app.common.uuid :as uuid]
[app.main.data.workspace.common :as dwc] [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.changes :as changes]
[app.main.data.workspace.path.common :as common] [app.main.data.workspace.path.common :as common]
[app.main.data.workspace.path.state :as st] [app.main.data.workspace.path.state :as st]
@@ -133,8 +135,8 @@
(defn- stop-undo? [event] (defn- stop-undo? [event]
(let [type (ptk/type event)] (let [type (ptk/type event)]
(or (= :app.main.data.workspace.edition/clear-edition-mode type) (or (= ::dwe/clear-edition-mode type)
(= :app.main.data.workspace/finalize-page type)))) (= ::dwpg/finalize-page type))))
(def path-content-ref (def path-content-ref
(letfn [(selector [state] (letfn [(selector [state]

View File

@@ -24,6 +24,7 @@
[app.main.data.modal :as md] [app.main.data.modal :as md]
[app.main.data.workspace.collapse :as dwc] [app.main.data.workspace.collapse :as dwc]
[app.main.data.workspace.edition :as dwe] [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.specialized-panel :as-alias dwsp]
[app.main.data.workspace.undo :as dwu] [app.main.data.workspace.undo :as dwu]
[app.main.data.workspace.zoom :as dwz] [app.main.data.workspace.zoom :as dwz]
@@ -596,13 +597,12 @@
ptk/WatchEvent ptk/WatchEvent
(watch [_ state stream] (watch [_ state stream]
(let [stopper (rx/filter #(or (= ::toggle-focus-mode (ptk/type %)) (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)) (when (d/not-empty? (:workspace-focus-selected state))
(rx/merge (->> (rx/merge
(rx/of dwz/zoom-to-selected-shape (rx/of dwz/zoom-to-selected-shape
(deselect-all)) (deselect-all))
(->> (rx/from-atom refs/workspace-page-objects {:emit-current-value? true}) (->> (rx/from-atom refs/workspace-page-objects {:emit-current-value? true})
(rx/take-until stopper)
(rx/map (comp set keys)) (rx/map (comp set keys))
(rx/buffer 2 1) (rx/buffer 2 1)
(rx/merge-map (rx/merge-map
@@ -613,4 +613,5 @@
(if (or (d/not-empty? added) (d/not-empty? removed)) (if (or (d/not-empty? added) (d/not-empty? removed))
(rx/of (update-focus-shapes added removed)) (rx/of (update-focus-shapes added removed))
(rx/empty)))))))))))) (rx/empty)))))))
(rx/take-until stopper)))))))

View File

@@ -17,6 +17,7 @@
[app.main.data.helpers :as dsh] [app.main.data.helpers :as dsh]
[app.main.data.persistence :as-alias dps] [app.main.data.persistence :as-alias dps]
[app.main.data.workspace.notifications :as-alias wnt] [app.main.data.workspace.notifications :as-alias wnt]
[app.main.data.workspace.pages :as-alias dwpg]
[app.main.rasterizer :as thr] [app.main.rasterizer :as thr]
[app.main.refs :as refs] [app.main.refs :as refs]
[app.main.render :as render] [app.main.render :as render]
@@ -254,7 +255,7 @@
(let [stopper-s (rx/filter (let [stopper-s (rx/filter
(fn [event] (fn [event]
(as-> (ptk/type event) type (as-> (ptk/type event) type
(or (= :app.main.data.workspace/finalize-page type) (or (= ::dwpg/finalize-page type)
(= ::watch-state-changes type)))) (= ::watch-state-changes type))))
stream) stream)