Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
feat(calls): channel name tags to call record tiles (#4713)
Will Hutchinsonc4f4d7e6ec86
diff --git a/js/app/packages/entity/src/components/Badges.tsx b/js/app/packages/entity/src/components/Badges.tsxindex 00840e7c8e..02c37b718c 100644--- a/js/app/packages/entity/src/components/Badges.tsx+++ b/js/app/packages/entity/src/components/Badges.tsx@@ -1,17 +1,19 @@import { UserIcon } from '@core/component/UserIcon';import { tryMacroId, useDisplayName } from '@core/user';+import HashIcon from '@phosphor/hash.svg';import UserPlus from '@phosphor/user-plus.svg';import { cn, HoverCard } from '@ui';import type { ParentProps } from 'solid-js';import type { CallStatus } from '../types/entity';-function Badge(props: ParentProps<{ class?: string }>) {+function Badge(props: ParentProps<{ class?: string; title?: string }>) {return (<divclass={cn('font-mono font-medium user-select-none uppercase flex items-center p-0.5 gap-1 text-xxs rounded-full border',props.class)}+ title={props.title}>{props.children}</div>@@ -135,6 +137,26 @@ export function CallStatusBadge(props: { status: CallStatus }) {return <Badge class={config().class}>{config().label}</Badge>;}+export function CallChannelNameBadge(props: { channelName: string }) {+ return (+ <Badge+ class="ph-no-capture max-w-32 min-w-0 shrink-0 normal-case font-sans text-ink-extra-muted border-edge-muted px-2"+ title={props.channelName}+ >+ <HashIcon class="size-3 shrink-0" />+ <span class="truncate">{props.channelName}</span>+ </Badge>+ );+}++export function CallDurationBadge(props: { duration: string }) {+ return (+ <Badge class="normal-case text-ink-extra-muted border-edge-muted px-2">+ {props.duration}+ </Badge>+ );+}+export function AttendanceBadge(props: { attended: boolean }) {return (<CallStatusBadge status={props.attended ? 'ATTENDED' : 'UNATTENDED'} />diff --git a/js/app/packages/entity/src/composed/list-entity/call.tsx b/js/app/packages/entity/src/composed/list-entity/call.tsxindex cb27391b60..13468a0241 100644--- a/js/app/packages/entity/src/composed/list-entity/call.tsx+++ b/js/app/packages/entity/src/composed/list-entity/call.tsx@@ -8,7 +8,7 @@ import type { EntityReference } from '@property/types';import { EntityType } from '@service-properties/generated/schemas/entityType';import { HoverCard } from '@ui';import { For, Show } from 'solid-js';-import { CallStatusBadge } from '../../components/Badges';+import { CallChannelNameBadge, CallStatusBadge } from '../../components/Badges';import { CallRecordName } from '../../components/CallRecordName';import { Entity } from '../../entity';import { HitSnippet } from '../../extractors-search/HitSnippet';@@ -132,31 +132,25 @@ export function CallWideContent(props: {chars: number;}) {const hit = () => firstContentHit(props.entity);+ const channelName = () => props.entity.channelName?.trim() || undefined;return (<><span class="truncate"><CallRecordName entity={props.entity} /></span>+ <Show when={channelName()}>+ {(name) => <CallChannelNameBadge channelName={name()} />}+ </Show><Showwhen={hit()}fallback={- <>- <span class="text-ink-extra-muted font-medium truncate shrink-0">- <Show- when={props.entity.durationMs}- fallback={props.entity.isActive ? 'In progress' : ''}- >- {(ms) => formatCallDuration(ms())}- </Show>- </span>- <Show when={props.entity.summary}>- {(summary) => (- <span class="text-ink/50 font-medium truncate flex-1 min-w-0">- {summary()}- </span>- )}- </Show>- </>+ <Show when={props.entity.summary}>+ {(summary) => (+ <span class="text-ink/50 font-medium truncate flex-1 min-w-0">+ {summary()}+ </span>+ )}+ </Show>}>{(h) => (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.tsxindex 014f215a33..420f5e75eb 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@@ -1,12 +1,17 @@import { useRowTagsVisible } from '@app/component/next-soup/soup-view/filters-bar/search/search-tags-flag';import { useRowTagFilter } from '@app/component/next-soup/soup-view/filters-bar/use-row-tag-filter';import { useMaybeSoupView } from '@app/component/next-soup/soup-view/soup-view-context';+import { formatCallDuration } from '@block-call/utils';import { EntityRowTags } from '@property/tags';import { EntityType } from '@service-properties/generated/schemas/entityType';import type { SoupProperty } from '@service-storage/generated/schemas/soupProperty';import { cn } from '@ui';import { Match, Show, Switch } from 'solid-js';-import { CallStatusBadge, SharedBadge } from '../../components/Badges';+import {+ CallDurationBadge,+ CallStatusBadge,+ SharedBadge,+} from '../../components/Badges';import { MultiSelectCheckbox } from '../../components/MultiSelectCheckbox';import { ProjectBreadCrumb } from '../../components/ProjectBreadCrumb';import { UnreadIndicator } from '../../components/UnreadIndicator';@@ -229,6 +234,20 @@ export function WideLayout(props: LayoutProps) {<Show when={(soupView?.activeTab() ?? 'all') === 'all'}><CallStatusBadge status={entity().status} /></Show>+ <Show+ when={entity().durationMs}+ fallback={+ <Show when={entity().isActive}>+ <CallDurationBadge duration="In progress" />+ </Show>+ }+ >+ {(durationMs) => (+ <CallDurationBadge+ duration={formatCallDuration(durationMs())}+ />+ )}+ </Show><span class="flex w-10 shrink-0 justify-end"><CallParticipants participantIds={entity().participantIds} /></span>