Highlight current user in signal suggested reviewers#2435
Conversation
Sorts the current user to the top of the suggested reviewers list, and when a commit explains why the current user was picked, shows a small info icon next to the SHA with a "Why was I assigned?" tooltip that surfaces the rationale. Other reviewers keep the existing hover-on-SHA tooltip. Generated-By: PostHog Code Task-Id: bf5f3c64-2f8b-4ca2-8716-b91f7527b080
Hovering either the commit link or the new info icon now opens the same tooltip, collapsing the per-isMe branching into one Tooltip with conditional content and a conditional trailing icon. Generated-By: PostHog Code Task-Id: bf5f3c64-2f8b-4ca2-8716-b91f7527b080
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/features/inbox/components/detail/ReportDetailPane.tsx:826-840
When `isMe` is `true` but `commit.reason` is empty/null, the tooltip content is still a non-`undefined` `<Flex>` element (containing "Why was I assigned?" with a blank body), so hovering the SHA link will open an incomplete tooltip. The non-`isMe` branch already guards this with `|| undefined` — the same guard is needed here.
```suggestion
<Tooltip
content={
isMe ? (
commit.reason ? (
<Flex direction="column" gap="1">
<Text as="div" size="1" weight="bold">
Why was I assigned?
</Text>
<Text as="div" size="1">
{commit.reason}
</Text>
</Flex>
) : undefined
) : (
commit.reason || undefined
)
}
```
Reviews (1): Last reviewed commit: "Wrap commit SHA and info icon in a singl..." | Re-trigger Greptile |
| <Tooltip | ||
| content={ | ||
| isMe ? ( | ||
| <Flex direction="column" gap="1"> | ||
| <Text as="div" size="1" weight="bold"> | ||
| Why was I assigned? | ||
| </Text> | ||
| <Text as="div" size="1"> | ||
| {commit.reason} | ||
| </Text> | ||
| </Flex> | ||
| ) : ( | ||
| commit.reason || undefined | ||
| ) | ||
| } |
There was a problem hiding this comment.
When
isMe is true but commit.reason is empty/null, the tooltip content is still a non-undefined <Flex> element (containing "Why was I assigned?" with a blank body), so hovering the SHA link will open an incomplete tooltip. The non-isMe branch already guards this with || undefined — the same guard is needed here.
| <Tooltip | |
| content={ | |
| isMe ? ( | |
| <Flex direction="column" gap="1"> | |
| <Text as="div" size="1" weight="bold"> | |
| Why was I assigned? | |
| </Text> | |
| <Text as="div" size="1"> | |
| {commit.reason} | |
| </Text> | |
| </Flex> | |
| ) : ( | |
| commit.reason || undefined | |
| ) | |
| } | |
| <Tooltip | |
| content={ | |
| isMe ? ( | |
| commit.reason ? ( | |
| <Flex direction="column" gap="1"> | |
| <Text as="div" size="1" weight="bold"> | |
| Why was I assigned? | |
| </Text> | |
| <Text as="div" size="1"> | |
| {commit.reason} | |
| </Text> | |
| </Flex> | |
| ) : undefined | |
| ) : ( | |
| commit.reason || undefined | |
| ) | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/inbox/components/detail/ReportDetailPane.tsx
Line: 826-840
Comment:
When `isMe` is `true` but `commit.reason` is empty/null, the tooltip content is still a non-`undefined` `<Flex>` element (containing "Why was I assigned?" with a blank body), so hovering the SHA link will open an incomplete tooltip. The non-`isMe` branch already guards this with `|| undefined` — the same guard is needed here.
```suggestion
<Tooltip
content={
isMe ? (
commit.reason ? (
<Flex direction="column" gap="1">
<Text as="div" size="1" weight="bold">
Why was I assigned?
</Text>
<Text as="div" size="1">
{commit.reason}
</Text>
</Flex>
) : undefined
) : (
commit.reason || undefined
)
}
```
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Should be inverse and just check for commit.reason before, right
There was a problem hiding this comment.
should hoist check
content={
commit.reason
? isMe
? (
<Flex direction="column" gap="1">
<Text as="div" size="1" weight="bold">Why was I assigned?</Text>
<Text as="div" size="1">{commit.reason}</Text>
</Flex>
)
: commit.reason
: undefined
}
k11kirky
left a comment
There was a problem hiding this comment.
non blokcing approve, with an added suggestion for the greptile comment
| <Tooltip | ||
| content={ | ||
| isMe ? ( | ||
| <Flex direction="column" gap="1"> | ||
| <Text as="div" size="1" weight="bold"> | ||
| Why was I assigned? | ||
| </Text> | ||
| <Text as="div" size="1"> | ||
| {commit.reason} | ||
| </Text> | ||
| </Flex> | ||
| ) : ( | ||
| commit.reason || undefined | ||
| ) | ||
| } |
There was a problem hiding this comment.
should hoist check
content={
commit.reason
? isMe
? (
<Flex direction="column" gap="1">
<Text as="div" size="1" weight="bold">Why was I assigned?</Text>
<Text as="div" size="1">{commit.reason}</Text>
</Flex>
)
: commit.reason
: undefined
}
|
lol - didnt see the auto merge @rafaeelaudibert optional follow up in comments |
…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
Problem
When a signal report assigns suggested reviewers, it can be hard to tell at a glance whether you are on the list, and why. The commit SHA-only tooltip explaining the rationale isn't obviously discoverable — you have to know to hover.
Changes
In the Suggested reviewers section of the report detail pane:
How did you test this?
pnpm --filter code typecheck(web tsconfig)pnpm exec biome checkon the edited fileDid not run the desktop app in this environment.
Automatic notifications
Created with PostHog Code