From d745dc4a3cb9f8e4c1b1ccc31f317960bf9de5c8 Mon Sep 17 00:00:00 2001 From: 0xTHAC0 Date: Tue, 18 Aug 2026 16:14:22 +0530 Subject: [PATCH] :bug: 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 --- frontend/src/app/main/ui/dashboard/grid.cljs | 18 ++++++++++++------ frontend/translations/en.po | 6 +++++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/main/ui/dashboard/grid.cljs b/frontend/src/app/main/ui/dashboard/grid.cljs index 59442337f8..5588805f7e 100644 --- a/frontend/src/app/main/ui/dashboard/grid.cljs +++ b/frontend/src/app/main/ui/dashboard/grid.cljs @@ -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] diff --git a/frontend/translations/en.po b/frontend/translations/en.po index 014b63b258..f2b57e315f 100644 --- a/frontend/translations/en.po +++ b/frontend/translations/en.po @@ -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)"