APP-4263 Fix git ops flicker bug #9452
Conversation
|
I'm starting a first review of this pull request. I completed the review and posted feedback on this pull request. Comment You can view the conversation on Warp. I completed the review and posted feedback on this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR changes DiffStateModel metadata refresh handling so cached PR information is always preserved after loading fresh metadata.
Concerns
- Cached PR information is now preserved even when the current branch changes, which can show or open the previous branch's PR before the asynchronous refresh completes or if it returns no PR.
- Security pass: no security-specific issues were found in the provided diff.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
There was a problem hiding this comment.
Overview
This PR tracks PR-info refreshes to avoid git-operations header flicker while gh pr view is pending and disables stale PR actions during refresh.
Concerns
- PR lookup completion is not tied to the lookup, branch, or repository that spawned it, so a result that already crossed from the background task before
abort()can clear the current refresh handle and apply stale PR info.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
I'm re-reviewing this pull request in response to a review request. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
|
/oz-review re-review this |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I reviewed this pull request and requested human review from: Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds explicit in-flight PR lookup tracking and gates Create PR / stale PR actions while the lookup is refreshing.
Concerns
- PR lookup completions are not tied to the lookup generation or branch that spawned them, so a stale completed lookup can still clear the current refresh state and write old PR info.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| .unwrap_or(None) | ||
| }, | ||
| |me, pr_info, ctx| { | ||
| me.refreshing_pr_info_handle = None; |
There was a problem hiding this comment.
abort() took effect; clearing refreshing_pr_info_handle and then writing pr_info can mark a newer lookup as done and publish stale PR info. Track a refresh generation/current branch and ignore completions that are no longer current.
Oz no longer requests changes for this pull request after the latest automated review.
There was a problem hiding this comment.
Overview
This PR preserves and guards PR metadata while asynchronous gh pr view lookups are in flight, preventing the git operations header from briefly exposing stale Create PR or disabled Commit states during branch transitions.
Concerns
- The dropdown PR action is disabled while PR info refreshes, but it does not surface the same explanatory tooltip as the primary button.
Found: 0 critical, 0 important, 1 suggestions
Verdict
Approve with nits
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| MenuItemFields::new(format!("PR #{}", pr_info.number)) | ||
| .with_icon(Icon::Github) | ||
| .with_on_select_action(CodeReviewAction::ViewPr(pr_info.url)) | ||
| .with_disabled(is_pr_info_refreshing) |
There was a problem hiding this comment.
💡 [SUGGESTION] Add the same Refreshing PR info tooltip to the disabled dropdown item; the Create PR branch below needs the same explanation when refresh disables it.
Description
Fixes APP-4263: the code review git operations header briefly showed incorrect PR-related actions while PR info for the current branch was still being refreshed.
load_metadata_for_reporeturnspr_info: Nonebecause PR info is fetched separately viarefresh_pr_info(gh pr view). That made the UI treat unknown PR state as "no PR" while the async lookup was in flight, which could briefly showCreate PR. With the handle-only version, switching between two branches that both have PRs could also briefly fall back fromPR #Nto disabledCommitbefore resolving toPR #M.Fix
In
app/src/code_review/diff_state.rs:refreshing_pr_info_handle: Option<SpawnedFutureHandle>instead of storing PR staleness in metadata.pr_infothrough metadata refreshes so the header does not clear to disabledCommitwhile the next branch's PR lookup is pending.In
app/src/code_review/code_review_view.rs:Create PRon!is_pr_info_refreshing()so an unknown/pending PR lookup is not treated as "no PR".PR #Nlabel visible but disable the button/menu item with a "Refreshing PR info" tooltip so it cannot open a stale PR.PR #M,Create PR, or disabledCommitstate as appropriate.Testing
Not run in this update per request.
Expected/manual behavior:
Create PRflicker whilegh pr viewis pending.Commitinterstitial; previous PR label remains disabled until the new PR info resolves.Create PRif the branch is eligible.Create PRand commit-dialog create-PR intent remain unavailable while PR info is refreshing.Agent Mode
UPDATED LOOM: https://www.loom.com/share/4c94527c09914af9b295e49b4719159a