🐛 Fix grid item date tooltip showing deletion text on non-deleted files (#11161)

The grid-item-metadata* component always used :will-be-deleted-at (falling
back to :modified-at) and always showed the "Will be deleted %s" tooltip,
even for files in the Recent tab that have no deletion date.

Now the component branches on the presence of :will-be-deleted-at:
- Deleted files: show the deletion timeago with the existing
  "Will be deleted %s" tooltip.
- Regular files: show :modified-at timeago with a new
  "Last modified %s" tooltip key (dashboard.grid.last-modified-at).

Closes #10873

Co-authored-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
0xTHAC0 2026-08-18 16:14:22 +05:30 committed by Andrey Antukh
parent c72bb331ef
commit d745dc4a3c
2 changed files with 17 additions and 7 deletions

View File

@ -239,12 +239,18 @@
(mf/defc grid-item-metadata*
{::mf/private true}
[{:keys [file layout]}]
(let [time (ct/timeago (or (:will-be-deleted-at file)
(:modified-at file)))]
[:span {:class (stl/css-case :grid-item-date (= layout :grid)
:list-item-date (= layout :list))
:title (tr "dashboard.deleted.will-be-deleted-at" time)}
time]))
(let [deleted-at (:will-be-deleted-at file)
date-class (stl/css-case :grid-item-date (= layout :grid)
:list-item-date (= layout :list))]
(if deleted-at
(let [time (ct/timeago deleted-at)]
[:span {:class date-class
:title (tr "dashboard.deleted.will-be-deleted-at" time)}
time])
(let [time (ct/timeago (:modified-at file))]
[:span {:class date-class
:title (tr "dashboard.grid.last-modified-at" time)}
time]))))
(defn create-counter-element
[_element file-count]

View File

@ -453,10 +453,14 @@ msgstr "Delete team"
msgid "dashboard.deleted.empty-state-description"
msgstr "Your trash is empty. Deleted files and projects will appear here."
#: src/app/main/ui/dashboard/grid.cljs:247
#: src/app/main/ui/dashboard/grid.cljs:252
msgid "dashboard.deleted.will-be-deleted-at"
msgstr "Will be deleted %s"
#: src/app/main/ui/dashboard/grid.cljs:256
msgid "dashboard.grid.last-modified-at"
msgstr "Last modified %s"
#: src/app/main/ui/dashboard/file_menu.cljs:329, src/app/main/ui/workspace/main_menu.cljs:732
msgid "dashboard.download-binary-file"
msgstr "Download Penpot file (.penpot)"