Skip to content

Changes: point to the other source when one is empty, and wait for Git info to settle - #958

Merged
ivanfenenko merged 1 commit into
mainfrom
fix/changes-source-fallback
Nov 3, 2026
Merged

ivanfenenko merged 1 commit into
mainfrom
fix/changes-source-fallback

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Two fixes to the Changes screen, on both platforms:

  • Point to the other source when one is empty. When Last turn or Git changes has no files but the other source does, the empty state says so ("Git changes has 3 changed files.") with a button to switch. Lookup failures keep the plain empty state.
  • Wait for Git info to settle. A v2 server briefly answers without a branch right after it loads or reloads a project, so Changes dropped the Git changes source. Changes now asks again up to 4 times, 300 ms apart, before deciding a folder has no Git. A folder that isn't a Git repository still ends up without it.
  • Scenario harness: a freshProject option and new Changes scenarios (scenarios-changes.mjs) for Last turn vs Working tree.

Checks

  • Unit tests added on both platforms (ChangesViewModelTest, ChangesTests) for the hint and the settle retries.
  • Not rebuilt locally after rebasing on current main; CI covers it.

Evidence

Not captured yet: needs a harness run of the empty-source hint on both platforms.

Issue

No issue.

Risks / Follow-ups


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@ivanfenenko
ivanfenenko marked this pull request as ready for review November 3, 2026 16:29
@ivanfenenko
ivanfenenko merged commit ecd595c into main Nov 3, 2026
@ivanfenenko
ivanfenenko deleted the fix/changes-source-fallback branch November 3, 2026 16:29
ivanfenenko added a commit that referenced this pull request Nov 3, 2026
Merges main with #958 (Changes points to the other source when one is
empty). Its new text is keyed on both platforms: the "Git changes has N
changed files." / "The last turn changed N files." plurals, the "Show %s"
action, and one format that joins the empty detail and the hint, so
translators control the order. Android holds the hint as UiText; iOS as
OpenCodeText.

Also keys the session list's Recent hint ("Needs a glance"), which was
still a hard-coded constant on both platforms while its title was keyed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review: no finding that 2+ of 3 passes agreed on.

2 finding(s) from a single pass, not posted
  • ios/OpenCode Mobile/OpenCode Mobile/UI/Changes/ChangesViewModel.swift:363 medium: iOS settle loop trusts a v2 adapter predicate Android rejects, so the settle fix can't save Git changes on iOS (glm-5.3-flash)
  • scripts/scenario-harness/harness.mjs:222 low: gitCommit automation step runs git in the harness process cwd when the project is unset (glm-5.3-flash)

opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.119 · 1 pass(es) stopped early

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.

1 participant