Skip to content

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

Open
Gilbert09 wants to merge 15 commits into
mainfrom
posthog-code/mobile-highlight-current-reviewer
Open

feat(mobile): highlight and surface current user in suggested reviewers (port #2435)#2449
Gilbert09 wants to merge 15 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.

…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
@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
Generated-By: PostHog Code
Task-Id: 6570d0da-5363-4355-94b2-4576776d02aa
@Gilbert09 Gilbert09 force-pushed the posthog-code/mobile-highlight-current-reviewer branch from 96308d0 to d371697 Compare June 2, 2026 13:52
Gilbert09 added 4 commits June 2, 2026 14:53
Resolves the modify/rename conflict with main, which renamed
inbox/[id].tsx to inbox/[...id].tsx.

Generated-By: PostHog Code
Task-Id: f65eb1e6-78ba-4c40-8077-b4cd78485c93
Temporarily matches main's inbox/[...id].tsx so the base branch
merges cleanly; PR feature edits are re-applied after the merge.

Generated-By: PostHog Code
Task-Id: f65eb1e6-78ba-4c40-8077-b4cd78485c93
Re-applies the current-user highlighting/ordering edits to
inbox/[...id].tsx on top of the merged base.

Generated-By: PostHog Code
Task-Id: f65eb1e6-78ba-4c40-8077-b4cd78485c93
@Gilbert09 Gilbert09 added the Stamphog This will request an autostamp by stamphog on small changes label Jun 3, 2026
Gilbert09 added 8 commits June 3, 2026 19:24
Resolve conflicts in mobile inbox utils, utils.test, and the inbox detail route by keeping both the suggested-reviewer ordering (this PR) and the inbox-viewed analytics additions from main.

Generated-By: PostHog Code
Task-Id: 29cd7721-2158-4246-ba1b-c73bf4611ebc
Temporarily reset the three inbox files that conflict with main to main's exact content so the base branch can be merged in via a clean (conflict-free) merge commit. The suggested-reviewer ordering feature is re-applied in the following commit.

Generated-By: PostHog Code
Task-Id: 29cd7721-2158-4246-ba1b-c73bf4611ebc
Re-apply the orderSuggestedReviewers helper, its tests, and the inbox detail wiring on top of the merged base. These were temporarily reset to main's content to allow a clean merge of the base branch.

Generated-By: PostHog Code
Task-Id: 29cd7721-2158-4246-ba1b-c73bf4611ebc
Resolve conflicts in the mobile inbox detail screen and inbox utils. main's SuggestedReviewers component now orders the current user to the front and highlights them internally, so the route file adopts main's artefact-based component API while keeping the PR's tested orderSuggestedReviewers helper in utils.

Generated-By: PostHog Code
Task-Id: 62bcca49-f992-4d48-8877-5f680f17b036
Re-merge origin/main as a true two-parent merge to restore base ancestry after the prior squash. Reconcile by having main's SuggestedReviewers component use the PR's shared orderSuggestedReviewers helper instead of a duplicated inline ordering memo.

Generated-By: PostHog Code
Task-Id: 62bcca49-f992-4d48-8877-5f680f17b036
Temporarily reduce this branch's divergence from main to a single new file so the base can be merged in as a verified two-parent merge (GitHub's merge API cannot auto-resolve the overlapping inbox-utils edits, and the signed-commit tool only produces single-parent commits). The helper is re-integrated into utils.ts and the SuggestedReviewers component in the follow-up commit.

Generated-By: PostHog Code
Task-Id: 62bcca49-f992-4d48-8877-5f680f17b036
@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 bac7975.

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
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.

1 participant