Compare commits

...

4 Commits

Author SHA1 Message Date
Andrey Antukh
1b41227440 📎 Update changelog 2026-02-24 19:10:39 +01:00
Andrey Antukh
ad8575a82a 🐛 Fix milestone group timestamp formatting 2026-02-24 19:10:39 +01:00
Andrey Antukh
25fa8fcac4 Reduce allocation on milestone-group* component 2026-02-24 19:10:39 +01:00
Andrey Antukh
1cd92ae226 🐛 Add missing order by clause to snapshot query
This fixes the incorrect snapshot visibility when file
has a lot of versions.
2026-02-24 19:10:35 +01:00
5 changed files with 24 additions and 19 deletions

View File

@@ -1,5 +1,12 @@
# CHANGELOG
## 2.13.4
### :bug: Bugs fixed
- Fix incorrect query for file versions [Github #8463](https://github.com/penpot/penpot/pull/8463)
## 2.13.3
### :bug: Bugs fixed

View File

@@ -138,6 +138,7 @@
c.deleted_at
FROM snapshots1 AS c
WHERE c.file_id = ?
ORDER BY c.created_at DESC
), snapshots3 AS (
(SELECT * FROM snapshots2
WHERE created_by = 'system'
@@ -150,8 +151,7 @@
AND deleted_at IS NULL
LIMIT 500)
)
SELECT * FROM snapshots3
ORDER BY created_at DESC"))
SELECT * FROM snapshots3;"))
(defn get-visible-snapshots
"Return a list of snapshots fecheable from the API, it has a limited

View File

@@ -208,7 +208,7 @@
(dfn-format v "p")
:localized-date-time
(dfn-format v "PPPp")
(dfn-format v "PPP . p")
(if (string? fmt)
(dfn-format v fmt)

View File

@@ -39,7 +39,6 @@
(mf/spread-props props
{:class [class class']
:data-testid "milestone"})
open*
(mf/use-state false)
@@ -57,7 +56,13 @@
(dom/get-data "index")
(d/parse-integer))]
(when (fn? on-menu-click)
(on-menu-click index event)))))]
(on-menu-click index event)))))
snapshots
(mf/with-memo [snapshots]
(map-indexed (fn [index date]
(d/vec2 date index))
snapshots))]
[:> :div props
[:> text* {:as "span" :typography t/body-small :class (stl/css :name)} label]
@@ -76,14 +81,14 @@
:icon-arrow-toggled open?)}]]
(when ^boolean open?
(for [[idx d] (d/enumerate snapshots)]
[:div {:key (dm/str "entry-" idx)
(for [[date index] snapshots]
[:div {:key (dm/str "entry-" index)
:class (stl/css :version-entry)}
[:> date* {:date d :class (stl/css :date) :typography t/body-small}]
[:> date* {:date date :class (stl/css :date) :typography t/body-small}]
[:> icon-button* {:class (stl/css :entry-button)
:variant "ghost"
:icon i/menu
:aria-label (tr "workspace.versions.version-menu")
:data-index idx
:data-index index
:on-click on-menu-click}]]))]]))

View File

@@ -6,10 +6,8 @@
(ns app.main.ui.ds.utilities.date
(:require-macros
[app.common.data.macros :as dm]
[app.main.style :as stl])
(:require
[app.common.data :as d]
[app.common.time :as ct]
[app.main.ui.ds.foundations.typography :as t]
[app.main.ui.ds.foundations.typography.text :refer [text*]]
@@ -30,15 +28,10 @@
(mf/defc date*
{::mf/schema schema:date}
[{:keys [class date selected typography] :rest props}]
(let [class (d/append-class class (stl/css-case :date true :is-selected selected))
date (cond-> date (not (ct/inst? date)) ct/inst)
(let [date (cond-> date (not (ct/inst? date)) ct/inst)
typography (or typography t/body-medium)]
[:> text* {:as "time"
:typography typography
:class class
:class [class (stl/css-case :date true :is-selected selected)]
:date-time (ct/format-inst date :iso)}
(dm/str
(ct/format-inst date :localized-date)
" . "
(ct/format-inst date :localized-time)
"h")]))
(ct/format-inst date :localized-date-time)]))