Repository navigation
fix(mobile): update the iOS Git header menu when status changes - #16330
juliusmarminge wants to merge 1 commit into
Conversation
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
| options, | ||
| // Header item factories are stabilized, so the native header only re-reads them when | ||
| // this version changes. Keying on the items keeps the Git menu status live. | ||
| optionsVersion: layout.usesSplitView ? threadCenterHeaderItems : compactRightHeaderItems, |
There was a problem hiding this comment.
🟠 High threads/useThreadHeaderOptions.tsx:115
When gitStatus.isDefaultRef changes from false to true while the branch name and ahead count are unchanged, optionsVersion remains identical, so the native menu keeps the old onPress callback and runs push instead of commit_push, bypassing the default-branch confirmation. Include the quick-action kind/action or the relevant status fields in optionsVersion so setOptions refreshes the callback.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @apps/mobile/src/features/threads/useThreadHeaderOptions.tsx around line 115:
When `gitStatus.isDefaultRef` changes from `false` to `true` while the branch name and ahead count are unchanged, `optionsVersion` remains identical, so the native menu keeps the old `onPress` callback and runs `push` instead of `commit_push`, bypassing the default-branch confirmation. Include the quick-action kind/action or the relevant status fields in `optionsVersion` so `setOptions` refreshes the callback.
ApprovabilityVerdict: Would Approve Macroscope's review found this PR approvable — This is a narrowly scoped iOS mobile bug fix with a mechanical component extraction and regression coverage, and it does not alter schemas, deployment, security-sensitive code, product defaults, or static-analysis settings. A remaining high-severity finding describes a possible stale Git action callback during default-branch transitions and should be handled by the repository’s blocking-review process. Not approved because:
Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more. |
|
Important Review skippedWe couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (5)
Limit details: You’ve used all 10 included reviews currently available. 📝 WalkthroughWalkthroughThe thread header moves from ChangesThread header
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Possibly related PRs
Merge Risk: ⚪ Minimal · up to The iOS Git header can receive updated status without an identified regression from this change. Mergeable after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
The native header only re-reads its stabilized item factories when optionsVersion changes, and the thread header keyed it on project scripts alone. A refreshed Git status (for example after reconnect) never reached the header Git popover, which kept showing the old "Clean" state. Key optionsVersion on the memoized header items instead. The options signature still compares by content, so streaming re-renders with equal items do not re-apply options. ThreadHeader moves to its own module so the test drives the production header wiring. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
7bff9d5 to
1e584b7
Compare
This is a separate bug from the reconnect refresh in #16329. On iOS, the thread header's Git menu kept showing an old status (for example
Clean) even after the Git status refreshed.NativeStackScreenOptionsstabilizes header item factories and re-applies options only when the content signature changes.ThreadHeaderpassedoptionsVersion={projectScripts}, so a new Git status never reached the native menu.useThreadHeaderOptionsnow returnsoptionsVersionas the memoized header items that are on screen. Those items already depend ongitStatus, branch, and quick action. On Android it returns[], because the actions there render as children. The signature still compares content, so streaming re-renders with equal items do not callsetOptions.ThreadHeadermoves verbatim into its own module so the test can render the production wiring. The only change is theoptionsVersionline.Before / after
Same release fixture, viewport, and synthetic 300-message thread on both bundles. Background for more than 16 s, add an untracked file, resume, open the header Git menu.
521c10fc…(#16329 only), file added068d9912…, file addedEach resume issued exactly one
vcs.refreshStatuson both bundles, so the before shot shows a refreshed status that never reached the native menu. Release simulator (iPhone 17 Pro, iOS 27, Hermes, no Metro). A video is not needed for a static label. Aggregate evidence: git-header-evidence.json.Tests
useThreadHeaderOptions.test.tsxrenders the realThreadHeader→ScreenHeader→NativeStackScreenOptions; only navigation, RN, layout, appearance, and the mail toolbar are mocked.projectScriptsfails the status test (Cleanvs1 changed).setOptions.Not claimed: CPU, battery, or latency impact; physical-device runs. Android has no native header item factories, so it is unaffected.
Opus 5.5 via Claude Code in T3 Code.
🤖 Generated with Claude Code