diff --git a/mobile/src/source-control/MobileSourceControlContent.tsx b/mobile/src/source-control/MobileSourceControlContent.tsx
index 2eaf6dc4a1f..190367e0e16 100644
--- a/mobile/src/source-control/MobileSourceControlContent.tsx
+++ b/mobile/src/source-control/MobileSourceControlContent.tsx
@@ -52,6 +52,7 @@ export function MobileSourceControlContent({ state, hostId, worktreeId, name }:
runGitAction
} = state
const ioBusy = busyAction !== null || openingPath !== null || openingBranchPath !== null
+ const shouldShowGenerateButton = stagedCount > 0 || generatingMessage
return (
<>
@@ -227,30 +228,32 @@ export function MobileSourceControlContent({ state, hostId, worktreeId, name }:
onSubmitEditing={primaryAction.onPress}
/>
)}
- [
- styles.generateButton,
- (stagedCount === 0 || busyAction !== null) && styles.commitButtonDisabled,
- pressed && styles.commitButtonPressed
- ]}
- // Why: stay tappable while generating so the press can cancel
- // (disabling it here made the cancel branch below unreachable).
- disabled={stagedCount === 0 || busyAction !== null}
- onPress={() =>
- generatingMessage ? cancelGenerateCommitMessage() : void generateCommitMessage()
- }
- accessibilityLabel={
- generatingMessage
- ? 'Cancel commit message generation'
- : 'Generate commit message with AI'
- }
- >
- {generatingMessage ? (
-
- ) : (
-
- )}
-
+ {shouldShowGenerateButton ? (
+ [
+ styles.generateButton,
+ busyAction !== null && styles.commitButtonDisabled,
+ pressed && styles.commitButtonPressed
+ ]}
+ // Why: commit-message AI belongs to the commit path; hiding it
+ // during Stage All keeps the quick action visually unambiguous.
+ disabled={busyAction !== null}
+ onPress={() =>
+ generatingMessage ? cancelGenerateCommitMessage() : void generateCommitMessage()
+ }
+ accessibilityLabel={
+ generatingMessage
+ ? 'Cancel commit message generation'
+ : 'Generate commit message with AI'
+ }
+ >
+ {generatingMessage ? (
+
+ ) : (
+
+ )}
+
+ ) : null}
[
styles.commitButton,