Skip to content

feat: show 'create pr' if commits are ahead of main - #1079

Merged
arnestrickmann merged 1 commit into
generalaction:mainfrom
Valley-15:feat/show-create-pr-ahead-commits
Feb 25, 2026
Merged

feat: show 'create pr' if commits are ahead of main#1079
arnestrickmann merged 1 commit into
generalaction:mainfrom
Valley-15:feat/show-create-pr-ahead-commits

Conversation

@Valley-15

Copy link
Copy Markdown
Contributor

Problem:
The 'Create PR' button was only visible when the working directory had uncommitted changes. If a user committed locally but hadn't yet opened a PR, the button would disappear.

Solution:
Updated FileChangesPanel.tsx to ensure branchAhead status is tracked even when hasChanges is true. This allows the "Create PR" button to persist as long as the local branch is ahead of main.

Verification:
Verified via code analysis that the branchAhead state is no longer reset by uncommitted file presence.

@vercel

vercel Bot commented Feb 24, 2026

Copy link
Copy Markdown

@Valley-15 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 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Removed the hasChanges condition from the branch status check effect hook, ensuring that branchAhead state is properly tracked even when there are no uncommitted file changes. This allows the "Create PR" button to remain visible when the local branch is ahead of main with only committed changes.

Key changes:

  • Removed || hasChanges guard from line 227, changing if (!safeTaskPath || hasChanges) to if (!safeTaskPath)
  • The effect now runs whenever safeTaskPath or hasChanges changes (kept in dependency array at line 265), but only checks branch status when there's a valid task path
  • Fixes UX issue where users who committed locally but hadn't pushed/opened a PR would lose visibility of the "Create PR" button

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is a simple one-line removal that fixes a clear logical bug in the branch status check. The logic now correctly checks branch ahead status regardless of uncommitted changes, which aligns with the intended UX behavior. The effect dependencies remain unchanged, and the change doesn't introduce any side effects or breaking changes.
  • No files require special attention

Important Files Changed

Filename Overview
src/renderer/components/FileChangesPanel.tsx Removed hasChanges guard from branchAhead status check, ensuring 'Create PR' button appears when branch is ahead of main even without uncommitted changes

Last reviewed commit: 98f0a28

@arnestrickmann

Copy link
Copy Markdown
Contributor

Thanks!

@arnestrickmann
arnestrickmann merged commit 26cdfe1 into generalaction:main Feb 25, 2026
3 of 4 checks passed
luisKisters pushed a commit to luisKisters/emdash that referenced this pull request Jul 29, 2026
…-pr-ahead-commits

feat: show 'create pr' if commits are ahead of main
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