From 21923d19d72a2dd2814bea1c98434f0ea4043658 Mon Sep 17 00:00:00 2001
From: Rafael Audibert <32079912+rafaeelaudibert@users.noreply.github.com>
Date: Tue, 28 Jul 2026 15:11:40 -0300
Subject: [PATCH 1/2] feat(inbox): bulk-remove yourself as a suggested reviewer
Adds a "Remove me as reviewer" action to the inbox bulk-selection toolbar so
you can drop yourself as a suggested reviewer across many reports at once,
instead of opening each report and removing yourself one at a time.
The action reuses the existing per-item bulk fan-out (Promise.allSettled with
partial-failure tolerance): per selected report it fetches the latest
suggested_reviewers artefact, filters out the current user's entry, and writes
the remaining list back. Eligibility is driven by the server-annotated
is_suggested_reviewer flag so the button disables when no selected report lists
you. Fires one INBOX_REPORT_ACTION (remove_suggested_reviewer) per succeeded
report.
Generated-By: PostHog Code
Task-Id: 869023f3-9853-4f11-a433-6ea896c1c32f
---
packages/core/src/inbox/engagement.test.ts | 13 ++
packages/core/src/inbox/engagement.ts | 7 +-
.../components/InboxBulkSelectionBar.tsx | 19 +++
.../inbox/hooks/useInboxBulkActions.ts | 123 +++++++++++++++++-
4 files changed, 156 insertions(+), 6 deletions(-)
diff --git a/packages/core/src/inbox/engagement.test.ts b/packages/core/src/inbox/engagement.test.ts
index 4256dced8f..f880ace30c 100644
--- a/packages/core/src/inbox/engagement.test.ts
+++ b/packages/core/src/inbox/engagement.test.ts
@@ -65,6 +65,19 @@ describe("buildBulkActionEvents", () => {
expect(events.every((e) => e.action_type === "delete")).toBe(true);
});
+ it("passes through the remove-suggested-reviewer action type", () => {
+ const events = buildBulkActionEvents({
+ reports: [fakeReport({ id: "a" }), fakeReport({ id: "b" })],
+ actionType: "remove_suggested_reviewer",
+ surface: "toolbar",
+ });
+
+ expect(
+ events.every((e) => e.action_type === "remove_suggested_reviewer"),
+ ).toBe(true);
+ expect(events.every((e) => e.dismissal_reason === undefined)).toBe(true);
+ });
+
it("attaches dismissal reason/note only for dismiss, truncating the note", () => {
const longNote = "x".repeat(600);
const [dismissed] = buildBulkActionEvents({
diff --git a/packages/core/src/inbox/engagement.ts b/packages/core/src/inbox/engagement.ts
index bb31915e35..dc4428ddbb 100644
--- a/packages/core/src/inbox/engagement.ts
+++ b/packages/core/src/inbox/engagement.ts
@@ -123,7 +123,7 @@ export function resolveActionProperties(
/** Bulk-capable report actions fired from the selection toolbar / dismiss flows. */
export type InboxBulkActionType = Extract<
InboxReportActionProperties["action_type"],
- "dismiss" | "snooze" | "delete" | "reingest"
+ "dismiss" | "snooze" | "delete" | "reingest" | "remove_suggested_reviewer"
>;
export interface BuildBulkActionEventsInput {
@@ -137,8 +137,9 @@ export interface BuildBulkActionEventsInput {
/**
* Build `INBOX_REPORT_ACTION` payloads for a bulk (or single-report) dismiss /
- * snooze / delete / reingest. Pure so it can be unit-tested and reused across
- * the toolbar, the per-row dismiss action, and detail-screen dismiss.
+ * snooze / delete / reingest / remove-suggested-reviewer. Pure so it can be
+ * unit-tested and reused across the toolbar, the per-row dismiss action, and
+ * detail-screen dismiss.
*
* `is_bulk` / `bulk_size` carry the grouping; `rank` / `list_size` are left at 0
* because these flows act on a selection, not a positional list slot.
diff --git a/packages/ui/src/features/inbox/components/InboxBulkSelectionBar.tsx b/packages/ui/src/features/inbox/components/InboxBulkSelectionBar.tsx
index 263b2b5d4b..9a6e96e28b 100644
--- a/packages/ui/src/features/inbox/components/InboxBulkSelectionBar.tsx
+++ b/packages/ui/src/features/inbox/components/InboxBulkSelectionBar.tsx
@@ -3,6 +3,7 @@ import {
EyeSlashIcon,
PauseIcon,
TrashIcon,
+ UserMinusIcon,
XIcon,
} from "@phosphor-icons/react";
import { isDismissalReasonSnooze } from "@posthog/shared/dismissalReasons";
@@ -158,6 +159,24 @@ export function InboxBulkSelectionBar({
Reingest
+
+