Skip to content

feat: skip mobile ship all/staged choice on a clean tree - #799

Merged
leynier merged 5 commits into
mainfrom
feat/mobile-ship-clean-tree
Sep 17, 2026
Merged

leynier merged 5 commits into
mainfrom
feat/mobile-ship-clean-tree

Conversation

@leynier

@leynier leynier commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Summary

Mobile Ship always showed All Changes / Staged Changes. Desktop #727 ships staged without that choice when git status has no entries, which is how already-committed work opens a PR.

The phone now calls mobile.git.status on the workspace root (empty relativeRoot), 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.dart with Flutter 3.47.2
  • flutter analyze on the touched files

Risks

  • Status is a fresh workspace-root git.status at Ship time. A nested Source Control root is ignored on purpose, because host Ship always plans against workspace.path.
  • Hosts without source control still show All/Staged, because status cannot be read.

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.

@pullfrog pullfrog Bot 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.

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 helpershipShowsWorkingTreeScopeChoice hides the control only for a loaded snapshot with empty entries; a missing or failed status keeps All vs Staged.
  • Ship sheetaskWorkingTreeScope (default true) gates the segmented control and, when false, initializes _stagedOnly so submit still ships staged.
  • Panel wiringship awaits _askWorkingTreeScope before opening the sheet, reading sourceControlControllerProvider when the host advertises Source Control.
  • Tests — helper, sheet, and panel coverage for clean, dirty, and failed status; no nested-root case.
  • Docsmobile/AGENTS.md Ship bullet records the hide-when-clean behavior.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Grok𝕏

Comment thread mobile/lib/src/features/workbench/presentation/pull_request_panel_actions.dart Outdated
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.

@pullfrog pullfrog Bot 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.

✅ 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_askWorkingTreeScope now calls gitStatus(workspaceId) with empty relativeRoot and 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.
  • Docsmobile/AGENTS.md records that the hide uses workspace-root status.

Pullfrog  | View workflow run | Using Grok𝕏

…n-tree

# Conflicts:
#	mobile/lib/src/features/workbench/presentation/pull_request_panel_actions.dart
@leynier
leynier merged commit fe7bfc5 into main Sep 17, 2026
20 checks passed
@leynier
leynier deleted the feat/mobile-ship-clean-tree branch September 17, 2026 07:45
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