Skip to content

fix: show Create PR button when branch is ahead of main - #1098

Closed
kanweiwei wants to merge 1 commit into
generalaction:mainfrom
kanweiwei:fix/show-create-pr-when-ahead
Closed

fix: show Create PR button when branch is ahead of main#1098
kanweiwei wants to merge 1 commit into
generalaction:mainfrom
kanweiwei:fix/show-create-pr-when-ahead

Conversation

@kanweiwei

Copy link
Copy Markdown

Summary

Fix issue #1073: Show Create PR button when commits are ahead of main, even when there are no uncommitted file changes.

Changes

  • Removed the hasChanges check from branch status useEffect in FileChangesPanel.tsx
  • Now branch status is always checked (except for remote SSH paths)
  • Create PR button will show when local branch is ahead of main, regardless of whether there are uncommitted changes

Before

Create PR button only showed when there were staged/unstaged files

After

Create PR button shows when branch is ahead of main, even with no uncommitted changes

@vercel

vercel Bot commented Feb 25, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the General Action Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Fixes issue where Create PR button was hidden when the branch was ahead of main but had no uncommitted file changes.

Key Changes:

  • Removed hasChanges check from branch status useEffect (lines 240, 278) - now branch status is always checked for non-remote paths
  • Added autoFocus behavior to commit message input when staged changes appear
  • Replaced Input component with native input element to enable ref attachment

How it works:
The branch status check now runs whenever safeTaskPath changes, regardless of whether there are uncommitted changes. This allows the "Create PR" button to appear when branchAhead > 0 (line 701), which correctly handles the case where commits have been pushed but no local file changes remain.

Confidence Score: 4/5

  • Safe to merge with one minor styling improvement suggested
  • The logic change correctly addresses the issue by removing the hasChanges guard from the branch status check. The fix is minimal and well-scoped. Only minor issue is missing dark mode focus ring style on the input element.
  • No files require special attention

Important Files Changed

Filename Overview
src/renderer/components/FileChangesPanel.tsx Removed hasChanges check from branch status useEffect to show Create PR button when branch is ahead. Added autoFocus to commit input. Replaced Input component with native input.

Last reviewed commit: 2298193

@greptile-apps greptile-apps Bot left a comment

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.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment thread src/renderer/components/FileChangesPanel.tsx Outdated
@kanweiwei
kanweiwei force-pushed the fix/show-create-pr-when-ahead branch from 2298193 to a381c6d Compare February 25, 2026 03:29
@arnestrickmann

Copy link
Copy Markdown
Contributor

#1079

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