From 2813fda136f32963b0310731b960b094139e094a Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 23 Dec 2024 12:36:22 +0100 Subject: [PATCH 1/4] :bug: Fix problem with component swap style --- CHANGES.md | 1 + .../app/main/ui/workspace/sidebar/options/menus/component.scss | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 55cff84bb..8b2a77093 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -32,6 +32,7 @@ - Fix problem with some texts desynchronization [Taiga #9379](https://tree.taiga.io/project/penpot/issue/9379) - Fix problem with reoder grid layers [#5446](https://github.com/penpot/penpot/issues/5446) +- Fix problem with swap component style [#9542](https://tree.taiga.io/project/penpot/issue/9542) ## 2.3.3 diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/component.scss b/frontend/src/app/main/ui/workspace/sidebar/options/menus/component.scss index aa443fa33..030d64cac 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/component.scss +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/component.scss @@ -402,6 +402,7 @@ .component-swap { padding-top: $s-12; + max-width: $s-248; } .component-swap-content { From bcdf5d86ae0c1a5dc61887ecbd6fa6b17e8926d6 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 2 Jan 2025 12:01:30 +0100 Subject: [PATCH 2/4] :bug: Fix problem with thumbnail generation when changing between versions --- CHANGES.md | 6 +++++ .../app/main/data/workspace/thumbnails.cljs | 5 ++++ .../src/app/main/data/workspace/versions.cljs | 2 ++ frontend/src/app/util/queue.cljs | 23 +++++++++++++------ 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 8b2a77093..68ed86a7f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,11 @@ # CHANGELOG +## 2.4.1 + +### :bug: Bugs fixed + +- Fix problem with thumbnail generation when changing between versions [Taiga #9624](https://tree.taiga.io/project/penpot/issue/9624) + ## 2.4.0 ### :rocket: Epics and highlights diff --git a/frontend/src/app/main/data/workspace/thumbnails.cljs b/frontend/src/app/main/data/workspace/thumbnails.cljs index 0d2ef2239..132db9156 100644 --- a/frontend/src/app/main/data/workspace/thumbnails.cljs +++ b/frontend/src/app/main/data/workspace/thumbnails.cljs @@ -52,6 +52,11 @@ (defonce queue (q/create find-request (/ 1000 30))) +(defn clear-queue! + [] + (l/dbg :hint "clearing thumbnail queue") + (q/clear! queue)) + ;; This function first renders the HTML calling `render/render-frame` that ;; returns HTML as a string, then we send that data to the iframe rasterizer ;; that returns the image as a Blob. Finally we create a URI for that blob. diff --git a/frontend/src/app/main/data/workspace/versions.cljs b/frontend/src/app/main/data/workspace/versions.cljs index 0808c6f47..7b350d65a 100644 --- a/frontend/src/app/main/data/workspace/versions.cljs +++ b/frontend/src/app/main/data/workspace/versions.cljs @@ -11,6 +11,7 @@ [app.main.data.events :as ev] [app.main.data.persistence :as dwp] [app.main.data.workspace :as dw] + [app.main.data.workspace.thumbnails :as th] [app.main.refs :as refs] [app.main.repo :as rp] [app.util.time :as dt] @@ -132,6 +133,7 @@ (rx/filter #(or (nil? %) (= :saved %))) (rx/take 1) (rx/mapcat #(rp/cmd! :restore-file-snapshot {:file-id file-id :id id})) + (rx/tap #(th/clear-queue!)) (rx/map #(dw/initialize-file project-id file-id))) (case origin :version diff --git a/frontend/src/app/util/queue.cljs b/frontend/src/app/util/queue.cljs index 564fd3cda..4fbc72b30 100644 --- a/frontend/src/app/util/queue.cljs +++ b/frontend/src/app/util/queue.cljs @@ -9,6 +9,7 @@ (:require [app.common.logging :as l] [app.common.math :as mth] + [app.util.object :as obj] [app.util.time :as t] [beicon.v2.core :as rx])) @@ -47,13 +48,14 @@ ;; NOTE: Right now there are no cases where we need to cancel a process ;; but if we do, we can use this function -;; (defn- cancel-process -;; [queue] -;; (l/dbg :hint "queue::cancel-process") -;; (let [timeout (unchecked-get queue "timeout")] -;; (when (some? timeout) -;; (js/clearTimeout timeout)) -;; (unchecked-set queue "timeout" nil))) +(defn- cancel-process! + [queue] + (l/dbg :hint "queue::cancel-process") + (let [timeout (unchecked-get queue "timeout")] + (when (some? timeout) + (js/clearTimeout timeout)) + (unchecked-set queue "timeout" nil)) + queue) (defn- process [queue iterations] @@ -131,3 +133,10 @@ (enqueue-last queue request)))) (rx/to-observable result))) + +(defn clear! + [queue] + (-> queue + (cancel-process!) + (obj/set! "items" #js []) + (obj/set! "time" 0))) From e4c427609d34a7011e150d6a4393fe8c17e1e5a0 Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Mon, 30 Dec 2024 16:20:52 +0100 Subject: [PATCH 3/4] :sparkles: Add feature flags info to posthog events --- frontend/src/app/config.cljs | 5 +++++ frontend/src/app/main/data/events.cljs | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/frontend/src/app/config.cljs b/frontend/src/app/config.cljs index b58876f97..b809f7e2e 100644 --- a/frontend/src/app/config.cljs +++ b/frontend/src/app/config.cljs @@ -143,6 +143,11 @@ (let [f (obj/get global "externalSessionId")] (when (fn? f) (f)))) +(defn external-context-info + [] + (let [f (obj/get global "externalContextInfo")] + (when (fn? f) (f)))) + ;; --- Helper Functions (defn ^boolean check-browser? [candidate] diff --git a/frontend/src/app/main/data/events.cljs b/frontend/src/app/main/data/events.cljs index 27001909a..ef1838884 100644 --- a/frontend/src/app/main/data/events.cljs +++ b/frontend/src/app/main/data/events.cljs @@ -8,6 +8,7 @@ (:require ["ua-parser-js" :as ua] [app.common.data :as d] + [app.common.json :as json] [app.common.logging :as l] [app.config :as cf] [app.main.repo :as rp] @@ -93,6 +94,11 @@ data data)) +(defn add-external-context-info + [context] + (let [external-context-info (json/->clj (cf/external-context-info))] + (merge context external-context-info))) + (defn- process-event-by-proto [event] (let [data (d/deep-merge (-data event) (meta event)) @@ -102,6 +108,7 @@ (assoc :event-origin (::origin data)) (assoc :event-namespace (namespace type)) (assoc :event-symbol ev-name) + (add-external-context-info) (d/without-nils)) props (-> data d/without-qualified simplify-props)] @@ -119,6 +126,7 @@ (let [type (::type data "action") context (-> (::context data) (assoc :event-origin (::origin data)) + (add-external-context-info) (d/without-nils)) props (-> data d/without-qualified simplify-props)] {:type type From 7aa46a1f62df96ebceffd1d206c74f3439ffe591 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 7 Jan 2025 10:51:46 +0100 Subject: [PATCH 4/4] :fire: Remove 2.4.1 from changelog --- CHANGES.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 68ed86a7f..8b2a77093 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,11 +1,5 @@ # CHANGELOG -## 2.4.1 - -### :bug: Bugs fixed - -- Fix problem with thumbnail generation when changing between versions [Taiga #9624](https://tree.taiga.io/project/penpot/issue/9624) - ## 2.4.0 ### :rocket: Epics and highlights