feat(code): add PR actions to local tasks#1862
feat(code): add PR actions to local tasks#1862adboio wants to merge 1 commit into04-23-feat_code_add_method_for_finding_pr_for_branchfrom
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Prompt To Fix All With AIThis is a comment left during a code review.
Path: apps/code/src/renderer/features/git-interaction/components/TaskActionsMenu.tsx
Line: 419-444
Comment:
**Missing `view-pr` icon case**
`getGitActionIcon` no longer handles `"view-pr"`, so it falls through to the `default` branch and returns a cloud-upload icon. The filter that removes `view-pr` from `gitItems` only fires when `hasPr` is true, but during initial load `useLinkedBranchPrUrl` may still be resolving while `gitState.actions` already contains a `view-pr` entry — producing the wrong icon briefly in the dropdown.
```suggestion
function getGitActionIcon(actionId: GitMenuActionId) {
switch (actionId) {
case "commit":
return <GitCommit size={12} weight="bold" />;
case "push":
return <CloudArrowUp size={12} weight="bold" />;
case "sync":
return <ArrowsClockwise size={12} weight="bold" />;
case "publish":
return <GitBranch size={12} weight="bold" />;
case "create-pr":
return <GitPullRequest size={12} weight="bold" />;
case "view-pr":
return <GitPullRequest size={12} weight="bold" />;
case "branch-here":
return <GitFork size={12} weight="bold" />;
default:
return <CloudArrowUp size={12} weight="bold" />;
}
}
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "feat(code): add PR actions to local task..." | Re-trigger Greptile |
| } | ||
| return ( | ||
| <QDropdownMenuItem onSelect={() => onSelect(action.id)}> | ||
| {itemContent} | ||
| </QDropdownMenuItem> | ||
| ); | ||
| } | ||
|
|
||
| function getGitActionIcon(actionId: GitMenuActionId) { | ||
| switch (actionId) { | ||
| case "commit": | ||
| return <GitCommit size={12} weight="bold" />; | ||
| case "push": | ||
| return <CloudArrowUp size={12} weight="bold" />; | ||
| case "sync": | ||
| return <ArrowsClockwise size={12} weight="bold" />; | ||
| case "publish": | ||
| return <GitBranch size={12} weight="bold" />; | ||
| case "create-pr": | ||
| return <GitPullRequest size={12} weight="bold" />; | ||
| case "branch-here": | ||
| return <GitFork size={12} weight="bold" />; | ||
| default: | ||
| return <CloudArrowUp size={12} weight="bold" />; | ||
| } | ||
| } |
There was a problem hiding this comment.
getGitActionIcon no longer handles "view-pr", so it falls through to the default branch and returns a cloud-upload icon. The filter that removes view-pr from gitItems only fires when hasPr is true, but during initial load useLinkedBranchPrUrl may still be resolving while gitState.actions already contains a view-pr entry — producing the wrong icon briefly in the dropdown.
| } | |
| return ( | |
| <QDropdownMenuItem onSelect={() => onSelect(action.id)}> | |
| {itemContent} | |
| </QDropdownMenuItem> | |
| ); | |
| } | |
| function getGitActionIcon(actionId: GitMenuActionId) { | |
| switch (actionId) { | |
| case "commit": | |
| return <GitCommit size={12} weight="bold" />; | |
| case "push": | |
| return <CloudArrowUp size={12} weight="bold" />; | |
| case "sync": | |
| return <ArrowsClockwise size={12} weight="bold" />; | |
| case "publish": | |
| return <GitBranch size={12} weight="bold" />; | |
| case "create-pr": | |
| return <GitPullRequest size={12} weight="bold" />; | |
| case "branch-here": | |
| return <GitFork size={12} weight="bold" />; | |
| default: | |
| return <CloudArrowUp size={12} weight="bold" />; | |
| } | |
| } | |
| function getGitActionIcon(actionId: GitMenuActionId) { | |
| switch (actionId) { | |
| case "commit": | |
| return <GitCommit size={12} weight="bold" />; | |
| case "push": | |
| return <CloudArrowUp size={12} weight="bold" />; | |
| case "sync": | |
| return <ArrowsClockwise size={12} weight="bold" />; | |
| case "publish": | |
| return <GitBranch size={12} weight="bold" />; | |
| case "create-pr": | |
| return <GitPullRequest size={12} weight="bold" />; | |
| case "view-pr": | |
| return <GitPullRequest size={12} weight="bold" />; | |
| case "branch-here": | |
| return <GitFork size={12} weight="bold" />; | |
| default: | |
| return <CloudArrowUp size={12} weight="bold" />; | |
| } | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/git-interaction/components/TaskActionsMenu.tsx
Line: 419-444
Comment:
**Missing `view-pr` icon case**
`getGitActionIcon` no longer handles `"view-pr"`, so it falls through to the `default` branch and returns a cloud-upload icon. The filter that removes `view-pr` from `gitItems` only fires when `hasPr` is true, but during initial load `useLinkedBranchPrUrl` may still be resolving while `gitState.actions` already contains a `view-pr` entry — producing the wrong icon briefly in the dropdown.
```suggestion
function getGitActionIcon(actionId: GitMenuActionId) {
switch (actionId) {
case "commit":
return <GitCommit size={12} weight="bold" />;
case "push":
return <CloudArrowUp size={12} weight="bold" />;
case "sync":
return <ArrowsClockwise size={12} weight="bold" />;
case "publish":
return <GitBranch size={12} weight="bold" />;
case "create-pr":
return <GitPullRequest size={12} weight="bold" />;
case "view-pr":
return <GitPullRequest size={12} weight="bold" />;
case "branch-here":
return <GitFork size={12} weight="bold" />;
default:
return <CloudArrowUp size={12} weight="bold" />;
}
}
```
How can I resolve this? If you propose a fix, please make it concise.696ec0f to
a36c1e1
Compare
a36c1e1 to
d107aac
Compare
331a490 to
73e2848
Compare

Problem
Changes
How did you test this?
manually