feat(channels): add thread @-mentions and an Activity page#3158
Merged
Conversation
|
React Doctor found 1 issue in 1 file · 1 warning. 1 warning
Reviewed by React Doctor for commit |
Contributor
|
Reviews (1): Last reviewed commit: "feat(channels): add thread @-mentions an..." | Re-trigger Greptile |
2 tasks
d912d55 to
727d133
Compare
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
Contributor
|
Reviews (2): Last reviewed commit: "Extract folder-channel id lookup into a ..." | Re-trigger Greptile |
Thread composers in the Channels space get an @-mention typeahead over the org's members; mentions are stored as inline @[Name](email) tokens in the message content, so no message schema change is needed. A new Activity page (nav item with unread badge in the channels sidebar) lists mentions of the viewer across channel threads, derived client-side from the task feeds and threads already polled, and opens the thread via the channel deep-link route. Generated-By: PostHog Code Task-Id: a2ff8500-aaa6-4ce0-b01a-656d3b2c3b61
…mposer applyMention now replaces the whole @word (caret moved backward mid-query no longer leaks typed characters into the message) and reuses an existing following space instead of doubling it. MentionComposer drops its state-sync effects for ref-guarded render-time adjustments and scrolls in the key handler, clearing react-doctor's no-adjust-state-on-prop-change errors. MentionText keys segments by character offset instead of array index. Generated-By: PostHog Code Task-Id: a2ff8500-aaa6-4ce0-b01a-656d3b2c3b61
Generated-By: PostHog Code Task-Id: a2ff8500-aaa6-4ce0-b01a-656d3b2c3b61
a766a20 to
56cc7ff
Compare
adamleithp
approved these changes
Jul 7, 2026
CodeQL flagged js/polynomial-redos on MENTION_PATTERN: with `@` allowed on both sides of the email separator, an unterminated token like `@[Z](!@!@…` backtracks quadratically. Excluding `@` from both character classes makes the separator position unambiguous and the scan linear; real emails carry exactly one `@`, so no valid token changes meaning. Adds a malformed double-@ case and a linear-time regression test over a 100k-char adversarial input. Generated-By: PostHog Code Task-Id: a2ff8500-aaa6-4ce0-b01a-656d3b2c3b61
…ementally A branch rewind dropped the earlier "replace mention fan-out with backend index" work, leaving useMentionActivity back on the per-channel/per-task client-side scan it was meant to replace. This restores the backend-indexed version (getTaskMentions against /task_mentions/, mentionActivity reduced to a DTO-to-item mapper, ActivityView resolving desktop folder-channel ids itself) and folds in the fix identified in review: repolls now track the newest cached mention's created_at and ask the backend only for what's new via since, merging (dedupe by message, capped at 300) into the existing cache, instead of refetching the whole top page every 60s. Generated-By: PostHog Code Task-Id: 873b03f3-dd0b-4cee-ac3d-c3766520382a
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Note
Stacked on #3157 (channel/thread deep links) — review that first; this PR targets its branch and reuses its thread deep-link routing.
The mentions feed is served by a new backend index — PostHog/posthog#68853 must deploy first. Until it does, the Activity page shows an empty state (acceptable for a pre-GA surface behind the
project-bluebirdflag).Problem
Channel threads (project-bluebird) are multiplayer, but there's no way to pull a teammate into one — you can't @-tag anyone, and nothing tells you a thread needs your attention.
Why
Requested for Bluebird channels: tag any member of your org in a thread and have them see the notification in a new Activity page in the top-left nav, built on the deep links from #3157.
Changes
@in a thread's "Reply in thread…" box opens a typeahead over the org's members (new/api/organizations/@current/members/client call). Selecting one inserts an inline@[Name](email)token, so mentions ride in existing message content; older clients degrade to readable text. Mentions render as highlighted chips, with a stronger highlight when it's you./website/activityroute plus an Activity item (with unread red-dot badge) in the channels sidebar nav. It lists thread messages across all channels that mention you, newest first; clicking one opens the thread through the channel deep-link route from feat(channels): add shareable deep links for channels and threads #3157, and each row offers the shareable thread link via the same copy-link helper.useMentionActivitywraps exactly onegetTaskMentions()query against the newGET /task_mentions/endpoint (AGENTS.md Rule 5). An earlier iteration on this branch assembled the feed client-side by scanning every channel's task feeds and threads; that fan-out and its mention-matching helpers are deleted, andmentionActivityin core is reduced to a DTO→item mapper.ActivityViewresolves desktop folder-channel ids itself (same caller-owns-the-subscription precedent asuseTaskChannelMap).Channel action(mention_member,view_activity,open_mention,nav_click). Everything lives inside the Channels space, which is gated by theproject-bluebirdflag at the route.How did you test this?
getTaskMentionsclient shape (api-client).pnpm typecheck(22/22), Biome clean, knip shows no new dead exports.Automatic notifications
Created with PostHog Code