Skip to content

The open alternative to Salesforce, designed for AI.

7182 person avatar is not the same color in emails and calendar (#7185)

Raphaël Bosi20d06b3c0ff0
diff --git a/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventRow.tsx b/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventRow.tsx
index a246ff432f3..cb9548f8baf 100644
--- a/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventRow.tsx
+++ b/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventRow.tsx
@@ -176,7 +176,7 @@ export const CalendarEventRow = ({
: participant.displayName
}
placeholderColorSeed={
- participant.workspaceMemberId ?? participant.personId
+ participant.workspaceMemberId || participant.personId
}
type="rounded"
/>
diff --git a/packages/twenty-front/src/modules/activities/emails/components/EmailThreadPreview.tsx b/packages/twenty-front/src/modules/activities/emails/components/EmailThreadPreview.tsx
index e381b1bac35..bb7f8c1407f 100644
--- a/packages/twenty-front/src/modules/activities/emails/components/EmailThreadPreview.tsx
+++ b/packages/twenty-front/src/modules/activities/emails/components/EmailThreadPreview.tsx
@@ -1,5 +1,5 @@
-import { useRef } from 'react';
import styled from '@emotion/styled';
+import { useRef } from 'react';
import { useRecoilCallback } from 'recoil';
import { Avatar, GRAY_SCALE } from 'twenty-ui';
@@ -155,12 +155,20 @@ export const EmailThreadPreview = ({
<Avatar
avatarUrl={thread?.firstParticipant?.avatarUrl}
placeholder={thread.firstParticipant.displayName}
+ placeholderColorSeed={
+ thread.firstParticipant.workspaceMemberId ||
+ thread.firstParticipant.personId
+ }
type="rounded"
/>
{thread?.lastTwoParticipants?.[0] && (
<StyledAvatar
avatarUrl={thread.lastTwoParticipants[0].avatarUrl}
placeholder={thread.lastTwoParticipants[0].displayName}
+ placeholderColorSeed={
+ thread.lastTwoParticipants[0].workspaceMemberId ||
+ thread.lastTwoParticipants[0].personId
+ }
type="rounded"
/>
)}
diff --git a/packages/twenty-server/src/engine/core-modules/calendar/timeline-calendar-event.service.ts b/packages/twenty-server/src/engine/core-modules/calendar/timeline-calendar-event.service.ts
index a12c745fc21..c26c03959ef 100644
--- a/packages/twenty-server/src/engine/core-modules/calendar/timeline-calendar-event.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/calendar/timeline-calendar-event.service.ts
@@ -93,6 +93,8 @@ export class TimelineCalendarEventService {
participant.person?.name?.lastName ||
participant.workspaceMember?.name.firstName ||
participant.workspaceMember?.name.lastName ||
+ participant.displayName ||
+ participant.handle ||
'',
avatarUrl:
participant.person?.avatarUrl ||