@@ -82,6 +82,8 @@ export function PullRequestMergeControls(props: {
8282 ? `${ MERGE_METHODS [ method ] . title } stack (${ scope . layers . length } )`
8383 : MERGE_METHODS [ method ] . title
8484 : "Merge unavailable" ;
85+ const autoMergeArmed = pr . state === "open" && pr . autoMergeEnabled === true ;
86+ const armedLabel = `Auto-merge pending${ pr . autoMergeMethod ? ` (${ pr . autoMergeMethod } )` : "" } ` ;
8587 const autoAction = pr . autoMergeEnabled ? "disable-auto-merge" : "enable-auto-merge" ;
8688 const canAutoMerge =
8789 ! busy &&
@@ -167,13 +169,25 @@ export function PullRequestMergeControls(props: {
167169 return (
168170 < View className = "gap-2 border-t border-border-subtle p-3" >
169171 < SplitButton
170- label = { busy ? "Working…" : ! permissions . connected ? "Reconnect to merge" : label }
172+ label = {
173+ busy
174+ ? "Working…"
175+ : ! permissions . connected
176+ ? "Reconnect to merge"
177+ : autoMergeArmed
178+ ? armedLabel
179+ : label
180+ }
171181 accessibilityLabel = {
172- scope ? `${ label } , ${ scope . layers . length } stack layers through #${ pr . number } ` : label
182+ autoMergeArmed
183+ ? `${ armedLabel } , merges once its requirements are met`
184+ : scope
185+ ? `${ label } , ${ scope . layers . length } stack layers through #${ pr . number } `
186+ : label
173187 }
174- icon = { PullRequestGlyph . merged }
175- disabled = { ! canMerge }
176- loading = { busy || checkingStack }
188+ icon = { autoMergeArmed ? "clock" : PullRequestGlyph . merged }
189+ disabled = { ! canMerge || autoMergeArmed }
190+ loading = { busy || ( ! autoMergeArmed && checkingStack ) }
177191 onPress = { ( ) => confirm ( "merge" ) }
178192 menuTitle = "Merge options"
179193 actions = { [
@@ -202,17 +216,13 @@ export function PullRequestMergeControls(props: {
202216 } }
203217 />
204218 { permissions . connected &&
219+ ! autoMergeArmed &&
205220 reason &&
206221 reason !== MERGE_CONFLICT_REASON &&
207222 reason !== "Checking stack membership…" &&
208223 ! ( checkingStack && reason === "Refresh the stack before merging." ) ? (
209224 < Text className = "px-1 text-xs text-foreground-muted" > { reason } </ Text >
210225 ) : null }
211- { pr . autoMergeEnabled ? (
212- < Text className = "px-1 text-xs text-foreground-muted" >
213- Auto-merge is enabled{ pr . autoMergeMethod ? ` · ${ pr . autoMergeMethod } ` : "" }
214- </ Text >
215- ) : null }
216226 { stack . error && stack . supportsStackActions ? (
217227 < Button label = "Retry stack lookup" tone = "text" onPress = { stack . refresh } />
218228 ) : null }
0 commit comments