diff --git a/CHANGES.md b/CHANGES.md index 5173ea7910..4fe5aee48e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/frontend/playwright/data/workspace/update-profile-empty.json b/frontend/playwright/data/workspace/update-profile-empty.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/frontend/playwright/data/workspace/update-profile-empty.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/frontend/playwright/ui/specs/versions.spec.js b/frontend/playwright/ui/specs/versions.spec.js index 93b883a18f..edd8fc9ea9 100644 --- a/frontend/playwright/ui/specs/versions.spec.js +++ b/frontend/playwright/ui/specs/versions.spec.js @@ -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", diff --git a/frontend/src/app/main/data/persistence.cljs b/frontend/src/app/main/data/persistence.cljs index 727bb8548b..4ecbac5458 100644 --- a/frontend/src/app/main/data/persistence.cljs +++ b/frontend/src/app/main/data/persistence.cljs @@ -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 [_] diff --git a/frontend/src/app/main/data/workspace.cljs b/frontend/src/app/main/data/workspace.cljs index 2c1a00620d..8af363d3ca 100644 --- a/frontend/src/app/main/data/workspace.cljs +++ b/frontend/src/app/main/data/workspace.cljs @@ -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 diff --git a/frontend/src/app/main/data/workspace/common.cljs b/frontend/src/app/main/data/workspace/common.cljs index 8b9242b016..8a4cf0d981 100644 --- a/frontend/src/app/main/data/workspace/common.cljs +++ b/frontend/src/app/main/data/workspace/common.cljs @@ -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}))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/frontend/src/app/main/data/workspace/thumbnails.cljs b/frontend/src/app/main/data/workspace/thumbnails.cljs index 0fefbd47a0..467a999192 100644 --- a/frontend/src/app/main/data/workspace/thumbnails.cljs +++ b/frontend/src/app/main/data/workspace/thumbnails.cljs @@ -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)))))) diff --git a/frontend/src/app/main/ui/workspace/top_toolbar.cljs b/frontend/src/app/main/ui/workspace/top_toolbar.cljs index bec682c80d..0532008ffe 100644 --- a/frontend/src/app/main/ui/workspace/top_toolbar.cljs +++ b/frontend/src/app/main/ui/workspace/top_toolbar.cljs @@ -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)))]