Skip to content

feat: name the task a comment belongs to so mentions reach its feed - #4036

Closed
puemos wants to merge 1 commit into
feat/artifact-commentsfrom
posthog-code/comment-task-id
Closed

feat: name the task a comment belongs to so mentions reach its feed#4036
puemos wants to merge 1 commit into
feat/artifact-commentsfrom
posthog-code/comment-task-id

Conversation

@puemos

@puemos puemos commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Why

A comment on an artifact or canvas points at an id that lives in a run's JSON, not in a table the server can join against, so the backend had no way to work out which task the comment belonged to. Mentions on those comments reached people by email and the web inbox but never by this app's Activity page — the one surface where the comment is actually readable.

Changes

The task id now rides along in item_context (declared on commentContextSchema, which strips unknown keys, so it has to be part of the schema to survive a round-trip). useCreateComment takes the task id and merges it in at the single choke point all three call sites go through, so the optimistic row and the request agree.

It is client-supplied, so the backend checks it against the team before acting on it and re-checks visibility when the feed is read.

Stacked on feat/artifact-comments (#3970). Pairs with PostHog/posthog#75910, which consumes it — this is inert until that lands, since item_context is free-form JSON.

Testing

TaskCommentsList and ArtifactPreview suites pass (39 tests), typecheck and lint clean on @posthog/ui and @posthog/core. No manual testing — no running app in this environment. The behaviour this enables is only observable once the backend side is deployed.


Created with PostHog Code

A comment on an artifact or canvas points at an id that lives in a run's JSON, not in a
table the server can join against, so nothing on the backend could work out which task the
comment belonged to. Mentions on those comments therefore reached people by email and by
the web inbox but never by this app's Activity page — the one surface where the comment is
actually readable.

The task id now rides along in item_context, which is the only piece the server was
missing. It is client-supplied, so the backend checks it against the team before acting on
it, and re-checks visibility when the feed is read.

Needs the matching PostHog/posthog change to have any effect; harmless before it lands,
since item_context is a free-form JSON field.


Generated-By: PostHog Code
Task-Id: ec8afa68-0d3b-417a-b9aa-4804b7429d76
@github-actions

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit a49bd9b.

puemos commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Folding this into #3970 — it belongs with the rest of the artifact-comments work, no reason for a separate PR.

@puemos puemos closed this Jul 31, 2026
@puemos
puemos deleted the posthog-code/comment-task-id branch July 31, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant