Skip to content

feat(code): add PR diff source#1864

Merged
adboio merged 1 commit into
mainfrom
04-23-feat_code_add_pr_diff_source
Apr 27, 2026
Merged

feat(code): add PR diff source#1864
adboio merged 1 commit into
mainfrom
04-23-feat_code_add_pr_diff_source

Conversation

@adboio

@adboio adboio commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Problem

local tasks may have associated PRs now, but there's no way to view the PR diff

Changes

adds PR as a diff source, little bit of refactoring along the way

How did you test this?

manually

adboio commented Apr 23, 2026

Copy link
Copy Markdown
Contributor Author

@adboio adboio requested a review from a team April 23, 2026 14:38
@adboio adboio force-pushed the 04-23-feat_code_add_pr_actions_to_local_tasks branch from a36c1e1 to d107aac Compare April 23, 2026 19:21
@adboio adboio force-pushed the 04-23-feat_code_add_pr_diff_source branch from 0459081 to 82824d0 Compare April 23, 2026 19:21
@adboio adboio force-pushed the 04-23-feat_code_add_pr_actions_to_local_tasks branch from d107aac to ced37dd Compare April 24, 2026 21:33
@adboio adboio force-pushed the 04-23-feat_code_add_pr_diff_source branch from 82824d0 to 1ff05ce Compare April 24, 2026 21:33
@adboio adboio marked this pull request as ready for review April 24, 2026 21:40
@greptile-apps

greptile-apps Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/code-review/components/ReviewPage.tsx
Line: 38

Comment:
**Duplicate empty-array constant**

`EMPTY_PR_FILES` is structurally identical to `EMPTY_BRANCH_FILES` (both are `ChangedFile[]` initialized to `[]`). Per the OnceAndOnlyOnce simplicity rule, a single constant should serve both uses.

```suggestion
const EMPTY_CHANGED_FILES: ChangedFile[] = [];
```

Then replace both `EMPTY_BRANCH_FILES` and `EMPTY_PR_FILES` usages with `EMPTY_CHANGED_FILES`.

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/renderer/features/code-review/utils/resolveDiffSource.test.ts
Line: 78-86

Comment:
**Missing branch fallback test case**

The previous suite included a case where `linkedBranch` is set but `aheadOfDefault` is `0` (branch exists but nothing has been committed ahead). That case was dropped when the test was updated and is no longer covered. The surviving "falls back to local when unavailable" case only exercises `linkedBranch: null`.

Consider adding:
```ts
{
  desc: "explicit branch falls back to local when no commits ahead",
  configured: "branch",
  hasLocalChanges: false,
  linkedBranch: "feat/x",
  aheadOfDefault: 0,
  prSourceAvailable: false,
  expected: "local",
},
```

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

Reviews (1): Last reviewed commit: "feat(code): add PR diff source" | Re-trigger Greptile

} from "./ReviewShell";

const EMPTY_BRANCH_FILES: ChangedFile[] = [];
const EMPTY_PR_FILES: ChangedFile[] = [];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Duplicate empty-array constant

EMPTY_PR_FILES is structurally identical to EMPTY_BRANCH_FILES (both are ChangedFile[] initialized to []). Per the OnceAndOnlyOnce simplicity rule, a single constant should serve both uses.

Suggested change
const EMPTY_PR_FILES: ChangedFile[] = [];
const EMPTY_CHANGED_FILES: ChangedFile[] = [];

Then replace both EMPTY_BRANCH_FILES and EMPTY_PR_FILES usages with EMPTY_CHANGED_FILES.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/code-review/components/ReviewPage.tsx
Line: 38

Comment:
**Duplicate empty-array constant**

`EMPTY_PR_FILES` is structurally identical to `EMPTY_BRANCH_FILES` (both are `ChangedFile[]` initialized to `[]`). Per the OnceAndOnlyOnce simplicity rule, a single constant should serve both uses.

```suggestion
const EMPTY_CHANGED_FILES: ChangedFile[] = [];
```

Then replace both `EMPTY_BRANCH_FILES` and `EMPTY_PR_FILES` usages with `EMPTY_CHANGED_FILES`.

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

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines 78 to 86
{
desc: "explicit branch falls back to local when no linked branch",
desc: "explicit branch falls back to local when unavailable",
configured: "branch",
hasLocalChanges: false,
linkedBranch: null,
aheadOfDefault: 0,
prSourceAvailable: false,
expected: "local",
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Missing branch fallback test case

The previous suite included a case where linkedBranch is set but aheadOfDefault is 0 (branch exists but nothing has been committed ahead). That case was dropped when the test was updated and is no longer covered. The surviving "falls back to local when unavailable" case only exercises linkedBranch: null.

Consider adding:

{
  desc: "explicit branch falls back to local when no commits ahead",
  configured: "branch",
  hasLocalChanges: false,
  linkedBranch: "feat/x",
  aheadOfDefault: 0,
  prSourceAvailable: false,
  expected: "local",
},
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/code-review/utils/resolveDiffSource.test.ts
Line: 78-86

Comment:
**Missing branch fallback test case**

The previous suite included a case where `linkedBranch` is set but `aheadOfDefault` is `0` (branch exists but nothing has been committed ahead). That case was dropped when the test was updated and is no longer covered. The surviving "falls back to local when unavailable" case only exercises `linkedBranch: null`.

Consider adding:
```ts
{
  desc: "explicit branch falls back to local when no commits ahead",
  configured: "branch",
  hasLocalChanges: false,
  linkedBranch: "feat/x",
  aheadOfDefault: 0,
  prSourceAvailable: false,
  expected: "local",
},
```

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

@adboio adboio force-pushed the 04-23-feat_code_add_pr_diff_source branch from 1ff05ce to ce4f443 Compare April 24, 2026 22:14
@adboio adboio force-pushed the 04-23-feat_code_add_pr_actions_to_local_tasks branch 2 times, most recently from c12cfc3 to dc2f4b7 Compare April 24, 2026 22:29
@adboio adboio force-pushed the 04-23-feat_code_add_pr_diff_source branch from ce4f443 to 58ec2e3 Compare April 24, 2026 22:29
@adboio adboio changed the base branch from 04-23-feat_code_add_pr_actions_to_local_tasks to graphite-base/1864 April 24, 2026 22:50
@adboio adboio force-pushed the 04-23-feat_code_add_pr_diff_source branch from 58ec2e3 to 9e9fb6d Compare April 24, 2026 22:50
@adboio adboio force-pushed the graphite-base/1864 branch from dc2f4b7 to d7b8cbb Compare April 24, 2026 22:50
@graphite-app graphite-app Bot changed the base branch from graphite-base/1864 to main April 24, 2026 22:50
@adboio adboio force-pushed the 04-23-feat_code_add_pr_diff_source branch from 9e9fb6d to db71e1d Compare April 24, 2026 22:50

adboio commented Apr 27, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Apr 27, 3:56 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 27, 3:57 PM UTC: @adboio merged this pull request with Graphite.

@adboio adboio merged commit fab9b48 into main Apr 27, 2026
16 checks passed
@adboio adboio deleted the 04-23-feat_code_add_pr_diff_source branch April 27, 2026 15:57
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.

2 participants