Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion desktop/src/features/channels/ui/ChannelPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,6 @@ export const ChannelPane = React.memo(function ChannelPane({
) : null}
<ComposerDockBackdrop gutterClassName="inset-x-5" />
<MessageComposer
audienceContext={{ type: "channel" }}
channelId={activeChannel?.id ?? null}
channelName={activeChannel?.name ?? "channel"}
channelType={activeChannel?.channelType ?? null}
Expand Down
13 changes: 12 additions & 1 deletion desktop/src/features/home/ui/InboxDetailPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,10 @@ function InboxMessageDetailPane({
: null;
const isThreadContext =
!isDirectMessage && hasInboxThreadContext(item, messages);
const threadRootTags = isThreadContext
? (displayMessages.find((message) => message.id === item.conversationId)
?.tags ?? [])
: [];
const contextLabel = isThreadContext
? isDirectMessage
? `Thread with ${item.senderLabel}`
Expand Down Expand Up @@ -804,7 +808,14 @@ function InboxMessageDetailPane({
/>
<div className="pointer-events-auto">
<MessageComposer
audienceContext={isDirectMessage ? null : { type: "thread" }}
audienceContext={
isDirectMessage
? null
: {
type: "thread",
rootTags: threadRootTags,
}
}
channelId={item.item.channelId}
channelName={item.channelLabel ?? "channel"}
channelType={composerChannelType}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ test("mention control expands with automatically mentioned agents", async () =>
const avatar = view.getByTestId("composer-address-lock-agent-pubkey");
assert.ok(avatar);
const manage = view.getByRole("button", {
name: "Manage automatic agent mentions",
name: "Manage mentions",
});
assert.match(manage.className, /(?:^|\s)-ml-2(?:\s|$)/);
assert.match(manage.className, /(?:^|\s)pl-2(?:\s|$)/);
Expand All @@ -82,18 +82,18 @@ test("mention control expands with automatically mentioned agents", async () =>
/(?:^|\s)pr-1\.5(?:\s|$)/,
);
assert.match(
view.getByRole("button", { name: "Manage automatic agent mentions" })
.parentElement?.className ?? "",
view.getByRole("button", { name: "Manage mentions" }).parentElement
?.className ?? "",
/(?:^|\s)bg-primary\/15(?:\s|$)/,
);
assert.match(
view.getByRole("button", { name: "Manage automatic agent mentions" })
.parentElement?.className ?? "",
view.getByRole("button", { name: "Manage mentions" }).parentElement
?.className ?? "",
/(?:^|\s)text-primary(?:\s|$)/,
);
assert.doesNotMatch(
view.getByRole("button", { name: "Manage automatic agent mentions" })
.parentElement?.className ?? "",
view.getByRole("button", { name: "Manage mentions" }).parentElement
?.className ?? "",
/(?:^|\s)bg-accent\/70(?:\s|$)/,
);
assert.doesNotMatch(
Expand Down
10 changes: 2 additions & 8 deletions desktop/src/features/messages/ui/ComposerAddressControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,7 @@ export function ComposerMentionButton({
<Tooltip disableHoverableContent>
<TooltipTrigger asChild>
<button
aria-label={
hasAgents
? "Manage automatic agent mentions"
: "Mention someone"
}
aria-label={hasAgents ? "Manage mentions" : "Mention someone"}
className={cn(
"flex h-8 items-center justify-center rounded-lg focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
showActiveChrome
Expand All @@ -205,9 +201,7 @@ export function ComposerMentionButton({
</button>
</TooltipTrigger>
<TooltipContent>
{hasAgents
? "Manage automatic agent mentions"
: "Mention someone"}
{hasAgents ? "Manage mentions" : "Mention someone"}
</TooltipContent>
</Tooltip>
<AnimatePresence
Expand Down
Loading
Loading