Merge remote-tracking branch 'origin/staging' into develop

This commit is contained in:
Andrey Antukh 2025-02-25 12:56:05 +01:00
commit b676ea7127
17 changed files with 66 additions and 17 deletions

View file

@ -51,6 +51,7 @@
[app.main.data.workspace.collapse :as dwco]
[app.main.data.workspace.colors :as dwcl]
[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.edition :as dwe]
[app.main.data.workspace.fix-broken-shapes :as fbs]
@ -393,7 +394,7 @@
(defn finalize-workspace
[file-id]
(ptk/reify ::finalize-file
(ptk/reify ::finalize-workspace
ptk/UpdateEvent
(update [_ state]
(-> state
@ -416,6 +417,7 @@
(dpj/finalize-project project-id)
(dwsl/finalize-shape-layout)
(dwcl/stop-picker)
(dwc/set-workspace-visited)
(modal/hide)
(ntf/hide))))))

View file

@ -7,6 +7,8 @@
(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]
[potok.v2.core :as ptk]))
@ -29,6 +31,15 @@
[e]
(= 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

View file

@ -14,6 +14,7 @@
[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]
@ -291,4 +292,10 @@
(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

@ -1258,8 +1258,8 @@
[:div {:class (stl/css :cover)
:on-click on-click*}
[:div {:class (stl/css :location)}
[:> icon* {:icon-id "comments"
:class (stl/css :location-icon)}]
[:div {:class (stl/css :location-icon)}
[:> icon* {:icon-id "comments"}]]
[:div {:class (stl/css :location-text)}
(str "#" (:seqn item))
(str " " (:file-name item))

View file

@ -31,7 +31,7 @@
color: var(--comment-subtitle-color);
display: flex;
align-items: center;
gap: $s-8;
gap: $s-6;
}
.location-icon {

View file

@ -14,7 +14,6 @@
.thread-groups {
height: calc(100% - $s-32);
overflow-y: scroll;
max-height: $s-440;
overflow: auto;
}
@ -72,6 +71,7 @@
max-height: $s-480;
min-height: $s-200;
position: absolute;
overflow: hidden;
width: 100%;
z-index: $z-index-4;

View file

@ -10,6 +10,7 @@
[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]
@ -120,7 +121,15 @@
(mf/use-fn
(fn [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?
[:aside {:class (stl/css-case :main-toolbar true
@ -140,7 +149,7 @@
[:*
[:li
[: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))
:class (stl/css-case :main-toolbar-options-button true :selected (= selected-drawtool :frame))
:on-click select-drawtool

View file

@ -301,6 +301,7 @@
(when show-comments?
[:> comments/comments-layer* {:vbox vbox
:page-id page-id
:file-id file-id
:vport vport
:zoom zoom

View file

@ -16,7 +16,7 @@
[rumext.v2 :as mf]))
(mf/defc comments-layer*
[{:keys [vbox vport zoom drawing file-id]}]
[{:keys [vbox vport zoom drawing file-id page-id]}]
(let [vbox-x (dm/get-prop vbox :x)
vbox-y (dm/get-prop vbox :y)
vport-w (dm/get-prop vport :width)
@ -31,8 +31,9 @@
threads-map (mf/deref refs/threads)
threads
(mf/with-memo [threads-map local profile]
(mf/with-memo [threads-map local profile page-id]
(->> (vals threads-map)
(filter #(= (:page-id %) page-id))
(dcm/apply-filters local profile)))
viewport

View file

@ -343,6 +343,7 @@
(when show-comments?
[:> comments/comments-layer* {:vbox vbox
:page-id page-id
:vport vport
:zoom zoom
:drawing drawing}])