Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(calls): add participants to call tile in soup (#2955)

Will Hutchinsond195a7e8fa97
diff --git a/js/app/packages/entity/src/composed/list-entity/call.tsx b/js/app/packages/entity/src/composed/list-entity/call.tsx
index e3ceefde18..757ea18bab 100644
--- a/js/app/packages/entity/src/composed/list-entity/call.tsx
+++ b/js/app/packages/entity/src/composed/list-entity/call.tsx
@@ -1,7 +1,13 @@
-import { Show } from 'solid-js';
+import { For, Show } from 'solid-js';
+import { usePropertyEntityDisplay } from '@core/component/Properties/hooks';
+import { UserGroup } from '@core/component/Properties/component/propertyValue/UserGroup';
+import type { EntityReference } from '@core/component/Properties/types';
+import { Tooltip } from '@core/component/Tooltip';
import { UserIcon } from '@core/component/UserIcon';
import { matches } from '@core/util/match';
import { formatCallDuration } from '@block-call/utils';
+import UserCircleIcon from '@icon/regular/user-circle.svg';
+import { EntityType } from '@service-properties/generated/schemas/entityType';
import { AttendanceBadge } from '../../components/Badges';
import { CallChannelName } from '../../components/CallChannelName';
import { Entity } from '../../entity';
@@ -11,6 +17,57 @@ import type { CallEntity } from '../../types/entity';
import { isCallRecordHit } from '../../types/search';
import { firstContentHit } from './shared';
+function ParticipantItem(props: { userId: string }) {
+ const { name } = usePropertyEntityDisplay(
+ () => props.userId,
+ () => EntityType.USER,
+ { fallbackIcon: null }
+ );
+ return (
+ <div class="inline-flex items-center gap-1.5 px-2 py-1 text-xs leading-none text-ink-muted border border-edge-muted h-fit w-fit">
+ <div class="size-4 rounded-full overflow-hidden shrink-0">
+ <UserIcon id={props.userId} isDeleted={false} size="fill" />
+ </div>
+ <span class="truncate max-w-[150px]">{name()}</span>
+ </div>
+ );
+}
+
+function ParticipantsTooltip(props: { participantIds: string[] }) {
+ return (
+ <div class="p-2 border border-edge-muted bg-panel min-w-48 max-w-72">
+ <div class="flex items-center gap-2 text-ink-muted border-b border-edge-muted/50 pb-1.5 mb-1.5">
+ <UserCircleIcon class="size-3.5 text-ink-muted" />
+ <span class="text-xs">Participants</span>
+ </div>
+ <div class="flex flex-col gap-1.5 max-h-64 overflow-y-auto">
+ <For each={props.participantIds}>
+ {(userId) => <ParticipantItem userId={userId} />}
+ </For>
+ </div>
+ </div>
+ );
+}
+
+export function CallParticipants(props: { participantIds: string[] }) {
+ const entities = (): EntityReference[] =>
+ props.participantIds.map((id) => ({
+ entity_id: id,
+ entity_type: EntityType.USER,
+ }));
+ return (
+ <Show when={props.participantIds.length > 0}>
+ <Tooltip
+ unstyled
+ tooltip={<ParticipantsTooltip participantIds={props.participantIds} />}
+ class="flex items-center"
+ >
+ <UserGroup entities={entities()} maxUsers={2} />
+ </Tooltip>
+ </Show>
+ );
+}
+
export function CallNarrowBody(props: {
entity: CallEntity;
showAttendanceBadge: boolean;
diff --git a/js/app/packages/entity/src/composed/list-entity/wide-layout.tsx b/js/app/packages/entity/src/composed/list-entity/wide-layout.tsx
index 73de8a2dc6..6ad6ff8807 100644
--- a/js/app/packages/entity/src/composed/list-entity/wide-layout.tsx
+++ b/js/app/packages/entity/src/composed/list-entity/wide-layout.tsx
@@ -17,7 +17,7 @@ import {
} from '../../types/entity';
import { isSearchEntity } from '../../types/search';
import { AutomationWideContent } from './automation';
-import { CallWideContent } from './call';
+import { CallParticipants, CallWideContent } from './call';
import { ChannelMessageWideContent, ChannelWideContent } from './channel';
import { EmailWideContent } from './email';
import type { LayoutProps } from './shared';
@@ -116,9 +116,12 @@ export function WideLayout(props: LayoutProps) {
</Show>
<Show when={isCallEntity(props.entity) && props.entity}>
{(entity) => (
- <Show when={(soupView?.activeTab() ?? 'all') === 'all'}>
- <AttendanceBadge attended={entity().attended} />
- </Show>
+ <>
+ <Show when={(soupView?.activeTab() ?? 'all') === 'all'}>
+ <AttendanceBadge attended={entity().attended} />
+ </Show>
+ <CallParticipants participantIds={entity().participantIds} />
+ </>
)}
</Show>
<Show when={isTaskEntity(props.entity) && props.entity}>