Skip to content

fix(app): show empty review state for projects without VCS - #50265

Merged
Hona merged 1 commit into
anomalyco:v2from
Hona:review-no-vcs
Sep 21, 2026
Merged

Hona merged 1 commit into
anomalyco:v2from
Hona:review-no-vcs

Conversation

@Hona

@Hona Hona commented Sep 21, 2026

Copy link
Copy Markdown
Member

Closes #49260

Opening Review in a project without VCS spins on "Loading changes…" forever.

Before After

Why it hangs

flowchart LR
  A["project.vcs === undefined"] --> B["vcsQuery enabled: false"]
  B --> C["TanStack: no fetch, status stays 'pending'"]
  C --> D["ready() = !vcsQuery.isPending = false"]
  D --> E["ReviewEmpty: loading() wins forever"]
Loading
  • @tanstack/[email protected] getDefaultState → status: 'pending' with no data; shouldLoadOnMount returns false when disabled, so it never leaves that state.
  • mode() defaults to "git", and options never includes "turn", so the existing noGit branch (mode() === "turn" && noGit()) was unreachable dead code.

Change

packages/app/src/session/review/model.ts

const ready = () => {
  const project = input.session.project()
  if (project && !project.vcs) return true
  if (mode() === "git" || mode() === "branch") return !vcsQuery.isPending
  return true
}

packages/app/src/session/review/view.tsx

-const noGit = () => props.review.mode() === "turn" && props.review.noGit()
+const noGit = () => props.review.noGit()
  • Any truthy project.vcs (git or another backend) keeps the current loading behaviour, matching fix(app): show review diffs for non-git VCS backends #46684.
  • Unknown project (undefined) still shows loading until the project resolves.
  • The already-localised session.review.noVcs.createGit.* empty state renders instead of the misleading "No uncommitted changes yet".

@Hona
Hona requested a review from Brendonovich as a code owner September 21, 2026 01:57
Copilot AI lite review requested due to automatic review settings September 21, 2026 01:57

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Hona
Hona merged commit 8aebed1 into anomalyco:v2 Sep 21, 2026
2 checks passed
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
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