diff --git a/.clj-kondo/config.edn b/.clj-kondo/config.edn index 1d5149d6b6..fba4cac7bc 100644 --- a/.clj-kondo/config.edn +++ b/.clj-kondo/config.edn @@ -45,6 +45,15 @@ :potok/reify-type {:level :error} + :redundant-primitive-coercion + {:level :off} + + :unused-excluded-var + {:level :off} + + :unresolved-excluded-var + {:level :off} + :missing-protocol-method {:level :off} diff --git a/.github/workflows/plugins-deploy-api-doc.yml b/.github/workflows/plugins-deploy-api-doc.yml index 67f0542b48..aaa1339c9e 100644 --- a/.github/workflows/plugins-deploy-api-doc.yml +++ b/.github/workflows/plugins-deploy-api-doc.yml @@ -110,4 +110,16 @@ jobs: workingDirectory: plugins apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - command: deploy --config wrangle-penpot-plugins-api-doc.toml --name ${{ env.WORKER_NAME }} + command: deploy --config wrangler-penpot-plugins-api-doc.toml --name ${{ env.WORKER_NAME }} + + - name: Notify Mattermost + if: failure() + uses: mattermost/action-mattermost-notify@master + with: + MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK }} + MATTERMOST_CHANNEL: bot-alerts-cicd + TEXT: | + ❌ 🧩📚 *[PENPOT PLUGINS] Error deploying API documentation.* + 📄 Triggered from ref: `${{ inputs.gh_ref }}` + 🔗 Run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + @infra diff --git a/CHANGES.md b/CHANGES.md index b175d03cfb..23f906325c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -36,7 +36,8 @@ - Fix exception on uploading large fonts [Github #8135](https://github.com/penpot/penpot/pull/8135) - Fix unhandled exception on open-new-window helper [Github #7787](https://github.com/penpot/penpot/issues/7787) - Fix incorrect handling of input values on layout gap and padding inputs [Github #8113](https://github.com/penpot/penpot/issues/8113) - +- Fix several race conditions on path editor [Github #8187](https://github.com/penpot/penpot/pull/8187) +- Fix app freeze when introducing an error on a very long token name [Taiga #13214](https://tree.taiga.io/project/penpot/issue/13214) ## 2.12.1 diff --git a/backend/src/app/binfile/v3.clj b/backend/src/app/binfile/v3.clj index bd6c041b0a..0db826e407 100644 --- a/backend/src/app/binfile/v3.clj +++ b/backend/src/app/binfile/v3.clj @@ -873,11 +873,8 @@ (import-storage-objects cfg) (let [files (get manifest :files) - result (reduce (fn [result {:keys [id] :as file}] + result (reduce (fn [result file] (let [name' (get file :name) - name' (if (map? name) - (get name id) - name') file (assoc file :name name')] (conj result (import-file cfg file)))) [] diff --git a/common/src/app/common/types/token.cljc b/common/src/app/common/types/token.cljc index 5ee3661a91..6a9d830a3a 100644 --- a/common/src/app/common/types/token.cljc +++ b/common/src/app/common/types/token.cljc @@ -99,7 +99,7 @@ (def token-name-ref [:re {:title "TokenNameRef" :gen/gen sg/text} - #"^(?!\$)([a-zA-Z0-9-$_]+\.?)*(? content last :command) :move-to)) (into [] (take (dec (count content)) content)) content)] - (-> state - (st/set-content content)))) + (st/set-content state content))) ptk/WatchEvent (watch [it state _] (let [page-id (:current-page-id state) - objects (dsh/lookup-page-objects state page-id) - id (dm/get-in state [:workspace-local :edition]) - old-content (dm/get-in state [:workspace-local :edit-path id :old-content]) - shape (st/get-path state)] + local (get state :workspace-local) + id (get local :edition) + objects (dsh/lookup-page-objects state page-id)] - (if (and (some? old-content) (some? (:id shape))) - (let [changes (generate-path-changes it objects page-id shape old-content (:content shape))] - (rx/of (dch/commit-changes changes))) - (rx/empty))))))) + ;; NOTE: we proceed only if the shape is present on the + ;; objects, if shape is a ephimeral drawing shape, we should + ;; do nothing + (when-let [shape (get objects id)] + (when-let [old-content (dm/get-in local [:edit-path id :old-content])] + (let [new-content (get shape :content) + changes (generate-path-changes it objects page-id shape old-content new-content)] + (rx/of (dch/commit-changes changes)))))))))) diff --git a/frontend/src/app/main/data/workspace/path/edition.cljs b/frontend/src/app/main/data/workspace/path/edition.cljs index 1210111f71..a97947ea05 100644 --- a/frontend/src/app/main/data/workspace/path/edition.cljs +++ b/frontend/src/app/main/data/workspace/path/edition.cljs @@ -8,7 +8,6 @@ (:require [app.common.data :as d] [app.common.data.macros :as dm] - [app.common.files.helpers :as cfh] [app.common.geom.point :as gpt] [app.common.types.path :as path] [app.common.types.path.helpers :as path.helpers] @@ -289,34 +288,34 @@ (declare stop-path-edit) + (defn start-path-edit [id] (ptk/reify ::start-path-edit ptk/UpdateEvent (update [_ state] (let [objects (dsh/lookup-page-objects state) - edit-path (dm/get-in state [:workspace-local :edit-path id]) - content (st/get-path state :content) - state (cond-> state - (cfh/path-shape? objects id) - (st/set-content (path/close-subpaths content)))] + shape (get objects id)] - (cond-> state - (or (not edit-path) - (= :draw (:edit-mode edit-path))) - (assoc-in [:workspace-local :edit-path id] {:edit-mode :move - :selected #{} - :snap-toggled false}) - (and (some? edit-path) - (= :move (:edit-mode edit-path))) - (assoc-in [:workspace-local :edit-path id :edit-mode] :draw)))) + (-> state + (st/set-content (path/close-subpaths (:content shape))) + (update-in [:workspace-local :edit-path id] + (fn [state] + (let [state (if state + (if (= :move (:edit-mode state)) + (assoc state :edit-mode :draw) + state) + {:edit-mode :move + :selected #{} + :snap-toggled false})] + (assoc state :old-content (:content shape)))))))) ptk/WatchEvent (watch [_ _ stream] - (let [stopper (->> stream - (rx/filter #(let [type (ptk/type %)] - (= type ::dwe/clear-edition-mode) - (= type ::start-path-edit))))] + (let [stopper (rx/filter #(let [type (ptk/type %)] + (= type ::dwe/clear-edition-mode) + (= type ::start-path-edit)) + stream)] (rx/concat (rx/of (undo/start-path-undo)) (->> stream @@ -325,7 +324,8 @@ (rx/map #(stop-path-edit id)) (rx/take-until stopper))))))) -(defn stop-path-edit [id] +(defn stop-path-edit + [id] (ptk/reify ::stop-path-edit ptk/UpdateEvent (update [_ state] @@ -335,13 +335,12 @@ (watch [_ _ _] (rx/of (ptk/data-event :layout/update {:ids [id]}))))) -(defn split-segments - [{:keys [from-p to-p t]}] +(defn- split-segments + [id {:keys [from-p to-p t]}] (ptk/reify ::split-segments ptk/UpdateEvent (update [_ state] - (let [id (st/get-path-id state) - content (st/get-path state :content)] + (let [content (st/get-path state :content)] (-> state (assoc-in [:workspace-local :edit-path id :old-content] content) (st/set-content (-> content @@ -353,10 +352,10 @@ (rx/of (changes/save-path-content {:preserve-move-to true}))))) (defn create-node-at-position - [event] + [params] (ptk/reify ::create-node-at-position ptk/WatchEvent (watch [_ state _] (let [id (st/get-path-id state)] (rx/of (dwsh/update-shapes [id] path/convert-to-path) - (split-segments event)))))) + (split-segments id params)))))) diff --git a/plugins/wrangle-penpot-plugins-api-doc.toml b/plugins/wrangle-penpot-plugins-api-doc.toml deleted file mode 100644 index e9535be2d8..0000000000 --- a/plugins/wrangle-penpot-plugins-api-doc.toml +++ /dev/null @@ -1,4 +0,0 @@ -name = "penpot-plugins-api-doc" -compatibility_date = "2025-01-01" - -assets = { directory = "dist/doc" }