Skip to content

feat: convert pasted links to gh chip, support PRs#1838

Merged
charlesvien merged 1 commit intomainfrom
04-22-feat_convert_pasted_links_to_gh_chip_support_prs
Apr 23, 2026
Merged

feat: convert pasted links to gh chip, support PRs#1838
charlesvien merged 1 commit intomainfrom
04-22-feat_convert_pasted_links_to_gh_chip_support_prs

Conversation

@jonathanlab
Copy link
Copy Markdown
Contributor

@jonathanlab jonathanlab commented Apr 22, 2026

This started as a humble small PR to automatically convert pasted issues into GH issue chips
But then I realise I wanted to support mentioning PRs too, so I refactored the whole thing for that
Closes #1816

CleanShot 2026-04-22 at 16.24.26.gif

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 22, 2026

Prompt To Fix All With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/message-editor/utils/githubIssueUrl.ts
Line: 1

Comment:
**Duplicate `GithubRefKind` type (OnceAndOnlyOnce)**

`GithubRefKind` is already defined in `schemas.ts` (as `z.infer<typeof githubRefKindSchema>`) and re-exported from `../types`. Defining it again here means any future change to the canonical definition won't automatically apply here.

```suggestion
import type { GithubRefKind } from "../types";
export type { GithubRefKind };
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: apps/code/src/main/services/git/schemas.ts
Line: 554-560

Comment:
**Duplicate input/output schemas (OnceAndOnlyOnce)**

`getGithubPullRequestInput` and `getGithubPullRequestOutput` are byte-for-byte identical to `getGithubIssueInput` / `getGithubIssueOutput`. Aliasing avoids the duplication and keeps both procedures in sync if the shape ever changes.

```suggestion
export const getGithubPullRequestInput = getGithubIssueInput;

export const getGithubPullRequestOutput = getGithubIssueOutput;
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "feat: convert pasted links to gh chip, s..." | Re-trigger Greptile

@@ -0,0 +1,31 @@
export type GithubRefKind = "issue" | "pr";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Duplicate GithubRefKind type (OnceAndOnlyOnce)

GithubRefKind is already defined in schemas.ts (as z.infer<typeof githubRefKindSchema>) and re-exported from ../types. Defining it again here means any future change to the canonical definition won't automatically apply here.

Suggested change
export type GithubRefKind = "issue" | "pr";
import type { GithubRefKind } from "../types";
export type { GithubRefKind };
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/message-editor/utils/githubIssueUrl.ts
Line: 1

Comment:
**Duplicate `GithubRefKind` type (OnceAndOnlyOnce)**

`GithubRefKind` is already defined in `schemas.ts` (as `z.infer<typeof githubRefKindSchema>`) and re-exported from `../types`. Defining it again here means any future change to the canonical definition won't automatically apply here.

```suggestion
import type { GithubRefKind } from "../types";
export type { GithubRefKind };
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +554 to +560
export const getGithubPullRequestInput = z.object({
owner: z.string(),
repo: z.string(),
number: z.number().int().positive(),
});

export const searchGithubIssuesOutput = z.array(githubIssueSchema);
export const getGithubPullRequestOutput = githubRefSchema.nullable();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Duplicate input/output schemas (OnceAndOnlyOnce)

getGithubPullRequestInput and getGithubPullRequestOutput are byte-for-byte identical to getGithubIssueInput / getGithubIssueOutput. Aliasing avoids the duplication and keeps both procedures in sync if the shape ever changes.

Suggested change
export const getGithubPullRequestInput = z.object({
owner: z.string(),
repo: z.string(),
number: z.number().int().positive(),
});
export const searchGithubIssuesOutput = z.array(githubIssueSchema);
export const getGithubPullRequestOutput = githubRefSchema.nullable();
export const getGithubPullRequestInput = getGithubIssueInput;
export const getGithubPullRequestOutput = getGithubIssueOutput;
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/main/services/git/schemas.ts
Line: 554-560

Comment:
**Duplicate input/output schemas (OnceAndOnlyOnce)**

`getGithubPullRequestInput` and `getGithubPullRequestOutput` are byte-for-byte identical to `getGithubIssueInput` / `getGithubIssueOutput`. Aliasing avoids the duplication and keeps both procedures in sync if the shape ever changes.

```suggestion
export const getGithubPullRequestInput = getGithubIssueInput;

export const getGithubPullRequestOutput = getGithubIssueOutput;
```

How can I resolve this? If you propose a fix, please make it concise.

@charlesvien charlesvien force-pushed the 04-22-feat_mentions_gh_issues_pr_with_ branch from fcde5c1 to bb2eca3 Compare April 22, 2026 15:40
@charlesvien charlesvien force-pushed the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch from 45c09a5 to d11ad1b Compare April 22, 2026 15:41
@charlesvien charlesvien force-pushed the 04-22-feat_mentions_gh_issues_pr_with_ branch from bb2eca3 to f00123f Compare April 22, 2026 22:58
@charlesvien charlesvien force-pushed the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch from d11ad1b to 1ae2eb3 Compare April 22, 2026 22:58
@jonathanlab jonathanlab force-pushed the 04-22-feat_mentions_gh_issues_pr_with_ branch from f00123f to 1b5db4c Compare April 23, 2026 10:25
@jonathanlab jonathanlab force-pushed the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch from 1ae2eb3 to 7b69326 Compare April 23, 2026 10:28
@jonathanlab jonathanlab force-pushed the 04-22-feat_mentions_gh_issues_pr_with_ branch from 1b5db4c to c389600 Compare April 23, 2026 10:44
@jonathanlab jonathanlab force-pushed the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch from 7b69326 to 826393f Compare April 23, 2026 10:44
@charlesvien charlesvien force-pushed the 04-22-feat_mentions_gh_issues_pr_with_ branch from c389600 to 9a0c048 Compare April 23, 2026 10:50
@charlesvien charlesvien force-pushed the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch from 826393f to 1f3492a Compare April 23, 2026 10:51
@charlesvien charlesvien force-pushed the 04-22-feat_mentions_gh_issues_pr_with_ branch from 9a0c048 to fe32234 Compare April 23, 2026 10:58
@charlesvien charlesvien force-pushed the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch from 1f3492a to 4d14c5c Compare April 23, 2026 10:58
@charlesvien charlesvien force-pushed the 04-22-feat_mentions_gh_issues_pr_with_ branch from fe32234 to d923121 Compare April 23, 2026 11:05
@charlesvien charlesvien force-pushed the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch from 4d14c5c to b918c7b Compare April 23, 2026 11:05
@charlesvien charlesvien force-pushed the 04-22-feat_mentions_gh_issues_pr_with_ branch from d923121 to b20f261 Compare April 23, 2026 11:11
@charlesvien charlesvien force-pushed the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch from b918c7b to 3320711 Compare April 23, 2026 11:12
@charlesvien charlesvien force-pushed the 04-22-feat_mentions_gh_issues_pr_with_ branch 2 times, most recently from fc55775 to 3a97084 Compare April 23, 2026 11:23
@charlesvien charlesvien force-pushed the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch from 3320711 to b90d092 Compare April 23, 2026 11:23
@charlesvien charlesvien changed the base branch from 04-22-feat_mentions_gh_issues_pr_with_ to graphite-base/1838 April 23, 2026 11:31
@charlesvien charlesvien force-pushed the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch from b90d092 to 38d67eb Compare April 23, 2026 11:31
@graphite-app graphite-app Bot changed the base branch from graphite-base/1838 to main April 23, 2026 11:32
@charlesvien charlesvien force-pushed the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch from 38d67eb to 720059c Compare April 23, 2026 11:32
@charlesvien charlesvien merged commit 20c8825 into main Apr 23, 2026
15 of 16 checks passed
Copy link
Copy Markdown
Member

Merge activity

@charlesvien charlesvien deleted the 04-22-feat_convert_pasted_links_to_gh_chip_support_prs branch April 23, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatically convert pasted github issue links into chips

3 participants