Edward Shao e6df31bb6d APP-4263 Fix git ops flicker bug (#9452)
## 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_repo` returns `pr_info: None` because PR info is
fetched separately via `refresh_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 show `Create PR`. With the handle-only
version, switching between two branches that both have PRs could also
briefly fall back from `PR #N` to disabled `Commit` before resolving to
`PR #M`.

### Fix

In `app/src/code_review/diff_state.rs`:

1. Track an in-flight PR lookup with `refreshing_pr_info_handle:
Option<SpawnedFutureHandle>` instead of storing PR staleness in
metadata.
2. Abort any previous PR lookup before starting a new one.
3. Carry forward cached `pr_info` through metadata refreshes so the
header does not clear to disabled `Commit` while the next branch's PR
lookup is pending.

In `app/src/code_review/code_review_view.rs`:

1. Gate `Create PR` on `!is_pr_info_refreshing()` so an unknown/pending
PR lookup is not treated as "no PR".
2. If cached PR info is being carried while a new lookup is pending,
keep the previous `PR #N` label visible but disable the button/menu item
with a "Refreshing PR info" tooltip so it cannot open a stale PR.
3. Once the lookup resolves, update the header to the new branch's `PR
#M`, `Create PR`, or disabled `Commit` state as appropriate.

## Testing

Not run in this update per request.

Expected/manual behavior:
- Main/master → feature branch: no `Create PR` flicker while `gh pr
view` is pending.
- Branch with PR → branch with PR: no disabled `Commit` interstitial;
previous PR label remains disabled until the new PR info resolves.
- Branch with PR → branch without PR: previous PR label remains disabled
briefly, then transitions to `Create PR` if the branch is eligible.
- Dropdown `Create PR` and commit-dialog create-PR intent remain
unavailable while PR info is refreshing.

## Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode


UPDATED LOOM:
https://www.loom.com/share/4c94527c09914af9b295e49b4719159a
2026-05-05 18:53:34 -04:00

Warp Agentic Development Environment product preview

Website · Code · Agents · Terminal · Drive · Docs · How Warp Works

Note

OpenAI is the founding sponsor of the new, open-source Warp repository, and the new agentic management workflows are powered by GPT models.

About

Warp is an agentic development environment, born out of the terminal. Use Warp's built-in coding agent, or bring your own CLI agent (Claude Code, Codex, Gemini CLI, and others).

Installation

You can download Warp and read our docs for platform-specific instructions.

Warp Contributions Overview Dashboard

Explore build.warp.dev to:

  • Watch thousands of Oz agents triage issues, write specs, implement changes, and review PRs
  • View top contributors and in-flight features
  • Track your own issues with GitHub sign-in
  • Click into active agent sessions in a web-compiled Warp terminal

Licensing

Warp's UI framework (the warpui_core and warpui crates) are licensed under the MIT license.

The rest of the code in this repository is licensed under the AGPL v3.

Open Source & Contributing

Warp's client codebase is open source and lives in this repository. We welcome community contributions and have designed a lightweight workflow to help new contributors get started. For the full contribution flow, read our CONTRIBUTING.md guide.

Tip

Chat with contributors and the Warp team in the #oss-contributors Slack channel — a good place for ad-hoc questions, design discussion, and pairing with maintainers. New here? Join the Warp Slack community first, then jump into #oss-contributors.

Maintaining a popular open-source project? Apply for Oz credits to bring agentic workflows like issue triage, PR review, and community management to your repo.

Issue to PR

Before filing, search existing issues for your bug or feature request. If nothing exists, file an issue using our templates. Security vulnerabilities should be reported privately as described in CONTRIBUTING.md.

Once filed, a Warp maintainer reviews the issue and may apply a readiness label: ready-to-spec signals the design is open for contributors to spec out, and ready-to-implement signals the design is settled and code PRs are welcome. Anyone can pick up a labeled issue — mention @oss-maintainers on an issue if you'd like it considered for a readiness label.

Building the Repo Locally

To build and run Warp from source:

./script/bootstrap   # platform-specific setup
./script/run         # build and run Warp
./script/presubmit   # fmt, clippy, and tests

See WARP.md for the full engineering guide, including coding style, testing, and platform-specific notes.

Joining the Team

Interested in joining the team? See our open roles.

Support and Questions

  1. See our docs for a comprehensive guide to Warp's features.
  2. Join our Slack Community to connect with other users and get help from the Warp team — contributors hang out in #oss-contributors.
  3. Try our Preview build to test the latest experimental features.
  4. Mention @oss-maintainers on any issue to escalate to the team — for example, if you encounter problems with the automated agents.

Code of Conduct

We ask everyone to be respectful and empathetic. Warp follows the Code of Conduct. To report violations, email warp-coc at warp.dev.

Open Source Dependencies

We'd like to call out a few of the open source dependencies that have helped Warp to get off the ground:

Description
这个项目叫 Warp,是一个用 Rust 从零开发的 AI 终端。准确说,它已经不只是终端了,官方给它的定位是 Agentic Development Environment,智能体开发环境。
Readme 220 MiB
Languages
Rust 98%
Shell 0.7%
Python 0.5%
Objective-C 0.3%
PowerShell 0.1%
Other 0.1%