Skip to content

Commit f377ae9

Browse files
authored
Add share button to channel feed task messages (#3730)
1 parent e7d8d13 commit f377ae9

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

packages/ui/src/features/canvas/components/ChannelFeedView.tsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
ArrowSquareOutIcon,
33
ChatCircleIcon,
44
GitBranchIcon,
5+
LinkIcon,
56
RobotIcon,
67
} from "@phosphor-icons/react";
78
import { taskFeedRunStatus } from "@posthog/core/canvas/channelFeed";
@@ -49,6 +50,7 @@ import type { ChannelFeedSystemMessage } from "@posthog/ui/features/canvas/hooks
4950
import { useChannelTaskData } from "@posthog/ui/features/canvas/hooks/useChannelTaskData";
5051
import { useTaskThread } from "@posthog/ui/features/canvas/hooks/useTaskThread";
5152
import { taskCardNavigation } from "@posthog/ui/features/canvas/taskCardNavigation";
53+
import { copyChannelLink } from "@posthog/ui/features/canvas/utils/copyChannelLink";
5254
import { userDisplayName } from "@posthog/ui/features/canvas/utils/userDisplay";
5355
import {
5456
type SidebarPrState,
@@ -534,11 +536,19 @@ const FeedItem = memo(function FeedItem({
534536
task={task}
535537
actions={
536538
// Replying now lives in the always-visible ReplyFooter, so the hover
537-
// toolbar only carries the distinct "Open task" action. Actions anchor
538-
// to the row's top-right corner; a top tooltip there overhangs the panel
539-
// edge and gets clipped by the scroll container, so open tooltips toward
540-
// the content instead.
539+
// toolbar only carries per-row actions (copy link, open task). Actions
540+
// anchor to the row's top-right corner; a top tooltip there overhangs
541+
// the panel edge and gets clipped by the scroll container, so open
542+
// tooltips toward the content instead.
541543
<ThreadItemActions aria-label="Message actions" className="inset-bs-2">
544+
<ThreadItemAction
545+
label="Copy link to task"
546+
onClick={() =>
547+
void copyChannelLink(channelId, "thread_panel", task.id)
548+
}
549+
>
550+
<LinkIcon size={15} />
551+
</ThreadItemAction>
542552
<ThreadItemAction label="Open task" onClick={() => onOpenTask(task)}>
543553
<ArrowSquareOutIcon size={15} />
544554
</ThreadItemAction>

0 commit comments

Comments
 (0)