diff --git a/backend/src/app/loggers/database.clj b/backend/src/app/loggers/database.clj index 748fca12e3..e7efd84edd 100644 --- a/backend/src/app/loggers/database.clj +++ b/backend/src/app/loggers/database.clj @@ -50,7 +50,7 @@ (assoc :host (cf/get :host)) (assoc :public-uri (cf/get :public-uri)) (assoc :version (:full cf/version)) - (assoc :id (uuid/next)))) + (update :id #(or % (uuid/next))))) (defn handle-event [{:keys [executor] :as cfg} event] diff --git a/backend/src/app/rpc/mutations/profile.clj b/backend/src/app/rpc/mutations/profile.clj index 4e2d207c8a..07f3866b6f 100644 --- a/backend/src/app/rpc/mutations/profile.clj +++ b/backend/src/app/rpc/mutations/profile.clj @@ -350,7 +350,6 @@ :opt-un [::lang ::theme])) (sv/defmethod ::update-profile - {::async/dispatch :default} [{:keys [pool] :as cfg} params] (db/with-atomic [conn pool] (let [profile (update-profile conn params)] diff --git a/backend/src/app/util/websocket.clj b/backend/src/app/util/websocket.clj index 6acbd9e363..1562dec30d 100644 --- a/backend/src/app/util/websocket.clj +++ b/backend/src/app/util/websocket.clj @@ -106,7 +106,7 @@ on-message (fn [_ message] - (mtx/run! metrics {:id :websocket-messages-total :labels ["send"] :inc 1}) + (mtx/run! metrics {:id :websocket-messages-total :labels ["recv"] :inc 1}) (try (let [message (t/decode-str message)] (a/offer! input-ch message)) diff --git a/backend/src/app/worker.clj b/backend/src/app/worker.clj index 96430d2e56..cf19b41385 100644 --- a/backend/src/app/worker.clj +++ b/backend/src/app/worker.clj @@ -79,11 +79,11 @@ (letfn [(log-stats [scheduler state] (doseq [[key ^ForkJoinPool executor] executors] (let [labels (into-array String [(name key)]) - active (.getActiveThreadCount executor) running (.getRunningThreadCount executor) queued (.getQueuedSubmissionCount executor) + active (.getPoolSize executor) steals (.getStealCount executor) - steals-increment (- steals (or (get-in @state [key :steals]) 9)) + steals-increment (- steals (or (get-in @state [key :steals]) 0)) steals-increment (if (neg? steals-increment) 0 steals-increment)] (mtx/run! metrics {:id :executors-active-threads :labels labels :val active}) diff --git a/common/src/app/common/logging.cljc b/common/src/app/common/logging.cljc index f96c6cb041..09febd1d35 100644 --- a/common/src/app/common/logging.cljc +++ b/common/src/app/common/logging.cljc @@ -36,12 +36,12 @@ (reduce-kv #(.with ^MapMessage %1 (name %2) %3) message m)))) #?(:clj - (def logger-context - (LogManager/getContext false))) + (def logger-context + (LogManager/getContext false))) #?(:clj - (def logging-agent - (agent nil :error-mode :continue))) + (def logging-agent + (agent nil :error-mode :continue))) (defn- simple-prune ([s] (simple-prune s (* 1024 1024))) diff --git a/common/src/app/common/spec/change.cljc b/common/src/app/common/spec/change.cljc index b38aa3e85f..db9847b753 100644 --- a/common/src/app/common/spec/change.cljc +++ b/common/src/app/common/spec/change.cljc @@ -6,6 +6,7 @@ (ns app.common.spec.change (:require + [app.common.spec :as us] [app.common.spec.color :as color] [app.common.spec.file :as file] [app.common.spec.page :as page] @@ -124,16 +125,25 @@ (defmethod change-spec :add-recent-color [_] (s/keys :req-un [:internal.changes.add-recent-color/color])) -(s/def :internal.changes.media/object ::file/media-object) +(s/def :internal.changes.add-media/object ::file/media-object) (defmethod change-spec :add-media [_] - (s/keys :req-un [:internal.changes.media/object])) + (s/keys :req-un [:internal.changes.add-media/object])) -(s/def :internal.changes.media.mod/object - (s/and ::file/media-object #(contains? % :id))) + +(s/def :internal.changes.mod-media/width ::us/safe-integer) +(s/def :internal.changes.mod-media/height ::us/safe-integer) +(s/def :internal.changes.mod-media/path (s/nilable string?)) +(s/def :internal.changes.mod-media/mtype string?) +(s/def :internal.changes.mod-media/object + (s/keys :req-un [::id] + :opt-un [:internal.changes.mod-media/width + :internal.changes.mod-media/height + :internal.changes.mod-media/path + :internal.changes.mod-media/mtype])) (defmethod change-spec :mod-media [_] - (s/keys :req-un [:internal.changes.media.mod/object])) + (s/keys :req-un [:internal.changes.mod-media/object])) (defmethod change-spec :del-media [_] (s/keys :req-un [::id])) diff --git a/common/src/app/common/spec/file.cljc b/common/src/app/common/spec/file.cljc index a1e538ecc2..2affdafbda 100644 --- a/common/src/app/common/spec/file.cljc +++ b/common/src/app/common/spec/file.cljc @@ -17,12 +17,18 @@ (s/def :internal.media-object/height ::us/safe-integer) (s/def :internal.media-object/mtype string?) +;; NOTE: This is marked as nilable for backward compatibility, but +;; right now is just exists or not exists. We can thin in a gradual +;; migration and then mark it as not nilable. +(s/def :internal.media-object/path (s/nilable string?)) + (s/def ::media-object (s/keys :req-un [::id ::name :internal.media-object/width :internal.media-object/height - :internal.media-object/mtype])) + :internal.media-object/mtype] + :opt-un [:internal.media-object/path])) (s/def ::colors (s/map-of uuid? ::color/color)) diff --git a/frontend/resources/images/features/1.12-guides.gif b/frontend/resources/images/features/1.12-guides.gif new file mode 100644 index 0000000000..ea6a0264e9 Binary files /dev/null and b/frontend/resources/images/features/1.12-guides.gif differ diff --git a/frontend/resources/images/features/1.12-nudge.gif b/frontend/resources/images/features/1.12-nudge.gif new file mode 100644 index 0000000000..b4d226f7c4 Binary files /dev/null and b/frontend/resources/images/features/1.12-nudge.gif differ diff --git a/frontend/resources/images/features/1.12-scrollbars.gif b/frontend/resources/images/features/1.12-scrollbars.gif new file mode 100644 index 0000000000..09a8b1444e Binary files /dev/null and b/frontend/resources/images/features/1.12-scrollbars.gif differ diff --git a/frontend/resources/images/features/1.12-ui.gif b/frontend/resources/images/features/1.12-ui.gif new file mode 100644 index 0000000000..20a846e48d Binary files /dev/null and b/frontend/resources/images/features/1.12-ui.gif differ diff --git a/frontend/src/app/main/ui/releases.cljs b/frontend/src/app/main/ui/releases.cljs index 85b6b499b1..c478f05dbb 100644 --- a/frontend/src/app/main/ui/releases.cljs +++ b/frontend/src/app/main/ui/releases.cljs @@ -10,8 +10,9 @@ [app.main.data.users :as du] [app.main.store :as st] [app.main.ui.releases.common :as rc] - [app.main.ui.releases.v1-10] + [app.main.ui.releases.v1-12] [app.main.ui.releases.v1-11] + [app.main.ui.releases.v1-10] [app.main.ui.releases.v1-4] [app.main.ui.releases.v1-5] [app.main.ui.releases.v1-6] @@ -82,4 +83,4 @@ (defmethod rc/render-release-notes "0.0" [params] - (rc/render-release-notes (assoc params :version "1.11"))) + (rc/render-release-notes (assoc params :version "1.12"))) diff --git a/frontend/src/app/main/ui/releases/v1_12.cljs b/frontend/src/app/main/ui/releases/v1_12.cljs new file mode 100644 index 0000000000..b494cb568a --- /dev/null +++ b/frontend/src/app/main/ui/releases/v1_12.cljs @@ -0,0 +1,107 @@ +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) UXBOX Labs SL + +(ns app.main.ui.releases.v1-12 + (:require + [app.main.ui.releases.common :as c] + [rumext.alpha :as mf])) + +(defmethod c/render-release-notes "1.12" + [{:keys [slide klass next finish navigate version]}] + (mf/html + (case @slide + :start + [:div.modal-overlay + [:div.animated {:class @klass} + [:div.modal-container.onboarding.feature + [:div.modal-left + [:img {:src "images/login-on.jpg" :border "0" :alt "What's new Beta release 1.12"}]] + [:div.modal-right + [:div.modal-title + [:h2 "What's new?"]] + [:span.release "Beta version " version] + [:div.modal-content + [:p "Penpot continues growing with new features that improve performance, user experience and visual design."] + [:p "We are happy to show you a sneak peak of the most important stuff that the Beta 1.12 version brings."]] + [:div.modal-navigation + [:button.btn-secondary {:on-click next} "Continue"]]] + [:img.deco {:src "images/deco-left.png" :border "0"}] + [:img.deco.right {:src "images/deco-right.png" :border "0"}]]]] + + 0 + [:div.modal-overlay + [:div.animated {:class @klass} + [:div.modal-container.onboarding.feature + [:div.modal-left + [:img {:src "images/features/1.12-ui.gif" :border "0" :alt "Adjustable UI"}]] + [:div.modal-right + [:div.modal-title + [:h2 "Adjustable UI"]] + [:div.modal-content + [:p "Adjust the workspace interface to your unique experience. Resize the sidebar, the layers panel or hide the whole UI to have maximum space."] + [:p "Along with a better organization of panels (say hello to typography toolbar!) and new shortcuts that will speed your workflow."]] + [:div.modal-navigation + [:button.btn-secondary {:on-click next} "Continue"] + [:& c/navigation-bullets + {:slide @slide + :navigate navigate + :total 4}]]]]]] + + 1 + [:div.modal-overlay + [:div.animated {:class @klass} + [:div.modal-container.onboarding.feature + [:div.modal-left + [:img {:src "images/features/1.12-guides.gif" :border "0" :alt "Guides"}]] + [:div.modal-right + [:div.modal-title + [:h2 "Guides"]] + [:div.modal-content + [:p "One of our most requested features! It’s hard to believe how far Penpot has come without guides, but they are here at last."] + [:p "And they don’t come alone, but with some nice improvements to the rulers."]] + [:div.modal-navigation + [:button.btn-secondary {:on-click next} "Continue"] + [:& c/navigation-bullets + {:slide @slide + :navigate navigate + :total 4}]]]]]] + + 2 + [:div.modal-overlay + [:div.animated {:class @klass} + [:div.modal-container.onboarding.feature + [:div.modal-left + [:img {:src "images/features/1.12-scrollbars.gif" :border "0" :alt "Scrollbars"}]] + [:div.modal-right + [:div.modal-title + [:h2 "Scrollbars"]] + [:div.modal-content + [:p "Scrollbars at the design workspace will make it more obvious how to navigate it and easier for some users, for instance those who love using graphic tablets, from now on, will feel just as comfortable as those who use a mouseAnd they don’t come alone, but with some nice improvements to the rulers."]] + [:div.modal-navigation + [:button.btn-secondary {:on-click next} "Continue"] + [:& c/navigation-bullets + {:slide @slide + :navigate navigate + :total 4}]]]]]] + + 3 + [:div.modal-overlay + [:div.animated {:class @klass} + [:div.modal-container.onboarding.feature + [:div.modal-left + [:img {:src "images/features/1.12-nudge.gif" :border "0" :alt "Nudge amount"}]] + [:div.modal-right + [:div.modal-title + [:h2 "Nudge amount"]] + [:div.modal-content + [:p "Set your desired distance to move objects using the keyboard."] + [:p "This is a must if you’re working with grids (if you’re not, you should ;)), being able to adjust the movement to your baseline grid (8px? 5px?) is a huge timesaver that will improve your quality of life while designing."]] + [:div.modal-navigation + [:button.btn-secondary {:on-click finish} "Start!"] + [:& c/navigation-bullets + {:slide @slide + :navigate navigate + :total 4}]]]]]]))) diff --git a/frontend/src/app/main/ui/workspace/textpalette.cljs b/frontend/src/app/main/ui/workspace/textpalette.cljs index 4d9ca61586..10a71aab5e 100644 --- a/frontend/src/app/main/ui/workspace/textpalette.cljs +++ b/frontend/src/app/main/ui/workspace/textpalette.cljs @@ -51,7 +51,7 @@ (when-not name-only? [:* [:div.typography-font (:name font-data)] - [:div.typography-data (str (:font-size typography) "pt | " (:name variant-data))]])])) + [:div.typography-data (str (:font-size typography) "px | " (:name variant-data))]])])) (mf/defc palette [{:keys [selected-ids current-file-id file-typographies shared-libs]}]