feat(inbox): edit suggested reviewers from the report detail pane#2481
Merged
Conversation
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
Contributor
Prompt To Fix All With AIFix 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 |
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
andrewm4894
approved these changes
Jun 4, 2026
andrewm4894
approved these changes
Jun 4, 2026
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
Contributor
Author
|
@andrewm4894 adding then merging 🫡 |
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
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.
Uh oh!
There was an error while loading. Please reload this page.