Skip to content

Commit f0efa3c

Browse files
authored
Lack of 👀 reaction in PR view is important for coding agent (#7214)
Fixes #7213
1 parent 76dbd8f commit f0efa3c

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

src/common/timelineEvent.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { IAccount, IActor } from '../github/interface';
6+
import { IAccount, IActor, Reaction } from '../github/interface';
77
import { IComment } from './comment';
88

99
export enum EventType {
@@ -45,6 +45,7 @@ export interface CommentEvent {
4545
canEdit?: boolean;
4646
canDelete?: boolean;
4747
createdAt: string;
48+
reactions?: Reaction[];
4849
}
4950

5051
export interface ReviewResolveInfo {
@@ -68,6 +69,7 @@ export interface ReviewEvent {
6869
user: IAccount;
6970
authorAssociation: string;
7071
state?: ReviewStateValue;
72+
reactions?: Reaction[];
7173
}
7274

7375
export interface CommitEvent {

src/github/graphql.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export interface AbbreviatedIssueComment {
7575
reactions: {
7676
totalCount: number;
7777
};
78+
reactionGroups: ReactionGroup[]
7879
createdAt: string;
7980
}
8081

@@ -227,6 +228,7 @@ export interface Review {
227228
submittedAt: string;
228229
updatedAt: string;
229230
createdAt: string;
231+
reactionGroups: ReactionGroup[];
230232
}
231233

232234
export interface ReviewThread {

src/github/queriesShared.gql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ fragment Comment on IssueComment {
103103
viewerCanUpdate
104104
viewerCanReact
105105
viewerCanDelete
106+
...Reactable
106107
}
107108

108109
fragment Commit on PullRequestCommit {
@@ -223,6 +224,7 @@ fragment Review on PullRequestReview {
223224
submittedAt
224225
updatedAt
225226
createdAt
227+
...Reactable
226228
}
227229

228230
fragment Reactable on Reactable {

src/github/utils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ export function convertRESTReviewEvent(
444444
authorAssociation: review.user!.type,
445445
state: review.state as 'COMMENTED' | 'APPROVED' | 'CHANGES_REQUESTED' | 'PENDING',
446446
id: review.id,
447+
reactions: undefined // reactions only available through GraphQL API
447448
};
448449
}
449450

@@ -560,6 +561,7 @@ export function parseGraphQlIssueComment(comment: GraphQL.IssueComment, githubRe
560561
htmlUrl: comment.url,
561562
graphNodeId: comment.id,
562563
diffHunk: '',
564+
reactions: parseGraphQLReaction(comment.reactionGroups),
563565
};
564566
}
565567

@@ -994,6 +996,7 @@ export function parseGraphQLReviewEvent(
994996
authorAssociation: review.authorAssociation,
995997
state: review.state,
996998
id: review.databaseId,
999+
reactions: parseGraphQLReaction(review.reactionGroups),
9971000
};
9981001
}
9991002

@@ -1129,6 +1132,7 @@ export async function parseCombinedTimelineEvents(
11291132
id: commentEvent.databaseId,
11301133
graphNodeId: commentEvent.id,
11311134
createdAt: commentEvent.createdAt,
1135+
reactions: parseGraphQLReaction(commentEvent.reactionGroups),
11321136
});
11331137
break;
11341138
case Common.EventType.Reviewed:
@@ -1144,6 +1148,7 @@ export async function parseCombinedTimelineEvents(
11441148
authorAssociation: reviewEvent.authorAssociation,
11451149
state: reviewEvent.state,
11461150
id: reviewEvent.databaseId,
1151+
reactions: parseGraphQLReaction(reviewEvent.reactionGroups),
11471152
});
11481153
break;
11491154
case Common.EventType.Committed:

0 commit comments

Comments
 (0)