Skip to content

Commit ff75959

Browse files
committed
Bugfix(modeling-commons): Set profile avatars fetch dimensions
1 parent 0453041 commit ff75959

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

apps/modeling-commons-frontend/app/components/upload/AvatarUpload.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
:text="initials"
2020
:pending="pending"
2121
class="size-full rounded-full bg-neutral-darkest/5 text-2xl"
22+
:width="160"
23+
:height="160"
2224
variant="compact"
2325
/>
2426

apps/modeling-commons-frontend/app/components/user/UserAvatar.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
:alt="displayAlt"
2121
:text="initials"
2222
:size="variantProps.avatar.size"
23+
:width="headlineImagePx"
24+
:height="headlineImagePx"
2325
class="size-20 lg:size-8"
2426
:ui="{ ...asRecord(variantProps.avatar.ui), ...asRecord($attrs.ui) }"
2527
v-bind="$attrs"
@@ -59,6 +61,13 @@ const props = withDefaults(defineProps<AvatarProps>(), {
5961
container: "",
6062
});
6163
64+
// UAvatar requests the IPX image at its `size` token (caps at 48px), but the
65+
// headline box is painted at size-20 (80px). Request 80px so @nuxt/image's 2×
66+
// density variant stays sharp on retina; the externally-sized `compact` variant
67+
// is left to its call sites since its box varies (20px–160px).
68+
// -- Omar Ibrahim, Jun 18 26
69+
const headlineImagePx = 80;
70+
6271
const displayAlt = computed(() => createAltText(props.alt, props.name));
6372
const initials = computed(() => createInitials(props.name));
6473
const variantProps = computed(() => getVariantProps(props.variant));

apps/modeling-commons-frontend/app/components/user/UserHeader.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
:src="image"
66
:name="name"
77
class="size-25 sm:size-30 lg:size-35"
8+
:width="140"
9+
:height="140"
810
variant="compact"
911
/>
1012
<div class="space-y-2">

0 commit comments

Comments
 (0)