From df7caacb45bc0e054a91ed901e235a0f13c33be4 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Wed, 3 Dec 2025 13:01:36 +0100 Subject: [PATCH] :bug: Fix crash in token grid view due to tooltip validation (#7887) The color tokens in grid view have a tooltip which is a map. This is done so the frontend can render: ``` Name: foo Resolved value: #000000 ``` However the validation scheme for tooltips was only accepting functions and strings. --- How to reproduce the original (unreported) crash: * Create a color token * Create a shape, add a fill * Pick a color, chose the Token options * Click on the Grid View Crash: `{:hint "invalid props on component tooltip*\n\n -> 'content' should be a string\n"}` Signed-off-by: Dalai Felinto Co-authored-by: Dalai Felinto --- CHANGES.md | 1 + frontend/src/app/main/ui/ds/tooltip/tooltip.cljs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 56de1813be..f1e153712d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -61,6 +61,7 @@ example. It's still usable as before, we just removed the example. ### :heart: Community contributions (Thank you!) - Ensure consistent snap behavior across all zoom levels [Github #7774](https://github.com/penpot/penpot/pull/7774) by [@Tokytome](https://github.com/Tokytome) +- Fix crash in token grid view due to tooltip validation (by @dfelinto) [Github #7887](https://github.com/penpot/penpot/pull/7887) ### :sparkles: New features & Enhancements diff --git a/frontend/src/app/main/ui/ds/tooltip/tooltip.cljs b/frontend/src/app/main/ui/ds/tooltip/tooltip.cljs index 3dc5b71d66..5435ae0c77 100644 --- a/frontend/src/app/main/ui/ds/tooltip/tooltip.cljs +++ b/frontend/src/app/main/ui/ds/tooltip/tooltip.cljs @@ -173,7 +173,7 @@ [:id {:optional true} :string] [:offset {:optional true} :int] [:delay {:optional true} :int] - [:content [:or fn? :string]] + [:content [:or fn? :string map?]] [:placement {:optional true} [:maybe [:enum "top" "bottom" "left" "right" "top-right" "bottom-right" "bottom-left" "top-left"]]]])