fix: hide Create PR when PR exists and toast when pull fails#969
Open
naaa760 wants to merge 6 commits intogeneralaction:mainfrom
Open
fix: hide Create PR when PR exists and toast when pull fails#969naaa760 wants to merge 6 commits intogeneralaction:mainfrom
naaa760 wants to merge 6 commits intogeneralaction:mainfrom
Conversation
|
@naaa760 is attempting to deploy a commit to the General Action Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryPrevents incorrect "Create PR" button display and adds user feedback when git operations fail due to unreachable remotes.
This ensures users get accurate UI state and clear feedback when working offline or with unreachable remotes. Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| src/main/ipc/gitIpc.ts | Captures fetch failure state and returns it to caller without breaking normal flow |
| src/renderer/hooks/useProjectManagement.tsx | Displays toast notification when git fetch fails, informing user of connection issue |
| src/renderer/lib/prStatusStore.ts | Implements localStorage persistence and success-only cache updates to preserve PR state when GitHub is unreachable |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User opens project] --> B[listRemoteBranches called]
B --> C{Remote exists?}
C -->|Yes| D[git fetch --prune]
C -->|No| E[List local branches only]
D --> F{Fetch succeeded?}
F -->|Yes| G[List remote branches]
F -->|No| H[Set fetchFailed=true<br/>Capture error]
H --> G
G --> I[Return success=true<br/>branches + fetchFailed]
E --> I
I --> J[useProjectManagement]
J --> K{fetchFailed?}
K -->|Yes| L[Show toast:<br/>'Could not pull from repository']
K -->|No| M[Continue normally]
L --> M
M --> N[Update branch list]
P[Component mounts] --> Q[subscribeToPrStatus]
Q --> R{Cached PR?}
R -->|Yes| S[Show cached PR state]
R -->|No| T{localStorage PR?}
T -->|Yes| U[Load from localStorage<br/>Update cache]
T -->|No| V[Show loading]
U --> W[refreshPrStatus]
V --> W
S --> W
W --> X[Fetch PR from GitHub]
X --> Y{Request succeeded?}
Y -->|Yes| Z[Update cache + localStorage<br/>Show current state]
Y -->|No| AA[Keep cached/localStorage PR<br/>Maintain 'View PR' button]
Last reviewed commit: 03552f5
Contributor
|
Thank you! @naaa760 |
a992572 to
4c0307c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: #912
description:
Changes:
Result: No "Create PR" when a PR already exists and the repo is unreachable; users see a clear message when pull fails.