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.

fix(home): preserve conversation avatars in detail breadcrumbs (#8930)

dev-rbe251efc03b0a
diff --git a/apps/web/AGENTS.md b/apps/web/AGENTS.md
index fdb72f1d5c..9816ac8d7a 100644
--- a/apps/web/AGENTS.md
+++ b/apps/web/AGENTS.md
@@ -212,6 +212,7 @@ ownership. Cancel, logout, and the ten-minute timeout retire pending callbacks.
- Mobile dock customization shares the navigation island’s measured capacity; persist ordering per user with `mobile-dock-order.ts`, preserve gated destinations, and keep Search and More fixed. Reorder handles drag without a hold delay; the rest of each row scrolls.
- Share sidebar and mobile dock unread presence through `components/app/use-navigation-unread.ts`; keep badges reactive to read/done changes, guard all query data with `queryReadyGate` so pending preferences or paused queries cannot suspend the shell, and avoid fetching extra pages for counts.
- Name Home thread rows from their latest scoped notification, including document mentions and reactions; use the thread author only when no notification exists. Document rows whose newest outstanding notification is a comment, and calendar event rows whose newest is a join request, say who did it (`row-notification.ts`).
+- Use `ChannelTitleIcon` for conversation breadcrumbs so DMs retain participant or agent avatars and named channels retain their pictures; suppress avatar actions inside breadcrumb buttons.
- Mobile dock search owns transient category/mode state in `features/command/mobile`; reuse the shared entity source and explicit full-text adapter rather than overlaying the dock query on view tabs or saved facets. See `docs/agent-guide/search.md` at the repository root.
- Include known Macro users in typed All/People name searches without requiring a DM or CRM contact; resolve a matching person to their existing one-to-one DM while preserving name/email matching.
- Key mobile name-result history ordering and scroll anchors by the other participant for one-to-one DMs, preserving a person's position when their conversation is created; keep group DMs keyed by channel.
diff --git a/apps/web/src/components/entity-detail/EntityDetailBreadcrumbItem.tsx b/apps/web/src/components/entity-detail/EntityDetailBreadcrumbItem.tsx
index 1dd2ae909a..d349587a81 100644
--- a/apps/web/src/components/entity-detail/EntityDetailBreadcrumbItem.tsx
+++ b/apps/web/src/components/entity-detail/EntityDetailBreadcrumbItem.tsx
@@ -1,4 +1,5 @@
import { ViewBreadcrumbs } from '@app/components/view-shell';
+import { ChannelTitleIcon } from '@channel/components/ChannelTopIcon';
import { useSplitDisplayName } from '@components/app/split-layout/layoutUtils';
import {
EntityIcon,
@@ -20,16 +21,15 @@ function breadcrumbIcon(target: EntityDetailTarget): EntityIconSelector {
target.fileType ??
'unknown') as EntityIconSelector;
}
- if (
- target.type === 'channel' ||
- target.type === 'channel_message' ||
- target.type === 'channel_thread'
- ) {
- return 'channel';
- }
return fileTypeToBlockName(target.type, true);
}
+function breadcrumbChannelId(target: EntityDetailTarget): string | undefined {
+ if (target.type === 'channel') return target.id;
+ if (target.type === 'channel_message' || target.type === 'channel_thread') {
+ return target.channelId;
+ }
+}
function fallbackBreadcrumbName(target: EntityDetailTarget) {
if (target.fallbackName) return target.fallbackName;
@@ -63,11 +63,20 @@ function BreadcrumbItem(props: {
onClick={item.onSelect}
tooltip={props.entry.data.type === 'document' ? undefined : props.name}
>
- <EntityIcon
- targetType={breadcrumbIcon(props.entry.data)}
- size="xs"
- class="shrink-0"
- />
+ <Show
+ when={breadcrumbChannelId(props.entry.data)}
+ fallback={
+ <EntityIcon
+ targetType={breadcrumbIcon(props.entry.data)}
+ size="xs"
+ class="shrink-0"
+ />
+ }
+ >
+ {(channelId) => (
+ <ChannelTitleIcon channelId={channelId()} suppressClick />
+ )}
+ </Show>
<span class="truncate">{props.name}</span>
</ViewBreadcrumbs.Button>
);
@@ -128,7 +137,12 @@ export function EntityDetailBreadcrumbItem(props: {
<LiveBreadcrumbItem
entry={props.entry}
order={props.order}
- previewItem={{ id: props.entry.data.id, type: props.entry.data.type }}
+ previewItem={{
+ id: breadcrumbChannelId(props.entry.data) ?? props.entry.data.id,
+ type: breadcrumbChannelId(props.entry.data)
+ ? 'channel'
+ : props.entry.data.type,
+ }}
setsSplitDisplayName={props.setsSplitDisplayName ?? false}
/>
);
diff --git a/apps/web/src/features/channel/Channel/ChannelDetail.tsx b/apps/web/src/features/channel/Channel/ChannelDetail.tsx
index e449492a99..680b7a4910 100644
--- a/apps/web/src/features/channel/Channel/ChannelDetail.tsx
+++ b/apps/web/src/features/channel/Channel/ChannelDetail.tsx
@@ -12,7 +12,7 @@ import { getCallJoinTab } from '@channel/Call/call-tabs';
import { useCall } from '@channel/Call/use-call';
import { ChannelCallsTab } from '@channel/Calls/ChannelCallsTab';
import { ChannelInviteButton } from '@channel/channel-invite-button';
-import { ChannelTopIcon } from '@channel/components/ChannelTopIcon';
+import { ChannelTitleIcon } from '@channel/components/ChannelTopIcon';
import { DebugSuspense } from '@channel/DebugSuspense';
import { ChannelParticipantsTab } from '@channel/Participants/ChannelParticipantsTab';
import { useGlobalBlockOrchestrator } from '@components/app/GlobalAppState';
@@ -36,7 +36,6 @@ import {
} from '@core/context/channels';
import { createMethodRegistration } from '@core/orchestrator';
import { lazyNamed } from '@core/util/lazyNamed';
-import { useChannelParticipantsQuery } from '@queries/channel/channel-participants';
import { Tabs } from '@ui';
import {
type Accessor,
@@ -104,18 +103,10 @@ type ChannelDetailHeaderProps = {
export function ChannelDetailTitle(props: ChannelDetailHeaderProps) {
const channelName = useChannelName(props.channelId, props.fallbackName);
- const channelType = useChannelType(props.channelId);
- const participantsQuery = useChannelParticipantsQuery(() => props.channelId);
- const participants = () =>
- participantsQuery.isSuccess ? (participantsQuery.data ?? []) : [];
return (
<div class="ph-no-capture flex min-w-0 shrink items-center gap-2">
- <ChannelTopIcon
- channelId={props.channelId}
- channelType={channelType()}
- participants={participants()}
- />
+ <ChannelTitleIcon channelId={props.channelId} />
<span class="truncate text-sm font-semibold">
{channelName() ?? 'New Channel'}
</span>
diff --git a/apps/web/src/features/channel/Channel/tests/channel-detail-navigation.test.tsx b/apps/web/src/features/channel/Channel/tests/channel-detail-navigation.test.tsx
index d65f753056..b387cd9def 100644
--- a/apps/web/src/features/channel/Channel/tests/channel-detail-navigation.test.tsx
+++ b/apps/web/src/features/channel/Channel/tests/channel-detail-navigation.test.tsx
@@ -68,7 +68,7 @@ vi.mock('@channel/Calls/ChannelCallsTab', () => ({
ChannelCallsTab: () => null,
}));
vi.mock('@channel/components/ChannelTopIcon', () => ({
- ChannelTopIcon: () => null,
+ ChannelTitleIcon: () => null,
}));
vi.mock('@channel/Participants/ChannelParticipantsTab', () => ({
ChannelParticipantsTab: () => null,
diff --git a/apps/web/src/features/channel/Channel/tests/channel-detail-top-bar.test.tsx b/apps/web/src/features/channel/Channel/tests/channel-detail-top-bar.test.tsx
index d1d52afee8..7ef149bcb7 100644
--- a/apps/web/src/features/channel/Channel/tests/channel-detail-top-bar.test.tsx
+++ b/apps/web/src/features/channel/Channel/tests/channel-detail-top-bar.test.tsx
@@ -64,7 +64,7 @@ vi.mock('@channel/channel-invite-button', () => ({
ChannelInviteButton: () => null,
}));
vi.mock('@channel/components/ChannelTopIcon', () => ({
- ChannelTopIcon: () => null,
+ ChannelTitleIcon: () => null,
}));
vi.mock('@channel/Participants/ChannelParticipantsTab', () => ({
ChannelParticipantsTab: () => null,
diff --git a/apps/web/src/features/channel/components/ChannelTopIcon.tsx b/apps/web/src/features/channel/components/ChannelTopIcon.tsx
index 90b32e33df..5b21ab4f55 100644
--- a/apps/web/src/features/channel/components/ChannelTopIcon.tsx
+++ b/apps/web/src/features/channel/components/ChannelTopIcon.tsx
@@ -1,9 +1,11 @@
import { PersonaAvatar } from '@app/features/agent-dms/components/persona-avatar';
import { ChannelAvatar } from '@channel/channel-avatar';
import { UserIcon } from '@core/component/UserIcon';
-import { useChannel } from '@core/context/channels';
+import { useChannel, useChannelType } from '@core/context/channels';
import { useUserId } from '@core/context/user';
+import { useChannelParticipantsQuery } from '@queries/channel/channel-participants';
import type { ChannelParticipant } from '@queries/channel/types';
+import { queryReadyGate } from '@queries/gate';
import { ChannelType } from '@service-storage/generated/schemas/channelType';
import { Show } from 'solid-js';
@@ -11,6 +13,7 @@ export type ChannelTopIconProps = {
channelId: string;
channelType: ChannelType | undefined;
participants: ChannelParticipant[];
+ suppressClick?: boolean;
};
/** Channel avatar, or the other participant's avatar for a direct message. */
@@ -35,7 +38,13 @@ export function ChannelTopIcon(props: ChannelTopIconProps) {
}
>
{(recipient) => (
- <UserIcon id={recipient().user_id} isDeleted={false} size="sm" />
+ <UserIcon
+ id={recipient().user_id}
+ isDeleted={false}
+ size="sm"
+ suppressClick={props.suppressClick}
+ showTooltip={props.suppressClick ? false : undefined}
+ />
)}
</Show>
}
@@ -51,3 +60,26 @@ export function ChannelTopIcon(props: ChannelTopIconProps) {
</Show>
);
}
+
+/** Resolve conversation identity for headers and navigation breadcrumbs. */
+export function ChannelTitleIcon(props: {
+ channelId: string;
+ suppressClick?: boolean;
+}) {
+ return (
+ <Show when={props.channelId} keyed>
+ {(channelId) => {
+ const channelType = useChannelType(channelId);
+ const participants = useChannelParticipantsQuery(() => channelId);
+ return (
+ <ChannelTopIcon
+ channelId={channelId}
+ channelType={channelType()}
+ participants={queryReadyGate(participants) ? participants.data : []}
+ suppressClick={props.suppressClick}
+ />
+ );
+ }}
+ </Show>
+ );
+}
diff --git a/apps/web/src/features/home/components/HomeEntityDetailRouteView.tsx b/apps/web/src/features/home/components/HomeEntityDetailRouteView.tsx
index 0e7ab7638d..75973ffcbc 100644
--- a/apps/web/src/features/home/components/HomeEntityDetailRouteView.tsx
+++ b/apps/web/src/features/home/components/HomeEntityDetailRouteView.tsx
@@ -12,6 +12,7 @@ import { useMarkdownName } from '@block-md/component/MarkdownNameProvider';
import { useMarkdownDocumentTools } from '@block-md/component/useMarkdownDocumentTools';
import { useMarkdownDocument } from '@block-md/context/markdown-document-context';
import { ChannelDetailTopBar } from '@channel/Channel/ChannelDetail';
+import { ChannelTitleIcon } from '@channel/components/ChannelTopIcon';
import { useGlobalBlockOrchestrator } from '@components/app/GlobalAppState';
import { PreviewPanel } from '@components/app/PreviewPanel';
import type { PreviewBlockTarget } from '@components/app/previewTarget';
@@ -69,11 +70,22 @@ function HomeEntityBreadcrumb(props: {
onClick={item.onSelect}
tooltip={props.name()}
>
- <EntityIcon
- targetType={entityDetailBlockType(props.target) ?? 'channel'}
- size="xs"
- class="shrink-0"
- />
+ <Show
+ when={
+ props.target.type === 'channel' ? props.target.id : undefined
+ }
+ fallback={
+ <EntityIcon
+ targetType={entityDetailBlockType(props.target) ?? 'unknown'}
+ size="xs"
+ class="shrink-0"
+ />
+ }
+ >
+ {(channelId) => (
+ <ChannelTitleIcon channelId={channelId()} suppressClick />
+ )}
+ </Show>
<span class="truncate">{props.name()}</span>
</ViewBreadcrumbs.Button>
<Show when={props.fileMenu}>
diff --git a/docs/agent-guide/channels.md b/docs/agent-guide/channels.md
index cdd72dc6d2..95f5bd0944 100644
--- a/docs/agent-guide/channels.md
+++ b/docs/agent-guide/channels.md
@@ -9,6 +9,11 @@ the message text, including link labels and mention names, once per preview.
Verify wide and narrow rows and channel/thread cards; links and mentions remain
interactive inside the opened conversation.
+Conversation headers and shared detail breadcrumbs use the same identity icon:
+the recipient for human DMs, the persona for agent DMs, and the channel picture
+or glyph for named channels. Message and thread breadcrumbs resolve identity
+from their parent channel rather than the message or thread ID.
+
## Message links
Bare URLs, common bare domains, and email addresses are clickable in opened
diff --git a/docs/agent-guide/home.md b/docs/agent-guide/home.md
index 7014593d2d..66ab4c20af 100644
--- a/docs/agent-guide/home.md
+++ b/docs/agent-guide/home.md
@@ -159,6 +159,14 @@ the **Home >** return breadcrumb added. Calendar shares its date, search,
navigation, view, and New controls; email shares its action, navigation, AI/task,
and Share groups. Touch previews retain their existing compact headers.
+Conversation breadcrumbs preserve identity: human DMs show the other participant's
+avatar, agent DMs show the persona avatar, and named channels show their picture
+or the channel glyph. Verify switching between these entries without reloading,
+including a reply-thread entry and a direct Home URL reload. Clicking an avatar
+inside a breadcrumb must select that breadcrumb, not open another DM.
+
+![Home DM breadcrumb with its participant avatar](images/home-conversation-identity.png)
+
Document previews opened from Home expose **Share** and **Copy Share Link** before
the details toggle, including tasks, snippets, skills, canvases, PDFs, images,
code, and videos. Share uses the selected item's permissions and updates when
diff --git a/docs/agent-guide/images/home-conversation-identity.png b/docs/agent-guide/images/home-conversation-identity.png
new file mode 100644
index 0000000000..6431b85838
Binary files /dev/null and b/docs/agent-guide/images/home-conversation-identity.png differ