From fa816d5bfade9eb84e93b720bfc55e6af4e623f4 Mon Sep 17 00:00:00 2001 From: klopez4212 Date: Wed, 8 Jul 2026 17:54:06 +0100 Subject: [PATCH] fix(desktop): clamp HDR avatar images to SDR range (#1642) Signed-off-by: npub13fn4ahfnvaa2qwylvegdgeajqs0mph6v4qsw4jcqnw4mjh3hzh2quuucm5 <8a675edd33677aa0389f6650d467b2041fb0df4ca820eacb009babb95e3715d4@sprout-oss.stage.blox.sqprod.co> Co-authored-by: npub13fn4ahfnvaa2qwylvegdgeajqs0mph6v4qsw4jcqnw4mjh3hzh2quuucm5 <8a675edd33677aa0389f6650d467b2041fb0df4ca820eacb009babb95e3715d4@sprout-oss.stage.blox.sqprod.co> --- desktop/src/shared/styles/globals/utilities.css | 14 ++++++++++++++ desktop/src/shared/ui/avatar.tsx | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/desktop/src/shared/styles/globals/utilities.css b/desktop/src/shared/styles/globals/utilities.css index 461409e91..1dd7326e2 100644 --- a/desktop/src/shared/styles/globals/utilities.css +++ b/desktop/src/shared/styles/globals/utilities.css @@ -87,4 +87,18 @@ ) ); } + + /* + * Clamp HDR (gain-map) images to the standard SDR range. Some uploaded + * avatars carry HDR gain maps, which capable displays render brighter than + * SDR white — making the avatar glow relative to the rest of the UI. This + * pins their luminance to the SDR envelope so they sit at the same level as + * everything else. `dynamic-range-limit` is the purpose-built CSS property + * (Chromium 133+, WebKit/Safari 26+); on engines that don't support it the + * declaration is simply ignored (avatars render as before), so it's a safe + * progressive enhancement. + */ + .avatar-sdr-clamp { + dynamic-range-limit: standard; + } } diff --git a/desktop/src/shared/ui/avatar.tsx b/desktop/src/shared/ui/avatar.tsx index edb2e0bc5..7263786e9 100644 --- a/desktop/src/shared/ui/avatar.tsx +++ b/desktop/src/shared/ui/avatar.tsx @@ -24,7 +24,7 @@ const AvatarImage = React.forwardRef< >(({ className, ...props }, ref) => (