Repository navigation
feat(web): make pull request comments easier to scan #12150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
maria-rcks
merged 9 commits into
pingdotgg:main
from
maria-rcks:t3code/redesign-pr-comment-section
Sep 17, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e775496
feat(web): make pull request comments easier to scan
maria-rcks 1c6dde6
fix(web): preserve focus when expanding resolved comments
maria-rcks 70aeccc
fix(web): group resolved pull request comments
maria-rcks 6c7a72a
fix(web): label dismissed reviews neutrally
maria-rcks 342558a
fix(web): keep pull request reactions in message headers
maria-rcks be808ee
fix(web): collapse bot comments in pull request summaries
maria-rcks b7f4999
refactor(web): share collapsed comment group controls
maria-rcks 7254dd0
feat(web): add context to collapsed comment cards
maria-rcks ebe82a3
fix(web): link grouped bot avatars to app profiles
maria-rcks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
61 changes: 61 additions & 0 deletions
61
apps/web/src/components/pullRequest/PullRequestCommentBody.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import { useEffect, useId, useRef, useState, type ComponentProps } from "react"; | ||
|
|
||
| import { cn } from "~/lib/utils"; | ||
| import { Button } from "../ui/button"; | ||
| import { PullRequestMarkdown } from "./PullRequestMarkdown"; | ||
|
|
||
| /** Keep the complete markdown intact while limiting long reports to a readable preview. */ | ||
| export function PullRequestCommentBody({ | ||
| className, | ||
| ...props | ||
| }: ComponentProps<typeof PullRequestMarkdown>) { | ||
| const [expanded, setExpanded] = useState(false); | ||
| const [overflowing, setOverflowing] = useState(false); | ||
| const content = useRef<HTMLDivElement>(null); | ||
| const id = useId(); | ||
|
|
||
| useEffect(() => { | ||
| const element = content.current; | ||
| if (!element) return; | ||
| const measure = () => setOverflowing(element.getBoundingClientRect().height > 240); | ||
| measure(); | ||
| const observer = new ResizeObserver(measure); | ||
| observer.observe(element); | ||
| return () => observer.disconnect(); | ||
| }, []); | ||
|
|
||
| return ( | ||
| <div className={cn("min-w-0", className)}> | ||
| <div | ||
| id={id} | ||
| className={cn("relative", !expanded && "max-h-[240px] overflow-hidden")} | ||
| onFocusCapture={() => setExpanded(true)} | ||
| > | ||
| <div ref={content}> | ||
| <PullRequestMarkdown {...props} /> | ||
| </div> | ||
| {overflowing && !expanded ? ( | ||
| <div | ||
| aria-hidden | ||
| className="pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-background to-transparent" | ||
| /> | ||
| ) : null} | ||
| </div> | ||
| {overflowing ? ( | ||
| <Button | ||
| size="xs" | ||
| variant="ghost" | ||
| className="mt-2 text-muted-foreground" | ||
| aria-expanded={expanded} | ||
| aria-controls={id} | ||
| onClick={() => { | ||
| if (expanded) content.current?.parentElement?.scrollIntoView({ block: "nearest" }); | ||
| setExpanded(!expanded); | ||
| }} | ||
| > | ||
| {expanded ? "Show less" : "Show full comment"} | ||
| </Button> | ||
| ) : null} | ||
| </div> | ||
| ); | ||
| } |
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
Oops, something went wrong.
Oops, something went wrong.
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.