Skip to content

feat(mobile): highlight and surface current user in suggested reviewers (port #2435)#2449

Merged
charlesvien merged 3 commits into
mainfrom
posthog-code/mobile-highlight-current-reviewer
Jun 10, 2026
Merged

feat(mobile): highlight and surface current user in suggested reviewers (port #2435)#2449
charlesvien merged 3 commits into
mainfrom
posthog-code/mobile-highlight-current-reviewer

Conversation

@Gilbert09

Copy link
Copy Markdown
Member

Summary

Ports desktop PR #2435 ("Highlight current user in signal suggested reviewers") to the mobile app, bringing the inbox report detail to parity.

Two gaps were closed in the mobile "Suggested reviewers" list:

  1. Wire the current user through. The detail screen now reads the logged-in user's uuid via useUserQuery and passes it as meUuid to <SuggestedReviewers>, so the component's existing isMe highlight badge actually shows.
  2. Reorder so the current user is first. When the logged-in user appears in the list and isn't already first, they're moved to the front — mirroring the desktop behavior. The reorder lives in a pure, testable orderSuggestedReviewers util alongside the other inbox derivation helpers.

The "Why was I assigned?" commit-reason tooltip from desktop is intentionally not ported: mobile's SuggestedReviewers does not render relevant_commits at all, and inventing a new commits UI was out of scope.

Changes

  • apps/mobile/src/features/inbox/utils.ts — add orderSuggestedReviewers(reviewers, meUuid).
  • apps/mobile/src/app/inbox/[id].tsx — call useUserQuery, reorder in the suggestedReviewers memo, pass meUuid to the component.
  • apps/mobile/src/features/inbox/utils.test.ts — unit tests for the reorder (moves to front, no-op when already first / absent / no uuid).

Testing

  • pnpm --filter @posthog/mobile test src/features/inbox/ — passing.
  • tsc --noEmit clean for the changed files.
  • Desktop code under apps/code untouched.

@Gilbert09 Gilbert09 requested a review from a team June 1, 2026 10:37
@greptile-apps

greptile-apps Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor
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/mobile/src/features/inbox/utils.test.ts:33-49
The three no-op cases all assert the same thing — that the original array reference is returned unchanged — across different inputs. Per the team's convention of preferring parameterised tests, they're a natural fit for `it.each`.

```suggestion
  it.each([
    {
      label: "already first",
      reviewers: [reviewer("me", "uuid-me"), reviewer("a", "uuid-a")],
      meUuid: "uuid-me" as string | null | undefined,
    },
    {
      label: "absent",
      reviewers: [reviewer("a", "uuid-a"), reviewer("b", "uuid-b")],
      meUuid: "uuid-me" as string | null | undefined,
    },
    {
      label: "null meUuid",
      reviewers: [reviewer("a", "uuid-a"), reviewer("me", "uuid-me")],
      meUuid: null as string | null | undefined,
    },
    {
      label: "undefined meUuid",
      reviewers: [reviewer("a", "uuid-a"), reviewer("me", "uuid-me")],
      meUuid: undefined as string | null | undefined,
    },
  ])("is a no-op when $label", ({ reviewers, meUuid }) => {
    expect(orderSuggestedReviewers(reviewers, meUuid)).toBe(reviewers);
  });
```

Reviews (1): Last reviewed commit: "feat(mobile): highlight and surface curr..." | Re-trigger Greptile

Comment thread apps/mobile/src/features/inbox/utils.test.ts Outdated
@Gilbert09 Gilbert09 force-pushed the posthog-code/mobile-highlight-current-reviewer branch from 96308d0 to d371697 Compare June 2, 2026 13:52
@Gilbert09 Gilbert09 added the Stamphog This will request an autostamp by stamphog on small changes label Jun 3, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 9b463e5.

@charlesvien charlesvien enabled auto-merge (squash) June 10, 2026 05:03
Gilbert09 added 3 commits June 9, 2026 22:09
…rs (port #2435)

Ports desktop PR #2435 to the mobile inbox report detail.

- Wire the current user's uuid (via useUserQuery) into SuggestedReviewers so the existing isMe highlight shows.
- Move the logged-in user to the front of the suggested-reviewers list when present and not already first, via a pure orderSuggestedReviewers util.
- Add unit tests covering reorder, already-first no-op, absent user, and missing uuid.

Generated-By: PostHog Code
Task-Id: 6570d0da-5363-4355-94b2-4576776d02aa
Generated-By: PostHog Code
Task-Id: 6570d0da-5363-4355-94b2-4576776d02aa
Re-integrate the orderSuggestedReviewers helper into inbox utils with unit tests, and have the SuggestedReviewers component use it instead of a duplicated inline ordering memo so the current user surfaces at the front of the list. Removes the temporary reviewerOrdering.ts helper used only to land the base merge.

Generated-By: PostHog Code
Task-Id: 62bcca49-f992-4d48-8877-5f680f17b036
@charlesvien charlesvien force-pushed the posthog-code/mobile-highlight-current-reviewer branch from bac7975 to 9b463e5 Compare June 10, 2026 05:11
@charlesvien charlesvien merged commit 9e84213 into main Jun 10, 2026
19 checks passed
@charlesvien charlesvien deleted the posthog-code/mobile-highlight-current-reviewer branch June 10, 2026 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stamphog This will request an autostamp by stamphog on small changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants