-
Notifications
You must be signed in to change notification settings - Fork 60
Attribute channel task rows to the human who started them #3548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
13322a1
Attribute channel task rows to the human who started them
adboio d0b8bc7
Add Storybook story for channel task feed row
adboio abd493c
Format story file to satisfy Biome
adboio eaeb807
Drop explanatory comments added in this PR
adboio 6a879c8
Show a truncated prompt preview in channel feed rows
adboio 58672bb
chore(visual): update storybook baselines
posthog[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 111 additions & 0 deletions
111
packages/ui/src/features/canvas/components/ChannelFeedView.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| import type { Task, UserBasic } from "@posthog/shared/domain-types"; | ||
| import type { Meta, StoryObj } from "@storybook/react-vite"; | ||
| import { TaskFeedRow } from "./ChannelFeedView"; | ||
|
|
||
| function MockTaskCard({ title }: { title: string }) { | ||
| return ( | ||
| <div className="mt-1.5 rounded-sm border border-border-primary px-3 py-2.5"> | ||
| <div className="flex items-center justify-between gap-2"> | ||
| <span className="font-medium text-sm">{title}</span> | ||
| <span className="rounded-full bg-fill-secondary px-2 py-0.5 text-muted-foreground text-xs"> | ||
| Ready | ||
| </span> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| const user = (overrides: Partial<UserBasic> = {}): UserBasic => ({ | ||
| id: 1, | ||
| uuid: "user-1", | ||
| email: "adam@posthog.com", | ||
| first_name: "Adam", | ||
| last_name: "Bowker", | ||
| ...overrides, | ||
| }); | ||
|
|
||
| const task = (overrides: Partial<Task> = {}): Task => ({ | ||
| id: "task-1", | ||
| task_number: 1, | ||
| slug: "task-1", | ||
| title: "Add feedback modal to channels view", | ||
| description: | ||
| "Add a feedback modal to the channels view so people can share thoughts without leaving the feed", | ||
| created_at: "2026-07-17T12:00:00.000Z", | ||
| updated_at: "2026-07-17T12:00:00.000Z", | ||
| origin_product: "user_created", | ||
| created_by: user(), | ||
| ...overrides, | ||
| }); | ||
|
|
||
| const meta: Meta<typeof TaskFeedRow> = { | ||
| title: "Channels/TaskFeedRow", | ||
| component: TaskFeedRow, | ||
| decorators: [ | ||
| (Story) => ( | ||
| <div className="max-w-xl"> | ||
| <Story /> | ||
| </div> | ||
| ), | ||
| ], | ||
| }; | ||
|
|
||
| export default meta; | ||
| type Story = StoryObj<typeof TaskFeedRow>; | ||
|
|
||
| export const HumanStarted: Story = { | ||
| args: { | ||
| task: task(), | ||
| children: <MockTaskCard title="Add feedback modal to channels view" />, | ||
| }, | ||
| }; | ||
|
|
||
| export const HumanEmailOnly: Story = { | ||
| args: { | ||
| task: task({ | ||
| created_by: user({ first_name: undefined, last_name: undefined }), | ||
| title: "Make background color configurable", | ||
| description: "Make the channel background color configurable in settings", | ||
| }), | ||
| children: <MockTaskCard title="Make background color configurable" />, | ||
| }, | ||
| }; | ||
|
|
||
| export const AgentOrigin: Story = { | ||
| args: { | ||
| task: task({ | ||
| origin_product: "slack", | ||
| title: "Investigate signup drop-off", | ||
| description: "Investigate the signup drop-off we saw over the weekend", | ||
| }), | ||
| children: <MockTaskCard title="Investigate signup drop-off" />, | ||
| }, | ||
| }; | ||
|
|
||
| export const LongPrompt: Story = { | ||
| args: { | ||
| task: task({ | ||
| description: | ||
| "Rework the channel feed so each row reads as the person who started the task rather than the agent, show a preview of their prompt under the header, keep the task card below, and make sure long prompts truncate cleanly instead of pushing the card down the feed", | ||
| }), | ||
| children: <MockTaskCard title="Rework the channel feed attribution" />, | ||
| }, | ||
| }; | ||
|
|
||
| export const NoPrompt: Story = { | ||
| args: { | ||
| task: task({ description: "", title: "Untitled task" }), | ||
| children: <MockTaskCard title="Untitled task" />, | ||
| }, | ||
| }; | ||
|
|
||
| export const NoStarter: Story = { | ||
| args: { | ||
| task: task({ | ||
| created_by: null, | ||
| title: "Untitled task", | ||
| description: "Summarize this week's shipped changes", | ||
| }), | ||
| children: <MockTaskCard title="Summarize this week's shipped changes" />, | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a
user_createdtask has nocreated_byvalue,starterbecomes 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.