Skip to content

Commit 1b4bea5

Browse files
committed
fix: commit author pfp & some UI styles
1 parent bd9a34b commit 1b4bea5

4 files changed

Lines changed: 44 additions & 22 deletions

File tree

apps/web/src/app/(app)/repos/[owner]/[repo]/pulls/[number]/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,14 @@ export default async function PRDetailPage({
326326
}
327327

328328
for (const c of commits) {
329+
const commitUser = c.author || c.committer;
329330
const entry: CommitEntry = {
330331
type: "commit",
331332
id: c.sha,
332333
sha: c.sha,
333334
message: c.commit?.message || "",
334-
user: c.author
335-
? { login: c.author.login, avatar_url: c.author.avatar_url }
335+
user: commitUser
336+
? { login: commitUser.login, avatar_url: commitUser.avatar_url }
336337
: null,
337338
committer_name: c.commit?.author?.name || c.commit?.committer?.name || null,
338339
created_at: c.commit?.author?.date || c.commit?.committer?.date || "",

apps/web/src/app/(app)/repos/[owner]/[repo]/pulls/new/actions.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,20 @@ export async function compareBranches(
5959
patch: f.patch,
6060
previous_filename: f.previous_filename,
6161
})),
62-
commits: data.commits.map((c) => ({
63-
sha: c.sha,
64-
message: c.commit.message,
65-
author: c.author
66-
? {
67-
login: c.author.login,
68-
avatar_url: c.author.avatar_url,
69-
}
70-
: null,
71-
date: c.commit.author?.date ?? "",
72-
})),
62+
commits: data.commits.map((c) => {
63+
const commitUser = c.author || c.committer;
64+
return {
65+
sha: c.sha,
66+
message: c.commit.message,
67+
author: commitUser
68+
? {
69+
login: commitUser.login,
70+
avatar_url: commitUser.avatar_url,
71+
}
72+
: null,
73+
date: c.commit.author?.date ?? "",
74+
};
75+
}),
7376
},
7477
};
7578
} catch (err: unknown) {

apps/web/src/components/prompt-request/prompt-detail.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ export function PromptDetail({
295295
<button
296296
onClick={handleRunWithGhost}
297297
disabled={isAccepting}
298-
className="flex items-center gap-1.5 px-3 py-1.5 text-[11px] font-medium bg-foreground text-background rounded-sm hover:bg-foreground/90 transition-colors cursor-pointer disabled:opacity-50"
298+
className="flex items-center gap-1.5 px-3 py-1.5 text-[11px] font-medium bg-primary text-background rounded-sm hover:bg-primary/90 transition-colors cursor-pointer disabled:opacity-50"
299299
>
300300
{isAccepting ? (
301301
<Loader2 className="w-3 h-3 animate-spin" />
@@ -310,7 +310,7 @@ export function PromptDetail({
310310
}
311311
disabled={isAccepting}
312312
className={cn(
313-
"flex items-center gap-1 px-2.5 py-1.5 text-[11px] font-medium rounded-md border transition-all cursor-pointer disabled:opacity-50",
313+
"flex items-center gap-1 px-2.5 py-1.5 text-[11px] font-medium rounded-sm border transition-all cursor-pointer disabled:opacity-50",
314314
copied
315315
? "bg-green-500/15 text-green-400 border-green-500/20"
316316
: "bg-muted/50 text-muted-foreground border-border hover:bg-muted hover:text-foreground",
@@ -511,7 +511,7 @@ export function PromptDetail({
511511
onChange={setCommentBody}
512512
placeholder="Leave a comment..."
513513
compact
514-
rows={2}
514+
rows={4}
515515
onKeyDown={(e) => {
516516
if (
517517
e.key ===
@@ -533,7 +533,7 @@ export function PromptDetail({
533533
!commentBody.trim() ||
534534
isSubmittingComment
535535
}
536-
className="flex items-center gap-1 px-2.5 py-1 text-[11px] font-medium bg-foreground text-background rounded-md hover:opacity-90 transition-opacity disabled:opacity-40 cursor-pointer"
536+
className="flex items-center gap-1 px-2.5 py-1 text-[11px] font-medium bg-foreground text-background rounded-sm hover:opacity-90 transition-opacity disabled:opacity-40 cursor-pointer"
537537
>
538538
{isSubmittingComment ? (
539539
<Loader2 className="w-3 h-3 animate-spin" />

apps/web/src/lib/github.ts

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2739,8 +2739,8 @@ const PR_BUNDLE_QUERY = `
27392739
commit {
27402740
oid
27412741
message
2742-
author { name date }
2743-
committer { name date }
2742+
author { name date user { login avatarUrl } }
2743+
committer { name date user { login avatarUrl } }
27442744
}
27452745
resourcePath
27462746
}
@@ -2864,8 +2864,16 @@ interface GQLCommitNode {
28642864
commit: {
28652865
oid: string;
28662866
message: string;
2867-
author: { name: string; date: string } | null;
2868-
committer: { name: string; date: string } | null;
2867+
author: {
2868+
name: string;
2869+
date: string;
2870+
user?: { login: string; avatarUrl: string } | null;
2871+
} | null;
2872+
committer: {
2873+
name: string;
2874+
date: string;
2875+
user?: { login: string; avatarUrl: string } | null;
2876+
} | null;
28692877
};
28702878
resourcePath: string;
28712879
}
@@ -3024,6 +3032,8 @@ function transformGraphQLPRBundle(node: GQLPRNode): PRBundleData {
30243032

30253033
const commits = (node.commits?.nodes ?? []).map((n) => {
30263034
const c = n.commit;
3035+
const authorUser = c.author?.user;
3036+
const committerUser = c.committer?.user;
30273037
return {
30283038
sha: c.oid,
30293039
commit: {
@@ -3035,7 +3045,15 @@ function transformGraphQLPRBundle(node: GQLPRNode): PRBundleData {
30353045
? { name: c.committer.name, date: c.committer.date }
30363046
: null,
30373047
},
3038-
author: null,
3048+
author: authorUser
3049+
? { login: authorUser.login, avatar_url: authorUser.avatarUrl }
3050+
: null,
3051+
committer: committerUser
3052+
? {
3053+
login: committerUser.login,
3054+
avatar_url: committerUser.avatarUrl,
3055+
}
3056+
: null,
30393057
};
30403058
});
30413059
type PRStateEvent = PRBundleData["stateEvents"][number]["event"];

0 commit comments

Comments
 (0)