Highlight current user in signal suggested reviewers#2435
Open
rafaeelaudibert wants to merge 2 commits into
Open
Highlight current user in signal suggested reviewers#2435rafaeelaudibert wants to merge 2 commits into
rafaeelaudibert wants to merge 2 commits into
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
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/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 |
Comment on lines
+826
to
+840
| <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 | ||
| ) | ||
| } |
Contributor
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.
Suggested change
| <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.
Member
Author
There was a problem hiding this comment.
Should be inverse and just check for commit.reason before, right
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.
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