Skip to content

Attribute channel task rows to the human who started them#3548

Merged
trunk-io[bot] merged 6 commits into
mainfrom
posthog-code/channel-feed-human-sender
Jul 20, 2026
Merged

Attribute channel task rows to the human who started them#3548
trunk-io[bot] merged 6 commits into
mainfrom
posthog-code/channel-feed-human-sender

Conversation

@adboio

@adboio adboio commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Problem

channel feeds are hard to scan because every message looks basically the same

Screenshot 2026-07-17 at 4.08.28 PM.png

Changes

make the actual task author show up as the sender, when the task is human-initiated from within the app

How did you test this?

manually

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

Channel feed task rows rendered every message as "PostHog" with a robot
avatar and an "Agent" badge, then repeated the starter's name inline in the
body ("@name started a new task"). This made the feed hard to scan and
misattributed human-initiated tasks to the agent.

Channel-started tasks (origin_product === "user_created") now show the
starter as the sender: their initials in the avatar, their display name as
the author, no "Agent" badge, and a plain "started a new task" body. Tasks
from other origins (Slack, automations) keep the agent attribution so
genuine agent-authored messages remain distinguishable at a glance.

Mirrors the existing SystemFeedRow author-vs-agent pattern in the same file.

Generated-By: PostHog Code
Task-Id: 4b3b11b7-5066-448f-a721-fe8532ce15d1
@trunk-io

trunk-io Bot commented Jul 17, 2026

Copy link
Copy Markdown

😎 Merged successfully - details.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 58672bb.

Extract the pure presentational TaskFeedRow (avatar + attribution header +
body) out of FeedItem so it can be storied; the data-fetching TaskCard and
ReplyFooter stay in the FeedItem container and are passed in as children.

Adds ChannelFeedView.stories.tsx covering the attribution states so the
human-vs-agent sender rendering is easy to validate: human-started,
human-with-email-only (initials/name fallback), non-user origin (stays
agent-attributed), and user_created with no starter.

Generated-By: PostHog Code
Task-Id: 4b3b11b7-5066-448f-a721-fe8532ce15d1
@posthog

posthog Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Visual changes approved by @adboio — baseline updated in 58672bb.

View this run in PostHog

12 new.

adboio added 2 commits July 17, 2026 14:10
The AgentOrigin story's task() call exceeded the line width; wrap it so
`biome check` (the CI quality gate, which runs the formatter) passes.

Generated-By: PostHog Code
Task-Id: 4b3b11b7-5066-448f-a721-fe8532ce15d1
Remove the doc comments I introduced on channelTaskStarter and TaskFeedRow,
and all comments in the new story file, keeping only the pre-existing
"Replying now lives" comment that predates this change.

Generated-By: PostHog Code
Task-Id: 4b3b11b7-5066-448f-a721-fe8532ce15d1
@adboio
adboio requested review from a team, adamleithp and k11kirky July 17, 2026 20:12
adboio and others added 2 commits July 17, 2026 16:24
Instead of the generic "started a new task" body, feed rows now show a
two-line preview of the user's original prompt (task.description, run through
xmlToPlainText to resolve chip tags), matching how the optimistic pending row
already previews the prompt. Falls back to the prior text when a task has no
description.

Adds LongPrompt and NoPrompt stories to cover truncation and the fallback.

Generated-By: PostHog Code
Task-Id: 4b3b11b7-5066-448f-a721-fe8532ce15d1
12 updated
Run: 3d040bb6-1c65-415b-8860-4c73932ce6b8

Co-authored-by: adboio <23323033+adboio@users.noreply.github.com>
@adboio
adboio marked this pull request as ready for review July 20, 2026 13:50
@greptile-apps

greptile-apps Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "chore(visual): update storybook baseline..." | Re-trigger Greptile

Comment on lines +452 to +454
{starter ? userDisplayName(starter) : "PostHog"}
</ThreadItemAuthor>
{!starter && <Badge variant="info">Agent</Badge>}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Missing Creator Changes Task Origin

When a user_created task has no created_by value, starter becomes null and the row labels it as a PostHog agent task. Deleted users, imported tasks, or incomplete API records can therefore turn a human-origin task into an agent-origin message instead of showing an unknown human fallback.

@adboio adboio added the Stamphog This will request an autostamp by stamphog on small changes label Jul 20, 2026 — with Graphite App

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pure UI refactor in the canvas channel feed — adds human attribution for user-created tasks, extracts a testable TaskFeedRow component, and backs it with a full Storybook story suite including a NoStarter story that explicitly covers the null created_by edge case the bot raised. No crashes, data loss, API contract changes, or security issues.

@trunk-io
trunk-io Bot merged commit d55d24e into main Jul 20, 2026
35 checks passed
@trunk-io
trunk-io Bot deleted the posthog-code/channel-feed-human-sender branch July 20, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stamphog This will request an autostamp by stamphog on small changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant