Skip to content

feat(inbox): edit suggested reviewers from the report detail pane#2481

Merged
oliverb123 merged 4 commits into
mainfrom
posthog-code/inbox-edit-suggested-reviewers
Jun 4, 2026
Merged

feat(inbox): edit suggested reviewers from the report detail pane#2481
oliverb123 merged 4 commits into
mainfrom
posthog-code/inbox-edit-suggested-reviewers

Conversation

@oliverb123
Copy link
Copy Markdown
Contributor

@oliverb123 oliverb123 commented Jun 4, 2026

2026-06-04 12 22 19

Surfaces UI for the suggested-reviewers PUT API (PostHog#59357) in the
inbox detail pane. Adds a SuggestedReviewersEditor with an "Add" picker
(org members, filtered locally over the cached available-reviewers list)
and per-row removal. Each add/remove persists immediately via a
full-replacement PUT with optimistic cache patching.

- New client method updateSignalReportArtefact + write-entry type
- useUpdateSuggestedReviewers optimistic mutation hook
- Section renders whenever a suggested_reviewers artefact exists so an
  emptied list keeps the Add entry point; gated out when absent
- Two new analytics action types

Generated-By: PostHog Code
Task-Id: f961c44f-0c0b-4bff-ab85-b533bf1856ce
- Toast on PUT failure to match sibling mutation hooks (silent
  rollback was inconsistent with useCreatePrReport / bulk actions)
- Fix picker spinner gate: show "No users found" rather than a
  spinner when a non-matching filter coincides with a background
  refetch (gate on base-list presence, not filtered length)

Generated-By: PostHog Code
Task-Id: f961c44f-0c0b-4bff-ab85-b533bf1856ce
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 4, 2026

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/code/src/renderer/api/posthogClient.test.ts:408-480
**Two success-path cases that could be parameterised**

The project rule states we always prefer parameterised tests. The "PUTs the full-replacement content" and "sends an empty content array when clearing reviewers" cases share identical structure (mock an `ok` response → call `updateSignalReportArtefact` → assert `result.content` and the outgoing `fetch` body). They differ only in the input `content` array and the expected `result.content`. Collapsing them into a single `it.each` block removes the duplicated `makeClient` / mock setup.

Reviews (1): Last reviewed commit: "refactor(inbox): polish suggested-review..." | Re-trigger Greptile

Comment thread apps/code/src/renderer/api/posthogClient.test.ts Outdated
Collapse the two structurally-identical success-path cases into an
it.each block per the project's parameterised-test preference
(Greptile review).

Generated-By: PostHog Code
Task-Id: f961c44f-0c0b-4bff-ab85-b533bf1856ce
Copy link
Copy Markdown
Member

@andrewm4894 andrewm4894 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qq - do we have events for trackign how often and when users are making the changes to reviewers?

easy to add later if not

The add/remove/click suggested-reviewer actions already fire the shared
INBOX_REPORT_ACTION event (with report_id). Attach the target reviewer's
github_login and user uuid so the events capture which reviewer changed,
following the existing optional-extras pattern (signal_id, why_field).

Generated-By: PostHog Code
Task-Id: f961c44f-0c0b-4bff-ab85-b533bf1856ce
@oliverb123
Copy link
Copy Markdown
Contributor Author

@andrewm4894 adding then merging 🫡

@oliverb123 oliverb123 enabled auto-merge (squash) June 4, 2026 09:42
@oliverb123 oliverb123 merged commit 4feabd5 into main Jun 4, 2026
18 checks passed
@oliverb123 oliverb123 deleted the posthog-code/inbox-edit-suggested-reviewers branch June 4, 2026 09:49
Gilbert09 added a commit that referenced this pull request Jun 4, 2026
…2481)

Makes the suggested reviewers on an inbox signal report editable from the
report detail screen, porting desktop PR #2481 to the mobile app.

- New `updateSignalReportArtefact` API method (PUT-replaces artefact content).
- New `useUpdateSuggestedReviewers` mutation hook with an optimistic
  full-replacement update that patches the cached artefacts and reconciles
  with server-canonicalized data on settle.
- `SuggestedReviewers` becomes editable: removable reviewer chips plus an
  "Add" affordance opening a searchable picker (`EditReviewersSheet`) over the
  org's available reviewers.
- Extracted a shared `ReviewerOptionRow` reused by the add picker and the
  existing `ReviewerFilterSheet`, and shared reviewer-option / write-shape
  helpers in `utils.ts`.
- Fires `add_suggested_reviewer` / `remove_suggested_reviewer` analytics with
  `suggested_reviewer_login` / `suggested_reviewer_uuid`.
- Unit tests for the write-shape mapping and reviewer matching helpers.

Generated-By: PostHog Code
Task-Id: a3560a8b-5ba2-46b2-bfe5-d0a9f93db8e2
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.

2 participants