diff --git a/src/browser/components/pr-overview.tsx b/src/browser/components/pr-overview.tsx index 32fc08a..d7c9c6e 100644 --- a/src/browser/components/pr-overview.tsx +++ b/src/browser/components/pr-overview.tsx @@ -42,7 +42,9 @@ import { UserMinus, RefreshCw, Reply, + MoreHorizontal, } from "lucide-react"; +import { BlockLink } from "../ui/block-link"; import { Skeleton } from "../ui/skeleton"; import { Checkbox } from "../ui/checkbox"; import { cn } from "../cn"; @@ -4643,62 +4645,107 @@ function CommitsTab({ repo: string; }) { const store = usePRReviewStore(); + const [expandedShas, setExpandedShas] = useState>(new Set()); + return (
- {commits.map((commit) => ( -
{ - await store.setSelectedCommitSha(commit.sha); - const { files } = store.getSnapshot(); - if (files.length > 0) { - store.selectFile(files[0].filename); - } - }} - > - {commit.commit.author?.name} -
- - {commit.commit.message.split("\n")[0]} - -

- {commit.commit.author?.name} committed{" "} - {commit.commit.author?.date && - getTimeAgo(new Date(commit.commit.author.date))} -

-
-
- {commit.parents && commit.parents.length > 1 ? ( - - ) : ( - - )} - - {commit.sha.slice(0, 7)} - - -
-
- ))} + {commits.map((commit) => { + const subject = commit.commit.message.split("\n")[0]; + const body = commit.commit.message + .split("\n") + .slice(1) + .join("\n") + .trim(); + const hasBody = body.length > 0; + const isExpanded = expandedShas.has(commit.sha); + + return ( + + {commit.commit.author?.name} +
+
+ + + + {hasBody && ( + + )} +
+ {isExpanded && ( +

+ {body} +

+ )} +

+ {commit.commit.author?.name} committed{" "} + {commit.commit.author?.date && + getTimeAgo(new Date(commit.commit.author.date))} +

+
+
+ {commit.parents && commit.parents.length > 1 ? ( + + ) : ( + + )} + e.stopPropagation()} + className="text-xs font-mono text-muted-foreground hover:text-blue-400" + > + {commit.sha.slice(0, 7)} + + +
+
+ ); + })}
); }