feat: skip mobile ship all/staged choice on a clean tree - #799
Merged
Merged
Conversation
When git status has no uncommitted changes, hide All/Staged on the Ship sheet and send staged scope, matching desktop #727. A dirty tree or unread/failed status still asks. Uses the existing source control snapshot rather than a new verb.
Contributor
There was a problem hiding this comment.
Important
Ship hides All vs Staged from the Source Control panel snapshot. That snapshot can be a nested repository, while the host always ships the workspace root.
Reviewed changes
This PR ports desktop's clean-tree Ship skip to mobile: hide All vs Staged when git status has no entries, and submit stagedOnly: true.
- Scope helper —
shipShowsWorkingTreeScopeChoicehides the control only for a loaded snapshot with emptyentries; a missing or failed status keeps All vs Staged. - Ship sheet —
askWorkingTreeScope(default true) gates the segmented control and, when false, initializes_stagedOnlyso submit still ships staged. - Panel wiring —
shipawaits_askWorkingTreeScopebefore opening the sheet, readingsourceControlControllerProviderwhen the host advertises Source Control. - Tests — helper, sheet, and panel coverage for clean, dirty, and failed status; no nested-root case.
- Docs —
mobile/AGENTS.mdShip bullet records the hide-when-clean behavior.
Grok | 𝕏
Host Ship plans against the workspace path, not a nested Source Control root. Ask All vs Staged from workspace-root git status so a clean nested repo cannot hide the choice while the workspace is dirty.
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the prior review, Ship decides All vs Staged from workspace-root git status, matching desktop and host plan_ship.
- Workspace-root status —
_askWorkingTreeScopenow callsgitStatus(workspaceId)with emptyrelativeRootand no longer reads the Source Control controller. - Nested-root coverage — a panel test keeps All vs Staged when a saved nested root would have been clean and the workspace is dirty.
- Docs —
mobile/AGENTS.mdrecords that the hide uses workspace-root status.
Grok | 𝕏
…n-tree # Conflicts: # mobile/AGENTS.md
…n-tree # Conflicts: # mobile/lib/src/features/workbench/presentation/pull_request_panel_actions.dart
…n-tree # Conflicts: # mobile/AGENTS.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Mobile Ship always showed All Changes / Staged Changes. Desktop #727 ships staged without that choice when
git statushas no entries, which is how already-committed work opens a PR.The phone now calls
mobile.git.statuson the workspace root (emptyrelativeRoot), matching desktop and host Ship. A clean tree hides the segmented control and ships staged. Uncommitted changes keep All vs Staged. A missing or failed status keeps the choice.No new runtime verb. Auto-branch of unpushed main stays on the host.
Validation
flutter test test/pull_request_ship_sheet_test.dart test/pull_request_actions_test.dartwith Flutter 3.47.2flutter analyzeon the touched filesRisks
git.statusat Ship time. A nested Source Control root is ignored on purpose, because host Ship always plans againstworkspace.path.