Skip to content

Commit 4843a4f

Browse files
authored
Replace mention fan-out with backend mentions index
useMentionActivity now wraps a single getTaskMentions query against the new task_mentions endpoint; the per-channel/per-task thread scan, its mention-matching helpers, and the plan file are deleted. mentionActivity in core is reduced to a DTO-to-item mapper (countUnseenActivity unchanged), and ActivityView resolves desktop folder-channel ids itself. Generated-By: PostHog Code Task-Id: 47e3ad2f-36c4-4d54-ae0c-07923d306818
1 parent d3855dc commit 4843a4f

11 files changed

Lines changed: 164 additions & 503 deletions

File tree

docs/plans/mention-activity-backend-index.md

Lines changed: 0 additions & 176 deletions
This file was deleted.

packages/api-client/src/posthog-client.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ import type {
7373
SuggestedReviewerWriteEntry,
7474
Task,
7575
TaskChannel,
76+
TaskMention,
7677
TaskRun,
7778
TaskRunArtefact,
7879
TaskThreadMessage,
@@ -2303,6 +2304,25 @@ export class PostHogAPIClient {
23032304
return (await response.json()) as TaskChannel;
23042305
}
23052306

2307+
// Mentions of the current user across task threads, newest first.
2308+
async getTaskMentions(options?: { since?: string }): Promise<TaskMention[]> {
2309+
const teamId = await this.getTeamId();
2310+
const urlPath = `/api/projects/${teamId}/task_mentions/`;
2311+
const url = new URL(`${this.api.baseUrl}${urlPath}`);
2312+
if (options?.since) {
2313+
url.searchParams.set("since", options.since);
2314+
}
2315+
const response = await this.api.fetcher.fetch({
2316+
method: "get",
2317+
url,
2318+
path: urlPath,
2319+
});
2320+
if (!response.ok) {
2321+
throw new Error(`Failed to fetch task mentions: ${response.statusText}`);
2322+
}
2323+
return (await response.json()) as TaskMention[];
2324+
}
2325+
23062326
async getTaskThreadMessages(taskId: string): Promise<TaskThreadMessage[]> {
23072327
const teamId = await this.getTeamId();
23082328
const urlPath = `/api/projects/${teamId}/tasks/${taskId}/thread_messages/`;

0 commit comments

Comments
 (0)