mirror of
https://github.com/penpot/penpot.git
synced 2025-06-06 18:01:37 +02:00
🎉 Add AB test descriptive board tooltip (#5936)
* 🎉 Add AB test descriptive board tooltip * 📎 Add changes from feedback
This commit is contained in:
parent
a549d783ba
commit
8f06fa1026
7 changed files with 44 additions and 6 deletions
|
@ -58,7 +58,8 @@
|
||||||
[:welcome-file-id {:optional true} [:maybe ::sm/boolean]]
|
[:welcome-file-id {:optional true} [:maybe ::sm/boolean]]
|
||||||
[:release-notes-viewed {:optional true}
|
[:release-notes-viewed {:optional true}
|
||||||
[::sm/text {:max 100}]]
|
[::sm/text {:max 100}]]
|
||||||
[:notifications {:optional true} schema:props-notifications]])
|
[:notifications {:optional true} schema:props-notifications]
|
||||||
|
[:workspace-visited {:optional true} ::sm/boolean]])
|
||||||
|
|
||||||
(def schema:profile
|
(def schema:profile
|
||||||
[:map {:title "Profile"}
|
[:map {:title "Profile"}
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
[app.main.data.workspace.collapse :as dwco]
|
[app.main.data.workspace.collapse :as dwco]
|
||||||
[app.main.data.workspace.colors :as dwcl]
|
[app.main.data.workspace.colors :as dwcl]
|
||||||
[app.main.data.workspace.comments :as dwcm]
|
[app.main.data.workspace.comments :as dwcm]
|
||||||
|
[app.main.data.workspace.common :as dwc]
|
||||||
[app.main.data.workspace.drawing :as dwd]
|
[app.main.data.workspace.drawing :as dwd]
|
||||||
[app.main.data.workspace.edition :as dwe]
|
[app.main.data.workspace.edition :as dwe]
|
||||||
[app.main.data.workspace.fix-broken-shapes :as fbs]
|
[app.main.data.workspace.fix-broken-shapes :as fbs]
|
||||||
|
@ -393,7 +394,7 @@
|
||||||
|
|
||||||
(defn finalize-workspace
|
(defn finalize-workspace
|
||||||
[file-id]
|
[file-id]
|
||||||
(ptk/reify ::finalize-file
|
(ptk/reify ::finalize-workspace
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
(-> state
|
(-> state
|
||||||
|
@ -416,6 +417,7 @@
|
||||||
(dpj/finalize-project project-id)
|
(dpj/finalize-project project-id)
|
||||||
(dwsl/finalize-shape-layout)
|
(dwsl/finalize-shape-layout)
|
||||||
(dwcl/stop-picker)
|
(dwcl/stop-picker)
|
||||||
|
(dwc/set-workspace-visited)
|
||||||
(modal/hide)
|
(modal/hide)
|
||||||
(ntf/hide))))))
|
(ntf/hide))))))
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
(ns app.main.data.workspace.common
|
(ns app.main.data.workspace.common
|
||||||
(:require
|
(:require
|
||||||
[app.common.logging :as log]
|
[app.common.logging :as log]
|
||||||
|
[app.config :as cf]
|
||||||
|
[app.main.data.profile :as du]
|
||||||
[app.main.data.workspace.layout :as dwl]
|
[app.main.data.workspace.layout :as dwl]
|
||||||
[beicon.v2.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.v2.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
@ -29,6 +31,15 @@
|
||||||
[e]
|
[e]
|
||||||
(= e :interrupt))
|
(= e :interrupt))
|
||||||
|
|
||||||
|
(defn set-workspace-visited
|
||||||
|
[]
|
||||||
|
(ptk/reify ::set-workspace-visited
|
||||||
|
ptk/WatchEvent
|
||||||
|
(watch [_ state _]
|
||||||
|
(let [profile (:profile state)
|
||||||
|
props (get profile :props)]
|
||||||
|
(when (and (cf/external-feature-flag "boards-03" "test") (not (:workspace-visited props)))
|
||||||
|
(rx/of (du/update-profile-props {:workspace-visited true})))))))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; UNDO
|
;; UNDO
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
[app.main.data.changes :as dch]
|
[app.main.data.changes :as dch]
|
||||||
[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.common :as dwc]
|
||||||
[app.main.data.workspace.notifications :as-alias wnt]
|
[app.main.data.workspace.notifications :as-alias wnt]
|
||||||
[app.main.rasterizer :as thr]
|
[app.main.rasterizer :as thr]
|
||||||
[app.main.refs :as refs]
|
[app.main.refs :as refs]
|
||||||
|
@ -291,4 +292,10 @@
|
||||||
(rx/mapcat #(into #{} %))
|
(rx/mapcat #(into #{} %))
|
||||||
(rx/map #(update-thumbnail file-id page-id % "frame" "watch-state-changes"))))
|
(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))))))
|
(rx/take-until stopper-s))))))
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
[app.common.data.macros :as dm]
|
[app.common.data.macros :as dm]
|
||||||
[app.common.geom.point :as gpt]
|
[app.common.geom.point :as gpt]
|
||||||
[app.common.media :as cm]
|
[app.common.media :as cm]
|
||||||
|
[app.config :as cf]
|
||||||
[app.main.data.event :as ev]
|
[app.main.data.event :as ev]
|
||||||
[app.main.data.modal :as modal]
|
[app.main.data.modal :as modal]
|
||||||
[app.main.data.workspace :as dw]
|
[app.main.data.workspace :as dw]
|
||||||
|
@ -120,7 +121,15 @@
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(fn [event]
|
(fn [event]
|
||||||
(dom/blur! (dom/get-target event))
|
(dom/blur! (dom/get-target event))
|
||||||
(st/emit! (dwc/toggle-toolbar-visibility))))]
|
(st/emit! (dwc/toggle-toolbar-visibility))))
|
||||||
|
|
||||||
|
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)))
|
||||||
|
(tr "workspace.toolbar.frame-first-time" (sc/get-tooltip :draw-frame))
|
||||||
|
(tr "workspace.toolbar.frame" (sc/get-tooltip :draw-frame)))]
|
||||||
|
|
||||||
(when-not ^boolean read-only?
|
(when-not ^boolean read-only?
|
||||||
[:aside {:class (stl/css-case :main-toolbar true
|
[:aside {:class (stl/css-case :main-toolbar true
|
||||||
|
@ -140,7 +149,7 @@
|
||||||
[:*
|
[:*
|
||||||
[:li
|
[:li
|
||||||
[:button
|
[:button
|
||||||
{:title (tr "workspace.toolbar.frame" (sc/get-tooltip :draw-frame))
|
{:title test-tooltip-board-text
|
||||||
:aria-label (tr "workspace.toolbar.frame" (sc/get-tooltip :draw-frame))
|
:aria-label (tr "workspace.toolbar.frame" (sc/get-tooltip :draw-frame))
|
||||||
:class (stl/css-case :main-toolbar-options-button true :selected (= selected-drawtool :frame))
|
:class (stl/css-case :main-toolbar-options-button true :selected (= selected-drawtool :frame))
|
||||||
:on-click select-drawtool
|
:on-click select-drawtool
|
||||||
|
|
|
@ -6664,10 +6664,14 @@ msgstr "Curve (%s)"
|
||||||
msgid "workspace.toolbar.ellipse"
|
msgid "workspace.toolbar.ellipse"
|
||||||
msgstr "Ellipse (%s)"
|
msgstr "Ellipse (%s)"
|
||||||
|
|
||||||
#: src/app/main/ui/workspace/top_toolbar.cljs:143, src/app/main/ui/workspace/top_toolbar.cljs:144
|
#: src/app/main/ui/workspace/top_toolbar.cljs:128, src/app/main/ui/workspace/top_toolbar.cljs:144
|
||||||
msgid "workspace.toolbar.frame"
|
msgid "workspace.toolbar.frame"
|
||||||
msgstr "Board (%s)"
|
msgstr "Board (%s)"
|
||||||
|
|
||||||
|
#: src/app/main/ui/workspace/top_toolbar.cljs:128, src/app/main/ui/workspace/top_toolbar.cljs:144
|
||||||
|
msgid "workspace.toolbar.frame-first-time"
|
||||||
|
msgstr "Create board. Click and drag to define its size. (%s)"
|
||||||
|
|
||||||
#: src/app/main/ui/workspace/top_toolbar.cljs:60, src/app/main/ui/workspace/top_toolbar.cljs:61
|
#: src/app/main/ui/workspace/top_toolbar.cljs:60, src/app/main/ui/workspace/top_toolbar.cljs:61
|
||||||
msgid "workspace.toolbar.image"
|
msgid "workspace.toolbar.image"
|
||||||
msgstr "Image (%s)"
|
msgstr "Image (%s)"
|
||||||
|
|
|
@ -6671,10 +6671,14 @@ msgstr "Curva (%s)"
|
||||||
msgid "workspace.toolbar.ellipse"
|
msgid "workspace.toolbar.ellipse"
|
||||||
msgstr "Elipse (%s)"
|
msgstr "Elipse (%s)"
|
||||||
|
|
||||||
#: src/app/main/ui/workspace/top_toolbar.cljs:143, src/app/main/ui/workspace/top_toolbar.cljs:144
|
#: src/app/main/ui/workspace/top_toolbar.cljs:128, src/app/main/ui/workspace/top_toolbar.cljs:144
|
||||||
msgid "workspace.toolbar.frame"
|
msgid "workspace.toolbar.frame"
|
||||||
msgstr "Tablero (%s)"
|
msgstr "Tablero (%s)"
|
||||||
|
|
||||||
|
#: src/app/main/ui/workspace/top_toolbar.cljs:128, src/app/main/ui/workspace/top_toolbar.cljs:144
|
||||||
|
msgid "workspace.toolbar.frame-first-time"
|
||||||
|
msgstr "Crear tablero. Click y arrastrar para definir el tamaño. (%s)"
|
||||||
|
|
||||||
#: src/app/main/ui/workspace/top_toolbar.cljs:60, src/app/main/ui/workspace/top_toolbar.cljs:61
|
#: src/app/main/ui/workspace/top_toolbar.cljs:60, src/app/main/ui/workspace/top_toolbar.cljs:61
|
||||||
msgid "workspace.toolbar.image"
|
msgid "workspace.toolbar.image"
|
||||||
msgstr "Imagen (%s)"
|
msgstr "Imagen (%s)"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue