0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-14 07:51:35 -05:00

🐛 Fix actions when workspace is visited first time (#6129)

* 🐛 Fix actions when workspace is visited first time

* 📎 Fix linter errors

* 🐛 Fix problem with integration test

* 📎 Fix linter errors

* 📎 Fix linter errors

---------

Co-authored-by: alonso.torres <alonso.torres@kaleidos.net>
This commit is contained in:
Marina López 2025-03-24 18:02:05 +01:00 committed by GitHub
parent 7bc000517f
commit a6133e9c48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 34 additions and 16 deletions

View file

@ -24,6 +24,7 @@
- [DESIGN TOKENS] Integration with components.
- [DESIGN TOKENS] Import and export tokens from a JSON file.
- [DESIGN TOKENS] Apply Themes and Sets at document level.
- Add more descriptive tooltip to boards for first time users [Taiga #9426](https://tree.taiga.io/project/penpot/us/9426)
### :bug: Bugs fixed
@ -38,6 +39,8 @@
- Fix problem with default shadows value in plugins [Plugins #191](https://github.com/penpot/penpot-plugins/issues/191)
- Fix problem with constraints when creating group [Taiga #10455](https://tree.taiga.io/project/penpot/issue/10455)
- Fix opening pen with shortcut multiple times breaks toolbar [Taiga #10566](https://tree.taiga.io/project/penpot/issue/10566)
- Fix actions when workspace is visited first time [Taiga #10548](https://tree.taiga.io/project/penpot/issue/10548)
## 2.5.4

View file

@ -0,0 +1 @@
{}

View file

@ -20,11 +20,23 @@ test("Save and restore version", async ({ page }) => {
"workspace/update-file-create-rect.json",
);
await workspacePage.mockRPC(
"push-audit-events",
"workspace/audit-event-empty.json",
);
await workspacePage.mockRPC(
"update-profile-props",
"workspace/update-profile-empty.json",
);
await workspacePage.goToWorkspace({
fileId: "406b7b01-d3e2-80e4-8005-3138ac5d449c",
pageId: "406b7b01-d3e2-80e4-8005-3138ac5d449d",
});
await workspacePage.moveButton.click();
await workspacePage.mockRPC(
"get-file-snapshots?file-id=*",
"workspace/versions-snapshot-1.json",

View file

@ -204,6 +204,9 @@
(rx/filter #(= % ::force-persist))))]
(rx/merge
(->> notifier-s
(rx/map #(ptk/data-event ::persistence-notification)))
(->> local-commits-s
(rx/debounce 200)
(rx/map (fn [_]

View file

@ -44,6 +44,7 @@
[app.main.data.helpers :as dsh]
[app.main.data.modal :as modal]
[app.main.data.notifications :as ntf]
[app.main.data.persistence :as-alias dps]
[app.main.data.plugins :as dp]
[app.main.data.profile :as du]
[app.main.data.project :as dpj]
@ -354,6 +355,11 @@
(-> (workspace-initialized file-id)
(with-meta {:file-id file-id}))))))
(->> stream
(rx/filter (ptk/type? ::dps/persistence-notification))
(rx/take 1)
(rx/map dwc/set-workspace-visited))
(when-let [component-id (some-> rparams :component-id parse-uuid)]
(->> stream
(rx/filter (ptk/type? ::workspace-initialized))
@ -476,10 +482,13 @@
ptk/WatchEvent
(watch [_ state _]
(if-let [page (dsh/lookup-page state file-id page-id)]
(rx/of (initialize-page* file-id page-id page)
(dwth/watch-state-changes file-id page-id)
(dwl/watch-component-changes)
(select-frame-tool file-id page-id))
(rx/concat (rx/of (initialize-page* file-id page-id page)
(dwth/watch-state-changes file-id page-id)
(dwl/watch-component-changes))
(let [profile (:profile state)
props (get profile :props)]
(when (not (:workspace-visited props))
(rx/of (select-frame-tool file-id page-id)))))
(rx/of (dcm/go-to-workspace :file-id file-id ::rt/replace true))))))
(defn finalize-page

View file

@ -7,7 +7,6 @@
(ns app.main.data.workspace.common
(:require
[app.common.logging :as log]
[app.config :as cf]
[app.main.data.profile :as du]
[app.main.data.workspace.layout :as dwl]
[beicon.v2.core :as rx]
@ -38,7 +37,7 @@
(watch [_ state _]
(let [profile (:profile state)
props (get profile :props)]
(when (and (cf/external-feature-flag "boards-03" "test") (not (:workspace-visited props)))
(when (not (:workspace-visited props))
(rx/of (du/update-profile-props {:workspace-visited true})))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View file

@ -14,7 +14,6 @@
[app.main.data.changes :as dch]
[app.main.data.helpers :as dsh]
[app.main.data.persistence :as-alias dps]
[app.main.data.workspace.common :as dwc]
[app.main.data.workspace.notifications :as-alias wnt]
[app.main.rasterizer :as thr]
[app.main.refs :as refs]
@ -293,10 +292,4 @@
(rx/mapcat #(into #{} %))
(rx/map #(update-thumbnail file-id page-id % "frame" "watch-state-changes"))))
;; WARNING: This is a workaround for an AB test, in case we consolidate this change we should
;; find a better way to handle this.
(->> notifier-s
(rx/take 1)
(rx/map dwc/set-workspace-visited))
(rx/take-until stopper-s))))))

View file

@ -10,7 +10,6 @@
[app.common.data.macros :as dm]
[app.common.geom.point :as gpt]
[app.common.media :as cm]
[app.config :as cf]
[app.main.data.event :as ev]
[app.main.data.modal :as modal]
[app.main.data.workspace :as dw]
@ -126,8 +125,7 @@
profile (mf/deref refs/profile)
props (get profile :props)
test-tooltip-board-text
(if (and (cf/external-feature-flag "boards-03" "test")
(not (:workspace-visited props)))
(if (not (:workspace-visited props))
(tr "workspace.toolbar.frame-first-time" (sc/get-tooltip :draw-frame))
(tr "workspace.toolbar.frame" (sc/get-tooltip :draw-frame)))]